Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check if Secrets Manager ARN is valid #209

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/admin/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,13 @@ func GetKafkaCredentials(svc secretsmanageriface.SecretsManagerAPI, secretArn st
log.Debugf("Fetching credentials from Secrets Manager for secret: %s", secretArn)
var creds credentials

if !arn.IsARN(secretArn) {
return creds, fmt.Errorf("invalid ARN provided: %s", secretArn)
}

arn, err := arn.Parse(secretArn)
if err != nil {
return creds, fmt.Errorf("Couldn't parse the ARN for secret: %s, error: %v", secretArn, err)
return creds, fmt.Errorf("couldn't parse the ARN for secret: %s, error: %v", secretArn, err)
}
// Remove "secret:" from the resource to get the secret name
secretName := strings.Split(arn.Resource, ":")[1]
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package version

// Version is the current topicctl version.
const Version = "1.18.0"
const Version = "1.18.1"
Loading