Skip to content

feat(oauth2): Apply default lifetime to service grants - #1645

Draft
millionsouls wants to merge 1 commit into
openstack-experimental:mainfrom
millionsouls:service-grant-expiry
Draft

millionsouls wants to merge 1 commit into
openstack-experimental:mainfrom
millionsouls:service-grant-expiry

Conversation

@millionsouls

Copy link
Copy Markdown
Contributor

Summary

Service grants created withput expires_at on a client with no max_grant_lifetime were previously permanent. They now expire after the configured [oauth2]access_token_lifetime_minutes. Explicitly declared expiries function the same as before. Lifetime calculation moves into a shared deadline_after helper that returns a provider error instead of panicking on zero or out of range values. Docs are updated, added unit tests to cover default, configured, and zero/out of range cases.

Test plan

cargo test -p openstack-keystone-core service_grant
cargo test -p openstack-keystone-core test_create_
cargo test -p openstack-keystone-core-types service_grant
cargo test -p openstack-keystone-api-types --all-features

Service grants created withput expires_at on a client with no
max_grant_lifetime were previously permanent. They now expire after
the configured [oauth2]access_token_lifetime_minutes. Explicitly
declared expiries function the same as before. Lifetime calculation
moves into a shared deadline_after helper that returns a provider
error instead of panicking on zero or out of range values. Docs are
updated, added unit tests to cover default, configured, and
zero/out of range cases.

Signed-off-by: Kevin <36448536+millionsouls@users.noreply.github.com>
/// and intersected with the grantor's live roles at every redemption.
pub role_ids: Vec<String>,
/// Expiry; `None` = until revoked.
/// Expiry. Always set for grants created with a default lifetime;
/// and intersected with the grantor's live roles at every redemption.
pub role_ids: Vec<String>,
/// Expiry; `None` = until revoked.
/// Expiry. Always set for grants created with a default lifetime;

This branch has not been deployed

No deployments
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