Repository navigation
Conversation
Signed-off-by: Zebang Li <99422132+Mark101001@users.noreply.github.com>
This branch has not been deployed
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
Require
subject_token_typefor the existing RFC 8693 token-exchange handler.urn:ietf:params:oauth:token-type:jwt, following [course issue #5](Add /token dispatch branch for token-exchange grant type ec528-fall26/keystone-ng#5).invalid_requestand a descriptive error when the type is missing or unsupported.subject_token_type.The existing grant dispatcher, client authentication, token verification, and delegation checks are retained. This change validates the declared token type; it does not add external JWT signature verification.
This implements the course requirement, not the full conformance requirements of upstream issue #1354. Alignment with upstream token-type dispatch remains pending.
Test plan
Ran on the feature branch:
cargo test -p openstack-keystone test_token_exchange -j 1Result: 11 passed, 0 failed.
Coverage includes:
Additional integration validation on
demo-2: 17 token-exchange tests and the external JWT verification demo passed, after a separate follow-up updated the expiry and external JWT test requests. Those integration changes are not included in this PR.The full project test suite was not run.
Security review checklist
Author notes for reviewer assessment:
ValidatedSecurityContext::new_for_scope().The checklist below is left unchecked for reviewer assessment.
See
doc/src/contributor/security-model.md§7 for the full context behind each item.project_id,ScopeInfo) where it should read the chain (authentication_context(), delegation object)? (I1/I2)Credentialsfrom the chain, and does the rule anchor ondelegated_project_id+ carry the scope-drift tripwire? (I2/I3)ScopeInfovariant or auth method? Updatedvalidate_scope_boundaries(),calculate_effective_roles(),fully_resolved(), andCredentials::try_from— all without adding a wildcard_ =>arm? (I5, Gate J)sha256(access))? Does it re-asserttype/shape after fetch? (I6)ValidatedSecurityContext::new_for_scope()end-to-end, not just the inner helper (calculate_effective_roles,validate_scope_boundaries) in isolation?