Merge pull request #3371 from Infisical/misc/add-missing-version-filter

misc: add missing version filter in get secret by name
This commit is contained in:
Sheen
2025-04-08 02:55:21 +08:00
committed by GitHub
2 changed files with 14 additions and 10 deletions

View File

@@ -1252,21 +1252,24 @@ export const secretV2BridgeServiceFactory = ({
: secretVersionDAL
.findOne({
folderId,
version,
type: secretType,
userId: secretType === SecretType.Personal ? actorId : null,
key: secretName
})
.then((el) =>
SecretsV2Schema.extend({
tags: z
.object({ slug: z.string(), name: z.string(), id: z.string(), color: z.string() })
.array()
.default([])
.optional()
}).parse({
...el,
id: el.secretId
})
el
? SecretsV2Schema.extend({
tags: z
.object({ slug: z.string(), name: z.string(), id: z.string(), color: z.string() })
.array()
.default([])
.optional()
}).parse({
...el,
id: el.secretId
})
: undefined
));
throwIfMissingSecretReadValueOrDescribePermission(permission, ProjectPermissionSecretActions.DescribeSecret, {

View File

@@ -1558,6 +1558,7 @@ export const secretServiceFactory = ({
actorOrgId,
actor,
actorId,
version,
expandSecretReferences,
type,
secretName