angee.integrate_github.backend
GitHub REST implementation of the host-agnostic :class:VCSBackend.
Reads a GitHub remote over the REST API to populate the integrate inventory — listing repositories (by org), walking trees, reading blobs, resolving refs — and verifies inbound push webhooks. It never clones: git transport is the operator's job. Outbound calls go through the shared SSRF-pinned client (self.http, from :class:~angee.integrate.http.HttpClientMixin on :class:VCSBackend); the API base is admin-configured (api.github.com by default, a GHE host via VcsBridge.config), so the host is trusted rather than user-supplied per request.
MAX_REPO_PAGES
Hard cap on repository pages (~10k repos) so a pathological listing can't loop forever.
SEARCH_LIMIT
Repository search results returned for a typeahead query.
GitHubApiError
class GitHubApiError(Exception)Raised when the GitHub REST API returns a non-success, non-404 status.
__init__
def __init__(message: str, *, status: int) -> NoneRecord the HTTP status for the failed request.
GitHubBackend
class GitHubBackend(VCSBackend)A :class:VCSBackend that reads a GitHub remote over the REST API.
api_base
@property
def api_base() -> strReturn the REST API base URL (api.github.com or a configured GHE host).
ls_repos
def ls_repos(*, org: str = "") -> list[RepoDescriptor]List every repository for org (or the authenticated account when blank).
Pages through the full listing: reconcile prunes repositories absent from this result, so a truncated first page would delete every repo past it. A short page (fewer than PER_PAGE) is the last; a hard cap bounds a pathological loop.
ls_tree
def ls_tree(repository: Any,
*,
ref: str,
path: str,
recursive: bool = False) -> list[TreeEntry]List the tree under path at ref via the git-trees API.
cat_file
def cat_file(repository: Any, *, ref: str, path: str) -> bytesReturn the bytes of one blob via the contents API; raise if absent or a tree.
rev_parse
def rev_parse(repository: Any, ref: str) -> strResolve ref to a commit oid via the commits API.
search_repos
def search_repos(query: str, *, org: str = "") -> list[RepoDescriptor]Return repositories whose name matches query via the search API (typeahead).
get_repo
def get_repo(name: str) -> RepoDescriptorReturn one repository by owner/repo name; raise FileNotFoundError if absent.
verify_webhook
def verify_webhook(vcs_bridge: Any, request: Any) -> boolVerify an inbound push webhook's HMAC-SHA256 signature against the secret.