Skip to content

Commit 61bf000

Browse files
dkokkinoncw
authored andcommitted
Add support for keystone v3tokens
1 parent 36c646c commit 61bf000

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

auth_v3.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ func (auth *v3Auth) Request(ctx context.Context, c *Connection) (*http.Request,
179179
Secret: c.ApplicationCredentialSecret,
180180
User: user,
181181
}
182+
} else if c.Token != "" {
183+
v3.Auth.Identity.Methods = []string{v3AuthMethodToken}
184+
v3.Auth.Identity.Token = &v3AuthToken{Id: c.Token}
182185
} else if c.UserName == "" && c.UserId == "" {
183186
v3.Auth.Identity.Methods = []string{v3AuthMethodToken}
184187
v3.Auth.Identity.Token = &v3AuthToken{Id: c.ApiKey}

swift.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ type Connection struct {
103103
ApplicationCredentialId string // Application Credential ID
104104
ApplicationCredentialName string // Application Credential Name
105105
ApplicationCredentialSecret string // Application Credential Secret
106+
Token string // Token used for v3token authentication
106107
AuthUrl string // Auth URL
107108
Retries int // Retries on error (default is 3)
108109
UserAgent string // Http User agent (default goswift/1.0)

0 commit comments

Comments
 (0)