Skip to content

Commit

Permalink
Improve secret name to allow non trailing slash in path
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusfcr committed Apr 3, 2024
1 parent 0f5c3e5 commit 1fb4703
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"path/filepath"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
Expand Down Expand Up @@ -62,8 +63,7 @@ func NewAWSSecretManager(config config.AwsConfig, logger echo.Logger) (*AWSSecre
// GetServerCredentials return the Jira credentials inside a Credentials type
// from AWS secret manager for a specific server.
func (s *AWSSecrets) GetServerCredentials(serverID string) (Credentials, error) {
secretName := fmt.Sprintf("%s%s", s.config.ServerCredentialsKey, serverID)

secretName := filepath.Join(s.config.ServerCredentialsKey, serverID)
result, err := s.secretCache.GetSecretString(secretName)
if err != nil {
return Credentials{}, &vterrors.TrackingError{
Expand Down

0 comments on commit 1fb4703

Please sign in to comment.