Repository navigation
fix(oauth2): Apply default token exp if nil #1353 - #1616
Open
millionsouls wants to merge 5 commits into
Open
millionsouls wants to merge 5 commits into
millionsouls wants to merge 5 commits into
Conversation
millionsouls
marked this pull request as ready for review
November 5, 2026 00:10
millionsouls
force-pushed
the
expiry2
branch
6 times, most recently
from
November 9, 2026 15:30
a776693 to
7609a87
Compare
gtema
requested changes
Nov 10, 2026
millionsouls
force-pushed
the
expiry2
branch
3 times, most recently
from
November 12, 2026 14:43
53f88d0 to
6798a66
Compare
millionsouls
marked this pull request as draft
November 12, 2026 14:43
millionsouls
force-pushed
the
expiry2
branch
3 times, most recently
from
November 13, 2026 14:40
995911f to
5b083c7
Compare
millionsouls
marked this pull request as ready for review
November 14, 2026 19:09
) Use configured access token lifetime if the subject or app cred token have no expiry. Caps exp at credential expiry that is present, reject any lifetime that is not postive, and send result to expires_in. Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: Kevin <36448536+millionsouls@users.noreply.github.com>
Assert that token exchange uses configured default when validated cred expiries are later, and that expires_in matches exp-iat. Returns invalid_request for expired or invalid subject credentials. Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: Kevin <36448536+millionsouls@users.noreply.github.com>
Signed-off-by: Kevin <36448536+millionsouls@users.noreply.github.com>
Route claim building failures to the shared exchange_error mapper instead of a partial inline mapping. Signed-off-by: Kevin <36448536+millionsouls@users.noreply.github.com>
Feeds client side TokenExchangeError through exchange_error and asserts each maps to 400 invalid_request. Signed-off-by: Kevin <36448536+millionsouls@users.noreply.github.com>
millionsouls
force-pushed
the
expiry2
branch
from
November 14, 2026 19:10
5b083c7 to
417fd76
Compare
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
Use configured access token lifetime if the subject or app cred token have no expiry. Caps exp at credential expiry that is present, reject any lifetime that is not postive, and send result to expires_in. Removed prior MissingSubjectTokenExpiry error, and changed the respective test function to instead test for applying default expiration lifetime.
Test plan
cargo test -p openstack-keystone-core oauth2_client::token_exchange::testsExpiry rulescargo test -p openstack-keystone api::v4::oauth2::token::token_exchange::testsEndpoint and responsecargo check -p openstack-keystone --message-format=shortCompilingcargo fmt --checkFormattingSecurity review checklist
Required if this diff touches authentication, scope, delegation, tokens,
credentials, EC2, trusts, application credentials, or OPA policy input.
Delete this section entirely if it doesn't apply. 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)onto
Credentialsfrom the chain, and does the rule anchor ondelegated_project_id+ carry the scope-drift tripwire? (I2/I3)roles still bounded by the delegation? Added a test that a restricted
delegation cannot exceed its roles via the new path? (I4)
ScopeInfovariant or auth method? Updatedvalidate_scope_boundaries(),calculate_effective_roles(),fully_resolved(), andCredentials::try_from— all without adding awildcard
_ =>arm? (I5, Gate J)sha256(access))? Does itre-assert
type/shape after fetch? (I6)Gate I)
per-item read policy? (I8)
and leave the per-item pass to sort it out? Is the value the
collection policy gates on the same one the driver actually filters
by? (I8a)
request-supplied scope? (I5)
positive tests proving the happy path works?
ValidatedSecurityContext::new_for_scope()end-to-end, not just the inner helper (
calculate_effective_roles,validate_scope_boundaries) in isolation?