fix(clouds): separate user domain from project domain in clouds.yaml parser - #3725
Open
abnvanand wants to merge 1 commit into
Open
fix(clouds): separate user domain from project domain in clouds.yaml parser#3725abnvanand wants to merge 1 commit into
abnvanand wants to merge 1 commit into
Conversation
…ouds.yaml When user_domain_name/user_domain_id and project_domain_name/project_domain_id point to different domains, the parser was coalescing project domain fields into AuthOptions.DomainID/DomainName — the fields used for user authentication. This caused two failure modes: - Hard error when user_domain_name and project_domain_id are both set: both DomainName and DomainID become non-empty, triggering ErrDomainIDOrDomainName. - Silent 401 when user_domain_name and project_domain_name differ: ToTokenV3ScopeMap copies DomainName (the user's domain) into the project scope, so Keystone looks up the project in the wrong domain. Fix by removing ProjectDomainID and ProjectDomainName from the DomainID/DomainName coalesces, and pre-building an explicit AuthScope when project_domain_id or project_domain_name is set alongside a project name so the project domain is passed directly to the scope rather than inherited from the user auth fields.
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.
Fixes #3724
Links to the line numbers/files in the OpenStack source code that support the
code in this PR:
Made two changes to
openstack/config/clouds/clouds.go:Removed
ProjectDomainIDandProjectDomainNamefrom theDomainID/DomainNamecoalesces.These fields now carry only the user's domain (
user_domain_id/user_domain_name)Pre-building an explicit
AuthScopewhenproject_domain_idorproject_domain_nameis setalongside a project name. This passes the project domain directly to the scope, bypassing
ToTokenV3ScopeMap's fallback that would otherwise inherit the user domain.Test cases
project_domain_id+user_domain_name: verifiesDomainIDis empty (no bleed) and scopecarries the correct project domain ID.
project_domain_namediffering fromuser_domain_name: verifies scope carries the projectdomain name, not the user domain.
project_domain_namewithoutuser_domain_name: verifiesDomainNameis empty — projectdomain must not silently substitute for the user domain.