mainframe.rules =============== .. py:module:: mainframe.rules Attributes ---------- .. autoapisummary:: mainframe.rules.REPOSITORY Classes ------- .. autoapisummary:: mainframe.rules.Rules Functions --------- .. autoapisummary:: mainframe.rules.build_auth_header mainframe.rules.fetch_commit_hash mainframe.rules.parse_zipfile mainframe.rules.fetch_zipfile mainframe.rules.fetch_rules Module Contents --------------- .. py:data:: REPOSITORY :type: Final[str] :value: 'vipyrsec/security-intelligence' .. py:class:: Rules .. py:attribute:: rules_commit :type: str .. py:attribute:: rules :type: dict[str, str] .. py:function:: build_auth_header(access_token: str) -> dict[str, str] Build authentication headers given the access token .. py:function:: fetch_commit_hash(http_client: httpx.Client, *, repository: str, access_token: str) -> str Fetch the top commit hash of the given repository .. py:function:: parse_zipfile(zipfile: zipfile.ZipFile) -> dict[str, str] Parse a zipfile and return a dict mapping filenames to content .. py:function:: fetch_zipfile(http_client: httpx.Client, *, repository: str, access_token: str) -> zipfile.ZipFile Download the source zipfile from GitHub for the given repository .. py:function:: fetch_rules(http_client: httpx.Client) -> Rules Return the commit hash and all the rules