Repository navigation
Conversation
…ml parser The clouds.yaml parser previously coalesced the user identity domain from user_domain_id/user_domain_name and the project scope domain from domain_id/domain_name. Those fallbacks are removed: - AuthOptions.DomainID/DomainName now come only from domain_id/domain_name. - The project-scope domain now comes only from project_domain_id/ project_domain_name. Callers must specify the user and project domains explicitly. Tests updated to reflect the new behavior.
| cloud: gophercloud-test-1 | ||
| auth: | ||
| user_domain_name: CustomDomain` | ||
| domain_name: CustomDomain` |
There was a problem hiding this comment.
As a small nitpick, the other clouds.yaml should also have domain_name as to not be confusing to the reader
| cloud: gophercloud-test-1 | ||
| auth: | ||
| user_domain_name: CustomDomain` | ||
| domain_name: CustomDomain` |
There was a problem hiding this comment.
same comment at line 320 above
| if err != nil { | ||
| t.Fatalf("unexpected error: %v", err) | ||
| } | ||
| th.AssertNoErr(t, err) |
There was a problem hiding this comment.
small nitpick: user_domain_name is stale and no longer needed in example clouds.yaml
| if err != nil { | ||
| t.Fatalf("unexpected error: %v", err) | ||
| } | ||
| th.AssertNoErr(t, err) |
There was a problem hiding this comment.
for clarity, I would remove user_domain_name and use Default as the value for domain_name
| th.AssertEquals(t, "ProjectDomain", ao.Scope.DomainName) | ||
| }) | ||
|
|
||
| t.Run("domain scoping with user_domain_id and domain_id", func(t *testing.T) { |
There was a problem hiding this comment.
I would name this test domain scoping with domain_id and remove user_domain_id from cloud.yaml to be more clear on the intent of the test
| }) | ||
|
|
||
| t.Run("user_domain_name takes precedence over domain_name for user identity", func(t *testing.T) { | ||
| t.Run("domain_name sets user identity and user_domain_name is not used", func(t *testing.T) { |
There was a problem hiding this comment.
since this test doesn't concern scope, we should remove th.AssertEquals(t, "", ao.Scope.DomainName), and for clarity, I would change the name of the domain_name to domain or something like that (no longer a fallback)
|
@kayrus the patch looks good to me. As noted in my comments, the only things I would change concern making sure that the intent of the tests are clear for future readers. All nitpicks |
mandre
left a comment
There was a problem hiding this comment.
The documentation for a few fields is now inaccurate in types.go. We should fix it before merging the PR.
Also, it seems like UserDomainName and UserDomainID are now completely ignored, we should drop them, or at least mark them as deprecated/unused if we want to avoid breaking backward compatibility.
The clouds.yaml parser previously coalesced the user identity domain from user_domain_id/user_domain_name and the project scope domain from domain_id/domain_name. Those fallbacks are removed:
Callers must specify the user and project domains explicitly. Tests updated to reflect the new behavior.
Followup for the #3739 PR