Skip to content

Commit

Permalink
fix(metadata): make access/secret keys optional (dapr#3562)
Browse files Browse the repository at this point in the history
Signed-off-by: Samantha Coyle <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
  • Loading branch information
sicoyle authored and elena-kolevska committed Oct 24, 2024
1 parent a9ee725 commit 9cf7574
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions common/authentication/postgresql/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,10 @@ func (m *PostgresAuthMetadata) ValidateAwsIamFields() (string, string, string, e
if awsRegion == "" {
return "", "", "", errors.New("metadata property AWSRegion is missing")
}
// Note: access key and secret keys can be optional
// in the event users are leveraging the credential files for an access token.
awsAccessKey, _ := metadata.GetMetadataProperty(m.awsEnv.Metadata, "AWSAccessKey")
if awsAccessKey == "" {
return "", "", "", errors.New("metadata property AWSAccessKey is missing")
}
awsSecretKey, _ := metadata.GetMetadataProperty(m.awsEnv.Metadata, "AWSSecretKey")
if awsSecretKey == "" {
return "", "", "", errors.New("metadata property AWSSecretKey is missing")
}
return awsRegion, awsAccessKey, awsSecretKey, nil
}

Expand Down

0 comments on commit 9cf7574

Please sign in to comment.