(
access_token: str | None = None,
)
| 107 | |
| 108 | |
| 109 | def github_api_headers( |
| 110 | access_token: str | None = None, |
| 111 | ) -> dict[str, str]: # mutable-ok: returned straight into httpx handlers whose headers params require dict |
| 112 | headers: Final = { |
| 113 | "accept": "application/json", |
| 114 | "editor-version": "vscode/1.85.1", |
| 115 | "editor-plugin-version": "copilot/1.155.0", |
| 116 | "user-agent": "GithubCopilot/1.155.0", |
| 117 | "accept-encoding": "gzip,deflate,br", |
| 118 | "content-type": "application/json", |
| 119 | } |
| 120 | if access_token: |
| 121 | headers["authorization"] = f"token {access_token}" |
| 122 | return headers |
| 123 | |
| 124 | |
| 125 | class Authenticator: |
no outgoing calls