Skip to content

Commit

Permalink
capitalize the secret key whenever the autoCapitalization is enabled …
Browse files Browse the repository at this point in the history
…for project
  • Loading branch information
shaharyar-shamshi committed Nov 6, 2024
1 parent ea426e8 commit 7a78d34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion backend/src/services/secret/secret-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,11 @@ export const secretServiceFactory = ({
secretReminderNote,
secretReminderRepeatDays
}: TCreateSecretRawDTO) => {
const { botKey, shouldUseSecretV2Bridge } = await projectBotService.getBotKey(projectId);
const { botKey, shouldUseSecretV2Bridge, project } = await projectBotService.getBotKey(projectId);

if (project?.autoCapitalization) {
secretName = secretName.toUpperCase();
}
const policy =
actor === ActorType.USER && type === SecretType.Shared
? await secretApprovalPolicyService.getSecretApprovalPolicy(projectId, environment, secretPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ export const CreateSecretForm = ({
e.preventDefault();
const delimitters = [":", "="];
const pastedContent = e.clipboardData.getData("text");
const { key, value } = getKeyValue(pastedContent, delimitters);
let { key, value } = getKeyValue(pastedContent, delimitters);

if (currentWorkspace?.autoCapitalization) {
key = key.toUpperCase();
}

setValue("key", key);
setValue("value", value);
Expand Down

0 comments on commit 7a78d34

Please sign in to comment.