Fix AWS access key override logic (#159)

This commit is contained in:
Vaibhav Kamra 2022-06-08 07:51:32 -07:00 committed by GitHub
parent ddc9cd2c25
commit cbbd5ed0bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -7,6 +7,7 @@ require (
github.com/google/uuid v1.3.0 github.com/google/uuid v1.3.0
github.com/kopia/kopia v0.10.7 github.com/kopia/kopia v0.10.7
github.com/microsoft/kiota-authentication-azure-go v0.3.0 github.com/microsoft/kiota-authentication-azure-go v0.3.0
github.com/microsoft/kiota-serialization-json-go v0.5.1
github.com/microsoftgraph/msgraph-sdk-go v0.25.0 github.com/microsoftgraph/msgraph-sdk-go v0.25.0
github.com/microsoftgraph/msgraph-sdk-go-core v0.26.0 github.com/microsoftgraph/msgraph-sdk-go-core v0.26.0
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
@ -53,7 +54,6 @@ require (
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/microsoft/kiota-abstractions-go v0.8.0 // indirect github.com/microsoft/kiota-abstractions-go v0.8.0 // indirect
github.com/microsoft/kiota-http-go v0.5.0 // indirect github.com/microsoft/kiota-http-go v0.5.0 // indirect
github.com/microsoft/kiota-serialization-json-go v0.5.1 // indirect
github.com/microsoft/kiota-serialization-text-go v0.4.0 // indirect github.com/microsoft/kiota-serialization-text-go v0.4.0 // indirect
github.com/minio/md5-simd v1.1.2 // indirect github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/minio-go/v7 v7.0.27 // indirect github.com/minio/minio-go/v7 v7.0.27 // indirect

View File

@ -21,7 +21,7 @@ type AWS struct {
// GetAWS is a helper for aggregating aws secrets and credentials. // GetAWS is a helper for aggregating aws secrets and credentials.
func GetAWS(override map[string]string) AWS { func GetAWS(override map[string]string) AWS {
accessKey := os.Getenv(AWSAccessKeyID) accessKey := os.Getenv(AWSAccessKeyID)
if ovr, ok := override[AWSAccessKeyID]; ok { if ovr, ok := override[AWSAccessKeyID]; ok && ovr != "" {
accessKey = ovr accessKey = ovr
} }
secretKey := os.Getenv(AWSSecretAccessKey) secretKey := os.Getenv(AWSSecretAccessKey)