forked from TrueCloudLab/rclone
s3: make --s3-v2-auth flag
This is an alternative to setting the region to "other-v2-signature" which is inconvenient for multi-region providers.
This commit is contained in:
parent
06922674c8
commit
0f02c9540c
2 changed files with 26 additions and 1 deletions
|
@ -582,6 +582,16 @@ for more info.
|
||||||
Some providers (eg Aliyun OSS or Netease COS) require this set to false.`,
|
Some providers (eg Aliyun OSS or Netease COS) require this set to false.`,
|
||||||
Default: true,
|
Default: true,
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
|
}, {
|
||||||
|
Name: "v2_auth",
|
||||||
|
Help: `If true use v2 authentication.
|
||||||
|
|
||||||
|
If this is false (the default) then rclone will use v4 authentication.
|
||||||
|
If it is set then rclone will use v2 authentication.
|
||||||
|
|
||||||
|
Use this only if v4 signatures don't work, eg pre Jewel/v10 CEPH.`,
|
||||||
|
Default: false,
|
||||||
|
Advanced: true,
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -616,6 +626,7 @@ type Options struct {
|
||||||
SessionToken string `config:"session_token"`
|
SessionToken string `config:"session_token"`
|
||||||
UploadConcurrency int `config:"upload_concurrency"`
|
UploadConcurrency int `config:"upload_concurrency"`
|
||||||
ForcePathStyle bool `config:"force_path_style"`
|
ForcePathStyle bool `config:"force_path_style"`
|
||||||
|
V2Auth bool `config:"v2_auth"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fs represents a remote s3 server
|
// Fs represents a remote s3 server
|
||||||
|
@ -790,7 +801,7 @@ func s3Connection(opt *Options) (*s3.S3, *session.Session, error) {
|
||||||
// awsConfig.WithLogLevel(aws.LogDebugWithSigning)
|
// awsConfig.WithLogLevel(aws.LogDebugWithSigning)
|
||||||
ses := session.New()
|
ses := session.New()
|
||||||
c := s3.New(ses, awsConfig)
|
c := s3.New(ses, awsConfig)
|
||||||
if opt.Region == "other-v2-signature" {
|
if opt.V2Auth || opt.Region == "other-v2-signature" {
|
||||||
fs.Debugf(nil, "Using v2 auth")
|
fs.Debugf(nil, "Using v2 auth")
|
||||||
signer := func(req *request.Request) {
|
signer := func(req *request.Request) {
|
||||||
// Ignore AnonymousCredentials object
|
// Ignore AnonymousCredentials object
|
||||||
|
|
|
@ -894,6 +894,20 @@ Some providers (eg Aliyun OSS or Netease COS) require this set to false.
|
||||||
- Type: bool
|
- Type: bool
|
||||||
- Default: true
|
- Default: true
|
||||||
|
|
||||||
|
#### --s3-v2-auth
|
||||||
|
|
||||||
|
If true use v2 authentication.
|
||||||
|
|
||||||
|
If this is false (the default) then rclone will use v4 authentication.
|
||||||
|
If it is set then rclone will use v2 authentication.
|
||||||
|
|
||||||
|
Use this only if v4 signatures don't work, eg pre Jewel/v10 CEPH.
|
||||||
|
|
||||||
|
- Config: v2_auth
|
||||||
|
- Env Var: RCLONE_S3_V2_AUTH
|
||||||
|
- Type: bool
|
||||||
|
- Default: false
|
||||||
|
|
||||||
<!--- autogenerated options stop -->
|
<!--- autogenerated options stop -->
|
||||||
|
|
||||||
### Anonymous access to public buckets ###
|
### Anonymous access to public buckets ###
|
||||||
|
|
Loading…
Reference in a new issue