S3: add support for session tokens

Fixes #736

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-02-25 15:30:04 +01:00
parent 4e9dae6fa4
commit e18ad55067
12 changed files with 48 additions and 8 deletions

View File

@@ -173,6 +173,9 @@ func (c *S3FsConfig) isEqual(other *S3FsConfig) bool {
if c.AccessKey != other.AccessKey {
return false
}
if c.SessionToken != other.SessionToken {
return false
}
if c.Endpoint != other.Endpoint {
return false
}
@@ -182,6 +185,17 @@ func (c *S3FsConfig) isEqual(other *S3FsConfig) bool {
if c.ACL != other.ACL {
return false
}
if !c.areMultipartFieldsEqual(other) {
return false
}
if c.ForcePathStyle != other.ForcePathStyle {
return false
}
return c.isSecretEqual(other)
}
func (c *S3FsConfig) areMultipartFieldsEqual(other *S3FsConfig) bool {
if c.UploadPartSize != other.UploadPartSize {
return false
}
@@ -200,10 +214,7 @@ func (c *S3FsConfig) isEqual(other *S3FsConfig) bool {
if c.UploadPartMaxTime != other.UploadPartMaxTime {
return false
}
if c.ForcePathStyle != other.ForcePathStyle {
return false
}
return c.isSecretEqual(other)
return true
}
func (c *S3FsConfig) isSecretEqual(other *S3FsConfig) bool {