drone-plugins / drone-s3-cache

Caches build artifacts to S3 compatible storage backends
http://plugins.drone.io/drone-plugins/drone-s3-cache
Apache License 2.0
28 stars 30 forks source link

✨ support aws session token in cli flag; 🐛 fix bug in calling minio-go credentials.NewStaticV4, third argument should be SessionToken; #55

Closed Shuliyey closed 5 years ago

Shuliyey commented 5 years ago

0. Overview

1. Background

1.1 ✨ support aws session token in cli flag

aws sdk support session with AWS_SESSION_TOKEN environment variables https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html, this change is to support this environment variable as a cli_flag (corporations generally use assume role session for CI/CD for security best practices)

1.2 🐛 fix bug in calling minio-go credentials.NewStaticV4, third argument should be SessionToken

there's a bug at this line in s3/s3.go s3.New in s3/s3.go, looking through source code of minio-go credentials.NewStaticV4 pkg/credentials/static.go, the third argument should be token (instead of region)