Skip to content

refactor(authserver): remove grant type and target abstractions - #53

Merged
tronghn merged 5 commits into
feat/remove_client_credentialsfrom
refactor/remove_grant_type_and_target
Nov 19, 2026
Merged

tronghn merged 5 commits into
feat/remove_client_credentialsfrom
refactor/remove_grant_type_and_target

Conversation

@tronghn

@tronghn tronghn commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Token exchange to an audience client ID is now the only grant and target type, so the abstractions for multiple grants and targets are no longer needed.

  • Replace the TokenRequest and Target interfaces with TokenExchangeRequest and ClientID. Remove always-true grant type checks and the unused scope target.
  • Stop issuing the urn:nais:grant_type claim, and remove the constant grant_type and target_type attributes from logs and the token grant metric. Update the dashboard to match.
  • Combine overlapping token exchange and config validation tests into tables, and move the claims tests to the jwt package.

Token exchange is the only grant. Replace the TokenRequest interface
with TokenExchangeRequest, drop always-true grant type checks and the
unused scope target, and look up issuer aliases without building a map.
The value is always token exchange. Issued tokens no longer contain
urn:nais:grant_type, and logs and the token grant metric no longer
carry a grant_type attribute.
Run the subject token exchange and chained exchange as one table over
external and internal subject tokens, and fold the client credentials
and external issuer validation cases into their existing tables.
The target is always an audience client ID. Remove the Target interface
and the constant target_type log field.
@tronghn
tronghn force-pushed the refactor/remove_grant_type_and_target branch from f8b9895 to 29cb52d Compare November 19, 2026 07:52
@tronghn
tronghn added this pull request to stack #55 November 19, 2026 07:54

@tommytroen tommytroen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tronghn
tronghn enabled stacked auto-merge (squash) November 19, 2026 10:03
@tronghn
tronghn merged commit 74de1d3 into main Nov 19, 2026
13 checks passed
@tronghn
tronghn deleted the refactor/remove_grant_type_and_target branch November 19, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants