IdP resolve: discovery + JWKS, keep-last-good on failure #7

Merged
ginjiruu merged 2 commits from feat/idp-resolve into master 2026-09-14 00:34:43 +00:00
Owner

Closes #2

Implements the IdP resolve step (spec #1, seam 3) as a pure-Go package, internal/idp:

  • Resolve fetches the OIDC discovery document from the per-Client issuerURL and returns the resolved token endpoint and authorization endpoint, plus the JWKS signing keys (raw JWKS JSON) from the document's jwks_uri.
  • Resolvent (the leader-owned, per-Client state tracker) re-fetches on Refresh; on any fetch failure it keeps the last-good state, so a transient IdP outage never blanks the signing keys. A successful refresh picks up rotated keys; a partial (JWKS-only) failure never replaces the state.
  • Exercised against a stubbed (httptest) IdP that can be made to fail (discovery down, JWKS down, missing jwks_uri). The refresh TTL timer is seam 1's concern per the spec and is deliberately not in this change.

Also adds docs/agents/issue-tracker.md (Forgejo conventions + PR workflow) so the engineering skills' hard-check passes in this repo.

Verification: make test (envtest controllers + unit, go1.26.0 toolchain) and make lint (golangci-lint) pass clean.

Closes #2 Implements the IdP resolve step (spec #1, seam 3) as a pure-Go package, `internal/idp`: - `Resolve` fetches the OIDC discovery document from the per-Client `issuerURL` and returns the resolved token endpoint and authorization endpoint, plus the JWKS signing keys (raw JWKS JSON) from the document's `jwks_uri`. - `Resolvent` (the leader-owned, per-Client state tracker) re-fetches on `Refresh`; on any fetch failure it keeps the last-good state, so a transient IdP outage never blanks the signing keys. A successful refresh picks up rotated keys; a partial (JWKS-only) failure never replaces the state. - Exercised against a stubbed (httptest) IdP that can be made to fail (discovery down, JWKS down, missing `jwks_uri`). The refresh TTL timer is seam 1's concern per the spec and is deliberately not in this change. Also adds `docs/agents/issue-tracker.md` (Forgejo conventions + PR workflow) so the engineering skills' hard-check passes in this repo. Verification: `make test` (envtest controllers + unit, go1.26.0 toolchain) and `make lint` (golangci-lint) pass clean.
add idp resolve: discovery + jwks fetch, keep-last-good on failure
Some checks failed
Lint / Run on Ubuntu (push) Has been cancelled
E2E Tests / Run on Ubuntu (push) Has been cancelled
Tests / Run on Ubuntu (push) Has been cancelled
Lint / Run on Ubuntu (pull_request) Has been cancelled
E2E Tests / Run on Ubuntu (pull_request) Has been cancelled
Tests / Run on Ubuntu (pull_request) Has been cancelled
536829b995
ginjiruu merged commit ccf8c31571 into master 2026-09-14 00:34:43 +00:00
Sign in to join this conversation.
No reviewers
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lab/authz-bridge!7
No description provided.