You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`getDefaultGitHubAuth(env)` — returns `{ kind: "app", ... }` if `GITHUB_APP_ID` + `GITHUB_APP_PRIVATE_KEY` + `GITHUB_APP_INSTALLATION_ID` (or per-org map) are all configured; otherwise `{ kind: "pat", token: env.GITHUB_ADMIN_PAT }`. Phase 3 swaps callers over to this helper.
`Bindings` interface in `backend/src/index.ts` gets the three new optional secrets.
Tests
`test/github-auth.test.ts` — unit tests for JWT structure, cache hit/miss, refresh-before-expiry, two-installation cache isolation. Use the project's no-mocks rule: stand up a tiny local HTTP server inside the test that returns a canned access-token response.
Acceptance
New helper compiles, types-check, tests pass.
Worker env on dev gets the three new secrets set (using the App from Phase 1) — verify with a one-shot `/admin/github-auth-debug` endpoint (or temporary log line) that the App path returns a valid token. Tear down the debug endpoint before merge.
`GITHUB_ADMIN_PAT` still used by every existing caller; this PR adds no behavior change to live flows.
Activity
Phase 2: Worker auth layer for GitHub App tokens (#437) (#442)