Skip to content

Commit

Permalink
fix: lints
Browse files Browse the repository at this point in the history
  • Loading branch information
gak committed May 27, 2024
1 parent f74a6b8 commit bb07d76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions common/configuration/aws_secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const schemeKey = "asm"
//
// The resolver does a direct/proxy map from a Ref to a URL, module.name <-> asm://module.name and does not access ASM at all.
type AWSSecrets[R Role] struct {
AccessKeyId string
AccessKeyID string
SecretAccessKey string
Region string
Endpoint optional.Option[string]
Expand All @@ -35,9 +35,9 @@ var _ Provider[Secrets] = AWSSecrets[Secrets]{}
var _ MutableProvider[Secrets] = AWSSecrets[Secrets]{}

var (
asmClient *secretsmanager.Client
asmOnce sync.Once
asmErr error
asmClient *secretsmanager.Client
errClient error
)

func urlForRef(ref Ref) *url.URL {
Expand All @@ -53,8 +53,8 @@ func (a AWSSecrets[R]) client(ctx context.Context) (*secretsmanager.Client, erro

// Use a static credentials provider if access key and secret are provided.
// Otherwise, the SDK will use the default credential chain (env vars, iam, etc).
if a.AccessKeyId != "" {
credentials := aws.NewCredentialsCache(credentials.NewStaticCredentialsProvider(a.AccessKeyId, a.SecretAccessKey, ""))
if a.AccessKeyID != "" {
credentials := aws.NewCredentialsCache(credentials.NewStaticCredentialsProvider(a.AccessKeyID, a.SecretAccessKey, ""))
optFns = append(optFns, config.WithCredentialsProvider(credentials))
}

Expand All @@ -64,7 +64,7 @@ func (a AWSSecrets[R]) client(ctx context.Context) (*secretsmanager.Client, erro

cfg, err := config.LoadDefaultConfig(ctx, optFns...)
if err != nil {
err = fmt.Errorf("unable to load aws config: %w", err)
errClient = fmt.Errorf("unable to load aws config: %w", err)
return
}

Expand All @@ -77,7 +77,7 @@ func (a AWSSecrets[R]) client(ctx context.Context) (*secretsmanager.Client, erro

})

return asmClient, asmErr
return asmClient, errClient
}

func (a AWSSecrets[R]) Role() R {
Expand Down
2 changes: 1 addition & 1 deletion common/configuration/aws_secrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestAWSSecretsBasics(t *testing.T) {

// Localstack!
asm := AWSSecrets[Secrets]{
AccessKeyId: "test",
AccessKeyID: "test",
SecretAccessKey: "test",
Region: "us-west-2",
Endpoint: Some("http://localhost:4566"),
Expand Down

0 comments on commit bb07d76

Please sign in to comment.