mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
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:
@@ -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, {
|
||||
|
||||
@@ -1558,6 +1558,7 @@ export const secretServiceFactory = ({
|
||||
actorOrgId,
|
||||
actor,
|
||||
actorId,
|
||||
version,
|
||||
expandSecretReferences,
|
||||
type,
|
||||
secretName
|
||||
|
||||
Reference in New Issue
Block a user