module

Crig::Providers::Copilot::OAuth

OAuth device-code authentication for GitHub Copilot.

Flow:

  1. Request device code from GitHub
  2. Show user the verification URL and code
  3. Poll for access token
  4. Exchange GitHub token for Copilot API key
  5. Cache API key to disk for reuse

Constants

DEVICE_CODE_POLL_SLEEP_SECONDS = 5_u64
DEVICE_CODE_SLOW_DOWN_SECONDS = 5_u64
DEVICE_CODE_TIMEOUT_SECONDS = 15 * 60_u64
GITHUB_ACCESS_TOKEN_URL = "https://github.com/login/oauth/access_token"
GITHUB_API_KEY_URL = "https://api.github.com/copilot_internal/v2/token"
GITHUB_CLIENT_ID = "Iv1.b507a08c87ecfe98"
GITHUB_DEVICE_CODE_URL = "https://github.com/login/device/code"

Nested types