Expand description
GitHub backend — works against GitHub Cloud (api.github.com) and
GitHub Enterprise (<enterprise-host>/api/v3).
§Dependency choice
The v0.1 spec suggested octocrab as the HTTP client. This
implementation goes direct on reqwest instead, for three
reasons:
- Lighter dependency graph —
octocrabpulls in ~30 transitive crates including WebSocket plumbing we don’t use. octocrabdoes not cleanly expose a streaming asset download (the spec requiresAsyncRead, not aBytesblob).- We need precise control over rate-limit header parsing to
populate
ProviderError::RateLimited::retry_after.
All four trait methods are small — ~40 LOC between them. No real ergonomics are lost by going direct.
§Authentication
Personal Access Token via the Authorization: Bearer <token>
header. The SecretString is kept wrapped until the per-request
header is built; we never log the exposed value.
§Lint exception
This module allows unsafe_code at module level because
linkme::distributed_slice’s expansion emits a #[link_section]
attribute that Rust 1.95+ flags under the unsafe_code lint. No
hand-rolled unsafe blocks exist in this module.
§Rate limits
GitHub returns 403 + X-RateLimit-Remaining: 0 when the caller
exhausts their budget. We surface this as
ProviderError::RateLimited with retry_after populated from
either the Retry-After header or the X-RateLimit-Reset epoch
seconds value, whichever is present.
Structs§
- Github
Provider - GitHub-specific release provider. Register via the link-time
registration in this module; callers construct it through
factory.
Functions§
- factory
- Build a
GithubProviderfrom a parsed config and an optional PAT. Enforces HTTPS at construction; any URL with an explicithttp://scheme is rejected viaProviderError::InvalidConfig.