@@ -107,21 +107,21 @@ type AuthScope struct {
107
107
108
108
// ToTokenV2CreateMap allows AuthOptions to satisfy the AuthOptionsBuilder
109
109
// interface in the v2 tokens package
110
- func (opts AuthOptions ) ToTokenV2CreateMap () (map [string ]interface {} , error ) {
110
+ func (opts AuthOptions ) ToTokenV2CreateMap () (map [string ]any , error ) {
111
111
// Populate the request map.
112
- authMap := make (map [string ]interface {} )
112
+ authMap := make (map [string ]any )
113
113
114
114
if opts .Username != "" {
115
115
if opts .Password != "" {
116
- authMap ["passwordCredentials" ] = map [string ]interface {} {
116
+ authMap ["passwordCredentials" ] = map [string ]any {
117
117
"username" : opts .Username ,
118
118
"password" : opts .Password ,
119
119
}
120
120
} else {
121
121
return nil , ErrMissingInput {Argument : "Password" }
122
122
}
123
123
} else if opts .TokenID != "" {
124
- authMap ["token" ] = map [string ]interface {} {
124
+ authMap ["token" ] = map [string ]any {
125
125
"id" : opts .TokenID ,
126
126
}
127
127
} else {
@@ -135,12 +135,12 @@ func (opts AuthOptions) ToTokenV2CreateMap() (map[string]interface{}, error) {
135
135
authMap ["tenantName" ] = opts .TenantName
136
136
}
137
137
138
- return map [string ]interface {} {"auth" : authMap }, nil
138
+ return map [string ]any {"auth" : authMap }, nil
139
139
}
140
140
141
141
// ToTokenV3CreateMap allows AuthOptions to satisfy the AuthOptionsBuilder
142
142
// interface in the v3 tokens package
143
- func (opts * AuthOptions ) ToTokenV3CreateMap (scope map [string ]interface {} ) (map [string ]interface {} , error ) {
143
+ func (opts * AuthOptions ) ToTokenV3CreateMap (scope map [string ]any ) (map [string ]any , error ) {
144
144
type domainReq struct {
145
145
ID * string `json:"id,omitempty"`
146
146
Name * string `json:"name,omitempty"`
@@ -392,15 +392,15 @@ func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]interface{}) (map[s
392
392
}
393
393
394
394
if len (scope ) != 0 {
395
- b ["auth" ].(map [string ]interface {} )["scope" ] = scope
395
+ b ["auth" ].(map [string ]any )["scope" ] = scope
396
396
}
397
397
398
398
return b , nil
399
399
}
400
400
401
401
// ToTokenV3ScopeMap builds a scope from AuthOptions and satisfies interface in
402
402
// the v3 tokens package.
403
- func (opts * AuthOptions ) ToTokenV3ScopeMap () (map [string ]interface {} , error ) {
403
+ func (opts * AuthOptions ) ToTokenV3ScopeMap () (map [string ]any , error ) {
404
404
// For backwards compatibility.
405
405
// If AuthOptions.Scope was not set, try to determine it.
406
406
// This works well for common scenarios.
@@ -418,15 +418,15 @@ func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) {
418
418
}
419
419
420
420
if opts .Scope .System {
421
- return map [string ]interface {} {
422
- "system" : map [string ]interface {} {
421
+ return map [string ]any {
422
+ "system" : map [string ]any {
423
423
"all" : true ,
424
424
},
425
425
}, nil
426
426
}
427
427
428
428
if opts .Scope .TrustID != "" {
429
- return map [string ]interface {} {
429
+ return map [string ]any {
430
430
"OS-TRUST:trust" : map [string ]string {
431
431
"id" : opts .Scope .TrustID ,
432
432
},
@@ -445,20 +445,20 @@ func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) {
445
445
446
446
if opts .Scope .DomainID != "" {
447
447
// ProjectName + DomainID
448
- return map [string ]interface {} {
449
- "project" : map [string ]interface {} {
448
+ return map [string ]any {
449
+ "project" : map [string ]any {
450
450
"name" : & opts .Scope .ProjectName ,
451
- "domain" : map [string ]interface {} {"id" : & opts .Scope .DomainID },
451
+ "domain" : map [string ]any {"id" : & opts .Scope .DomainID },
452
452
},
453
453
}, nil
454
454
}
455
455
456
456
if opts .Scope .DomainName != "" {
457
457
// ProjectName + DomainName
458
- return map [string ]interface {} {
459
- "project" : map [string ]interface {} {
458
+ return map [string ]any {
459
+ "project" : map [string ]any {
460
460
"name" : & opts .Scope .ProjectName ,
461
- "domain" : map [string ]interface {} {"name" : & opts .Scope .DomainName },
461
+ "domain" : map [string ]any {"name" : & opts .Scope .DomainName },
462
462
},
463
463
}, nil
464
464
}
@@ -472,8 +472,8 @@ func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) {
472
472
}
473
473
474
474
// ProjectID
475
- return map [string ]interface {} {
476
- "project" : map [string ]interface {} {
475
+ return map [string ]any {
476
+ "project" : map [string ]any {
477
477
"id" : & opts .Scope .ProjectID ,
478
478
},
479
479
}, nil
@@ -484,15 +484,15 @@ func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) {
484
484
}
485
485
486
486
// DomainID
487
- return map [string ]interface {} {
488
- "domain" : map [string ]interface {} {
487
+ return map [string ]any {
488
+ "domain" : map [string ]any {
489
489
"id" : & opts .Scope .DomainID ,
490
490
},
491
491
}, nil
492
492
} else if opts .Scope .DomainName != "" {
493
493
// DomainName
494
- return map [string ]interface {} {
495
- "domain" : map [string ]interface {} {
494
+ return map [string ]any {
495
+ "domain" : map [string ]any {
496
496
"name" : & opts .Scope .DomainName ,
497
497
},
498
498
}, nil
@@ -512,6 +512,6 @@ func (opts AuthOptions) CanReauth() bool {
512
512
513
513
// ToTokenV3HeadersMap allows AuthOptions to satisfy the AuthOptionsBuilder
514
514
// interface in the v3 tokens package.
515
- func (opts * AuthOptions ) ToTokenV3HeadersMap (map [string ]interface {} ) (map [string ]string , error ) {
515
+ func (opts * AuthOptions ) ToTokenV3HeadersMap (map [string ]any ) (map [string ]string , error ) {
516
516
return nil , nil
517
517
}
0 commit comments