mirror of
https://github.com/rclone/rclone
synced 2024-11-16 16:15:34 +01:00
s3: fix shared_credentials_file auth after reverting incorrect fix #5762
Before this change the `shared_credentials_file` config option was
being ignored.
The correct value is passed into the SDK but it only sets the
credentials in the default provider. Unfortunately we wipe the default
provider in order to install our own chain if env_auth is true.
This patch restores the shared credentials file in the session
options, exactly the same as how we restore the profile.
Original fix:
1605f9e14d
s3: Fix shared_credentials_file auth
This commit is contained in:
parent
712f9c9760
commit
e6e1c49b58
@ -1603,6 +1603,10 @@ func s3Connection(ctx context.Context, opt *Options, client *http.Client) (*s3.S
|
||||
awsSessionOpts.SharedConfigState = session.SharedConfigEnable
|
||||
// Set the name of the profile if supplied
|
||||
awsSessionOpts.Profile = opt.Profile
|
||||
// Set the shared config file if supplied
|
||||
if opt.SharedCredentialsFile != "" {
|
||||
awsSessionOpts.SharedConfigFiles = []string{opt.SharedCredentialsFile}
|
||||
}
|
||||
// The session constructor (aws/session/mergeConfigSrcs) will only use the user's preferred credential source
|
||||
// (from the shared config file) if the passed-in Options.Config.Credentials is nil.
|
||||
awsSessionOpts.Config.Credentials = nil
|
||||
|
Loading…
Reference in New Issue
Block a user