MCPcopy Index your code
hub / github.com/github/spec-kit / GitHubAuth

Class GitHubAuth

src/specify_cli/authentication/github.py:8–24  ·  view source on GitHub ↗

GitHub authentication provider. Supports the ``bearer`` auth scheme, used for PATs, fine-grained PATs, OAuth tokens, and GitHub App installation tokens.

Source from the content-addressed store, hash-verified

6
7
8class GitHubAuth(AuthProvider):
9 """GitHub authentication provider.
10
11 Supports the ``bearer`` auth scheme, used for PATs, fine-grained PATs,
12 OAuth tokens, and GitHub App installation tokens.
13 """
14
15 key = "github"
16 supported_auth_schemes = ("bearer",)
17
18 def auth_headers(self, token: str, auth_scheme: str) -> dict[str, str]:
19 """Return ``Authorization: Bearer <token>``."""
20 if auth_scheme != "bearer":
21 raise ValueError(
22 f"GitHubAuth does not support auth scheme {auth_scheme!r}"
23 )
24 return {"Authorization": f"Bearer {token}"}

Calls

no outgoing calls