mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 16:34:30 +01:00
swift: make it so just storage_url or auth_token can be overidden
Before this change if only one of storage_url or auth_token were supplied then rclone would overwrite both of them when authenticating. This effectively meant you could supply both of them or none of them only. Now rclone still does the authentication to read the missing storage_url or auth_token then afterwards re-writes the auth_token or storage_url back to what the user desired. Fixes #2464
This commit is contained in:
parent
b3217d2cac
commit
842ed7d2a9
@ -277,6 +277,15 @@ func swiftConnection(opt *Options, name string) (*swift.Connection, error) {
|
||||
// provided by wrapping the existing auth, so we can just
|
||||
// override one or the other or both.
|
||||
if StorageUrl != "" || AuthToken != "" {
|
||||
// Re-write StorageURL and AuthToken if they are being
|
||||
// overridden as c.Authenticate above will have
|
||||
// overwritten them.
|
||||
if StorageUrl != "" {
|
||||
c.StorageUrl = StorageUrl
|
||||
}
|
||||
if AuthToken != "" {
|
||||
c.AuthToken = AuthToken
|
||||
}
|
||||
c.Auth = newAuth(c.Auth, StorageUrl, AuthToken)
|
||||
}
|
||||
return c, nil
|
||||
|
Loading…
Reference in New Issue
Block a user