feat(auth): verify OIDC access tokens for the API - #161
Draft
djwhitt wants to merge 9 commits into
Draft
Conversation
Authenticate bounded JWT bearer tokens with strict asymmetric JOSE verification, exact issuer and audience checks, integer time claims, supervised JWKS rotation, and exact claim-value capability mapping. Unknown key refreshes are globally rate-limited and failures remain generic and fail closed. A temporary coarse gate requires all current API capabilities until T-233 adds route-specific authorization.
djwhitt
marked this pull request as draft
August 16, 2026 00:09
Carry the hardened provider cache, updated lower stack, and current origin/main into the published API-token layer without rewriting existing commits.
T-232 adds role-specific token type and required-claim policies, rejects an API audience that aliases the browser client id, and keeps the global settings only as backward-compatible defaults.
Carry the provider follow-up validation and refresh-worker lifecycle fix into the published API-token layer without rewriting its existing commits.
Propagate the provider-layer callback, host, and scope validation through the published API-token layer without rewriting existing commits. Tests: ../bin/x mix ci Tests: ../bin/test Tests: ../bin/x mix dialyzer
Reject API bearer tokens whose audience list contains the configured browser client ID, while preserving authorized-party metadata on legitimate resource access tokens. Cover the signed multi-audience ID-token confusion case and document the deployment binding. Tests: ../bin/test test/smolquery/auth/oidc/token_test.exs Refs T-232 and PL-27.
Refuse API OIDC startup unless the deployment supplies either the browser client ID to exclude from audiences or an API-specific token type/required-claim profile. Split API/web deployments can no longer silently fall back to audience-only ID-token acceptance. Refs T-232 and PL-27.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
azp/client_idmetadataTracker: T-232
Validation
../bin/x mix ci../bin/test../bin/x mix dialyzerStack
Depends on #160. This is layer 4 of stack #151.
Stack managed with GitHub Stacks CLI.