-
Notifications
You must be signed in to change notification settings - Fork 50
feat(auth): client conformance for Workload Identity Federation (SEP-1933) #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
coding-bobo
wants to merge
18
commits into
modelcontextprotocol:main
Choose a base branch
from
coding-bobo:worktree-feat+wif-jwt-helper
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,216
−4
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a966549
feat(auth): add JWT-bearer helper for WIF client conformance (SEP-1933)
coding-bobo 6c2ecf0
feat(auth): add WIF JWT-bearer scenario and negative tests (SEP-1933)
coding-bobo 91a9c08
style: apply prettier formatting to wif-jwt-bearer.ts
coding-bobo f10845a
fix(auth): add expired-assertion negative test; clarify wif-jwt-beare…
coding-bobo 3b4e7f9
fix(wif-jwt-bearer): disable DCR, detect retries, improve getChecks d…
coding-bobo b07e3e6
style: prettier formatting on everything-client.ts
coding-bobo 927e5a5
fix(wif-jwt-bearer): let errors propagate from broken example clients
coding-bobo cc315f1
fix(wif-jwt-bearer): tag as draft, add scope-rejected check, add SEP …
coding-bobo 3cd64bb
style: prettier formatting
coding-bobo 4fcabd7
feat(wif-jwt-bearer): add wif-grant-fallback check for unauthorized_c…
coding-bobo b96cde3
style: rename unused scope param in WifGrantFallbackProvider
coding-bobo ed3cd14
feat(wif-jwt-bearer): use realistic SPIFFE and K8s PSAT token formats
coding-bobo 0815651
style: prettier formatting on wif-jwt-bearer.ts
coding-bobo 00b0b04
chore(wif-jwt-bearer): drop informational k8s_issuer/k8s_subject from…
coding-bobo ce3968d
fix(wif-jwt-bearer): address pre-merge review feedback
coding-bobo d64e0dd
fix(wif-jwt-bearer): drop decorative fields and neutralise JWT fixtures
coding-bobo c7ccca4
fix(wif-jwt-bearer): remove workaround comment, drop signing_algorith…
coding-bobo e5e13c4
fix(wif-jwt-bearer): export scope constants, remove unused AS field, …
coding-bobo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
examples/clients/typescript/auth-test-wif-expired-assertion.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| /** | ||
| * Broken WIF client: presents a JWT that is already expired. | ||
| * BUG: Uses expired_jwt instead of valid_jwt — server rejects with invalid_grant. | ||
| */ | ||
|
|
||
| import { runWifJwtBearerExpiredAssertion } from './everything-client.js'; | ||
| import { runAsCli } from './helpers/cliRunner.js'; | ||
|
|
||
| runAsCli( | ||
| runWifJwtBearerExpiredAssertion, | ||
| import.meta.url, | ||
| 'auth-test-wif-expired-assertion <server-url>' | ||
| ); | ||
15 changes: 15 additions & 0 deletions
15
examples/clients/typescript/auth-test-wif-grant-fallback.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| /** | ||
| * Broken WIF client: falls back to authorization_code after receiving unauthorized_client. | ||
| * BUG: switches grant type instead of surfacing the error. | ||
| */ | ||
|
|
||
| import { runWifJwtBearerGrantFallback } from './everything-client.js'; | ||
| import { runAsCli } from './helpers/cliRunner.js'; | ||
|
|
||
| runAsCli( | ||
| runWifJwtBearerGrantFallback, | ||
| import.meta.url, | ||
| 'auth-test-wif-grant-fallback <server-url>' | ||
| ); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| /** | ||
| * Broken WIF client: omits the assertion parameter from the token request. | ||
| * BUG: Does not include assertion in JWT-bearer grant — server rejects with invalid_request. | ||
| */ | ||
|
|
||
| import { runWifJwtBearerMissingAssertion } from './everything-client.js'; | ||
| import { runAsCli } from './helpers/cliRunner.js'; | ||
|
|
||
| runAsCli( | ||
| runWifJwtBearerMissingAssertion, | ||
| import.meta.url, | ||
| 'auth-test-wif-no-assertion <server-url>' | ||
| ); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| /** | ||
| * Broken WIF client: retries JWT-bearer after receiving unauthorized_client. | ||
| * BUG: retries instead of surfacing the error. | ||
| */ | ||
|
|
||
| import { runWifJwtBearerRetry } from './everything-client.js'; | ||
| import { runAsCli } from './helpers/cliRunner.js'; | ||
|
|
||
| runAsCli( | ||
| runWifJwtBearerRetry, | ||
| import.meta.url, | ||
| 'auth-test-wif-retry <server-url>' | ||
| ); |
15 changes: 15 additions & 0 deletions
15
examples/clients/typescript/auth-test-wif-scope-rejected.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| /** | ||
| * Broken WIF client: requests a scope the AS does not permit for JWT-bearer grant. | ||
| * BUG: Includes 'wif.rejected' in the scope parameter — AS returns invalid_scope. | ||
| */ | ||
|
|
||
| import { runWifJwtBearerScopeRejected } from './everything-client.js'; | ||
| import { runAsCli } from './helpers/cliRunner.js'; | ||
|
|
||
| runAsCli( | ||
| runWifJwtBearerScopeRejected, | ||
| import.meta.url, | ||
| 'auth-test-wif-scope-rejected <server-url>' | ||
| ); |
15 changes: 15 additions & 0 deletions
15
examples/clients/typescript/auth-test-wif-wrong-audience.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| /** | ||
| * Broken WIF client: presents a JWT with the wrong audience. | ||
| * BUG: Uses wrong_audience_jwt instead of valid_jwt — server rejects with invalid_grant. | ||
| */ | ||
|
|
||
| import { runWifJwtBearerWrongAudience } from './everything-client.js'; | ||
| import { runAsCli } from './helpers/cliRunner.js'; | ||
|
|
||
| runAsCli( | ||
| runWifJwtBearerWrongAudience, | ||
| import.meta.url, | ||
| 'auth-test-wif-wrong-audience <server-url>' | ||
| ); |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here and below: can you put the broken implementation in the negative test file? we're keeping
everything-clientas the "good" client, and broken implementations (mostly) self-contained (though it's okay to share helpers)