Skip to content

Commit

Permalink
Merge pull request #2033 from Infisical/misc/added-secret-name-trim
Browse files Browse the repository at this point in the history
misc: added secret name trimming
  • Loading branch information
sheensantoscapadngan authored Jun 28, 2024
2 parents 1859557 + b2d6563 commit 351d0d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli/packages/util/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ func SetEncryptedSecrets(secretArgs []string, secretType string, environmentName
}

// Key and value from argument
key := splitKeyValueFromArg[0]
key := strings.TrimSpace(splitKeyValueFromArg[0])
value := splitKeyValueFromArg[1]

hashedKey := fmt.Sprintf("%x", sha256.Sum256([]byte(key)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SecretType, UserWsKeyPair } from "@app/hooks/api/types";
import { PopUpNames, usePopUpAction, usePopUpState } from "../../SecretMainPage.store";

const typeSchema = z.object({
key: z.string(),
key: z.string().trim().min(1, { message: "Secret key is required" }),
value: z.string().optional()
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DecryptedSecret, SecretType, UserWsKeyPair } from "@app/hooks/api/types

const typeSchema = z
.object({
key: z.string().min(1, "Key is required"),
key: z.string().trim().min(1, "Key is required"),
value: z.string().optional(),
environments: z.record(z.boolean().optional())
})
Expand Down

0 comments on commit 351d0d0

Please sign in to comment.