Skip to content

Commit

Permalink
fix(metadata): make access/secret keys optional (#3562)
Browse files Browse the repository at this point in the history
Signed-off-by: Samantha Coyle <[email protected]>
  • Loading branch information
sicoyle authored Oct 8, 2024
1 parent 9012bdc commit dc65da2
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 dc65da2

Please sign in to comment.