diff --git a/auth_options.go b/auth_options.go index cec66f001..c0c97d288 100644 --- a/auth_options.go +++ b/auth_options.go @@ -85,11 +85,11 @@ type AuthOptions struct { // AgencyNmae is the name of agnecy AgencyName string `json:"xrole_name,omitempty"` - // AgencyDomainName is the domain name who created the agency - AgencyDomainName string `json:"domain_name,omitempty"` + // DelegatedDomain is the name of delegated domain + DelegatedDomain string `json:"domain_name,omitempty"` - // AgencyProjectName is the project name of agency - AgencyProjectName string + // DelegatedProject is the name of delegated project + DelegatedProject string } // ToTokenV2CreateMap allows AuthOptions to satisfy the AuthOptionsBuilder @@ -375,10 +375,10 @@ func (scope *scopeInfo) BuildTokenV3ScopeMap() (map[string]interface{}, error) { } type AgencyAuthOptions struct { - TokenID string - AgencyName string - AgencyDomainName string - AgencyProjectName string + TokenID string + AgencyName string + DelegatedDomain string + DelegatedProject string } func (opts *AgencyAuthOptions) CanReauth() bool { @@ -391,8 +391,8 @@ func (opts *AgencyAuthOptions) AuthTokenID() string { func (opts *AgencyAuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) { scope := scopeInfo{ - ProjectName: opts.AgencyProjectName, - DomainName: opts.AgencyDomainName, + ProjectName: opts.DelegatedProject, + DomainName: opts.DelegatedDomain, } return scope.BuildTokenV3ScopeMap() @@ -416,7 +416,7 @@ func (opts *AgencyAuthOptions) ToTokenV3CreateMap(scope map[string]interface{}) var req authReq req.Identity.Methods = []string{"assume_role"} req.Identity.AssumeRole = assumeRoleReq{ - DomainName: opts.AgencyDomainName, + DomainName: opts.DelegatedDomain, AgencyName: opts.AgencyName, } r, err := BuildRequestBody(req, "auth") diff --git a/openstack/client.go b/openstack/client.go index f35c03135..576e1fc0f 100644 --- a/openstack/client.go +++ b/openstack/client.go @@ -197,12 +197,12 @@ func v3auth(client *golangsdk.ProviderClient, endpoint string, opts tokens3.Auth } opts1, ok := opts.(*golangsdk.AuthOptions) - if ok && opts1.AgencyDomainName != "" && opts1.AgencyName != "" { + if ok && opts1.DelegatedDomain != "" && opts1.AgencyName != "" { opts2 := golangsdk.AgencyAuthOptions{ - TokenID: token.ID, - AgencyName: opts1.AgencyName, - AgencyDomainName: opts1.AgencyDomainName, - AgencyProjectName: opts1.AgencyProjectName, + TokenID: token.ID, + AgencyName: opts1.AgencyName, + DelegatedDomain: opts1.DelegatedDomain, + DelegatedProject: opts1.DelegatedProject, } result = tokens3.Create(v3Client, &opts2) token, err = result.ExtractToken()