mainframe.rules

Attributes

Classes

Functions

build_auth_header(→ dict[str, str])

Build authentication headers given the access token

fetch_commit_hash(→ str)

Fetch the top commit hash of the given repository

parse_zipfile(→ dict[str, str])

Parse a zipfile and return a dict mapping filenames to content

fetch_zipfile(→ zipfile.ZipFile)

Download the source zipfile from GitHub for the given repository

fetch_rules(→ Rules)

Return the commit hash and all the rules

Module Contents

mainframe.rules.REPOSITORY: Final[str] = 'vipyrsec/security-intelligence'[source]
class mainframe.rules.Rules[source]
rules_commit: str[source]
rules: dict[str, str][source]
mainframe.rules.build_auth_header(access_token: str) dict[str, str][source]

Build authentication headers given the access token

mainframe.rules.fetch_commit_hash(http_client: httpx.Client, *, repository: str, access_token: str) str[source]

Fetch the top commit hash of the given repository

mainframe.rules.parse_zipfile(zipfile: zipfile.ZipFile) dict[str, str][source]

Parse a zipfile and return a dict mapping filenames to content

mainframe.rules.fetch_zipfile(http_client: httpx.Client, *, repository: str, access_token: str) zipfile.ZipFile[source]

Download the source zipfile from GitHub for the given repository

mainframe.rules.fetch_rules(http_client: httpx.Client) Rules[source]

Return the commit hash and all the rules