summaryrefslogtreecommitdiff
path: root/vendor/github.com/minio/minio-go/v7/pkg/credentials
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-12-05 11:46:40 +0100
committerLibravatar GitHub <noreply@github.com>2023-12-05 11:46:40 +0100
commitbdc43a98da7cde6a297c1e480ff6c2961c8da3e1 (patch)
tree5e83ec5554c92a3f3c2fb74e006fd9ec19fae13b /vendor/github.com/minio/minio-go/v7/pkg/credentials
parent[chore]: Bump golang.org/x/crypto from 0.15.0 to 0.16.0 (#2413) (diff)
downloadgotosocial-bdc43a98da7cde6a297c1e480ff6c2961c8da3e1.tar.xz
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.63 to 7.0.65 (#2415)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.63 to 7.0.65. - [Release notes](https://github.com/minio/minio-go/releases) - [Commits](https://github.com/minio/minio-go/compare/v7.0.63...v7.0.65) --- updated-dependencies: - dependency-name: github.com/minio/minio-go/v7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/minio/minio-go/v7/pkg/credentials')
-rw-r--r--vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go b/vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go
index 1c73d1008..800c4a294 100644
--- a/vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go
+++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go
@@ -93,7 +93,8 @@ type STSAssumeRoleOptions struct {
AccessKey string
SecretKey string
- Policy string // Optional to assign a policy to the assumed role
+ SessionToken string // Optional if the first request is made with temporary credentials.
+ Policy string // Optional to assign a policy to the assumed role
Location string // Optional commonly needed with AWS STS.
DurationSeconds int // Optional defaults to 1 hour.
@@ -101,6 +102,7 @@ type STSAssumeRoleOptions struct {
// Optional only valid if using with AWS STS
RoleARN string
RoleSessionName string
+ ExternalID string
}
// NewSTSAssumeRole returns a pointer to a new
@@ -161,6 +163,9 @@ func getAssumeRoleCredentials(clnt *http.Client, endpoint string, opts STSAssume
if opts.Policy != "" {
v.Set("Policy", opts.Policy)
}
+ if opts.ExternalID != "" {
+ v.Set("ExternalId", opts.ExternalID)
+ }
u, err := url.Parse(endpoint)
if err != nil {
@@ -181,6 +186,9 @@ func getAssumeRoleCredentials(clnt *http.Client, endpoint string, opts STSAssume
}
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req.Header.Set("X-Amz-Content-Sha256", hex.EncodeToString(hash.Sum(nil)))
+ if opts.SessionToken != "" {
+ req.Header.Set("X-Amz-Security-Token", opts.SessionToken)
+ }
req = signer.SignV4STS(*req, opts.AccessKey, opts.SecretKey, opts.Location)
resp, err := clnt.Do(req)