fix: configurable oauth scope instead of hardcoded 'openid' scope [Backport release/0.6.z] - #2573
Merged
Merged
Conversation
(cherry picked from commit 9c48530)
Contributor
Reviewer's GuideMake OAuth/OIDC scopes configurable instead of hardcoded, wiring a new optional scope argument through CLI/env configuration, OIDC configs, and token provider behavior (including tests). Sequence diagram for token requests with configurable scopesequenceDiagram
participant Args as OpenIdTokenProviderConfigArguments
participant Config as OpenIdTokenProviderConfig
participant Provider as OpenIdTokenProvider
participant Client as openid::Client
Args->>Config: into_config()
Config-->>Config: scope: Option<String>
Config->>Provider: from_config(config)
Provider-->>Provider: new(client, refresh_before, config.scope)
alt initial token
Provider->>Client: request_token_using_client_credentials(Provider.scope.as_deref())
Client-->>Provider: TemporalBearerGuard
else refresh with refresh_token
Provider->>Client: refresh_token(current_token, Provider.scope.as_deref())
Client-->>Provider: TemporalBearerGuard
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Strum355
approved these changes
Aug 12, 2026
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.
Description
Backport of #2566 to
release/0.6.z.Summary by Sourcery
Make OAuth scopes for OIDC client-credentials flows configurable instead of hardcoded, propagating them from CLI arguments through configuration into the token provider.
New Features:
Enhancements:
Tests: