Skip to content

Commit

Permalink
fix: fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
btfhernandez committed Nov 26, 2024
1 parent f9e6399 commit 06faeb3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions api/secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ func (secretObj *SecretObj) SecretCreateSecret(folderId string, secretDetails in

payload := string(secretCredentialDetailsJson)

secretObj.log.Debug(payload)

var CreateSecretResponse entities.CreateSecretResponse

b := bytes.NewBufferString(payload)
Expand All @@ -259,8 +257,8 @@ func (secretObj *SecretObj) SecretCreateSecret(folderId string, secretDetails in
path = "secrets/file"
}

SecretCreateSecreUrl := secretObj.authenticationObj.ApiUrl.JoinPath("secrets-safe/folders", folderId, path).String()
messageLog := fmt.Sprintf("%v %v", "POST", SecretCreateSecreUrl)
SecretCreateSecretUrl := secretObj.authenticationObj.ApiUrl.JoinPath("secrets-safe/folders", folderId, path).String()
messageLog := fmt.Sprintf("%v %v", "POST", SecretCreateSecretUrl)
secretObj.log.Debug(messageLog)

var fileSecret entities.SecretFileDetails
Expand All @@ -269,7 +267,7 @@ func (secretObj *SecretObj) SecretCreateSecret(folderId string, secretDetails in
// file secrets have a special behavior, they need to be created using multipart request.
if path == "secrets/file" {
if fileSecret, ok = secretDetails.(entities.SecretFileDetails); ok {
body, err := secretObj.authenticationObj.HttpClient.CreateMultiPartRequest(SecretCreateSecreUrl, fileSecret.FileName, []byte(payload), fileSecret.FileContent)
body, err := secretObj.authenticationObj.HttpClient.CreateMultiPartRequest(SecretCreateSecretUrl, fileSecret.FileName, []byte(payload), fileSecret.FileContent)
if err != nil {
return entities.CreateSecretResponse{}, err
}
Expand All @@ -295,7 +293,7 @@ func (secretObj *SecretObj) SecretCreateSecret(folderId string, secretDetails in
var businessError error

technicalError = backoff.Retry(func() error {
body, _, technicalError, businessError = secretObj.authenticationObj.HttpClient.CallSecretSafeAPI(SecretCreateSecreUrl, "POST", *b, "SecretCreateSecret", "", "", "application/json")
body, _, technicalError, businessError = secretObj.authenticationObj.HttpClient.CallSecretSafeAPI(SecretCreateSecretUrl, "POST", *b, "SecretCreateSecret", "", "", "application/json")
return technicalError
}, secretObj.authenticationObj.ExponentialBackOff)

Expand Down

0 comments on commit 06faeb3

Please sign in to comment.