mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
fix: personal secret support without read value permission
This commit is contained in:
@@ -950,6 +950,8 @@ export const secretV2BridgeServiceFactory = ({
|
||||
);
|
||||
})
|
||||
.map((secret) => {
|
||||
const isPersonalSecret = secret.userId === actorId && secret.type === SecretType.Personal;
|
||||
|
||||
const secretValueHidden =
|
||||
!viewSecretValue ||
|
||||
!permission.can(
|
||||
@@ -975,7 +977,7 @@ export const secretV2BridgeServiceFactory = ({
|
||||
? secretManagerDecryptor({ cipherTextBlob: secret.encryptedComment }).toString()
|
||||
: ""
|
||||
},
|
||||
secretValueHidden
|
||||
secretValueHidden && !isPersonalSecret
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1244,7 +1246,8 @@ export const secretV2BridgeServiceFactory = ({
|
||||
secretName,
|
||||
secretTags: (secret?.tags || []).map((el) => el.slug)
|
||||
})
|
||||
)
|
||||
) &&
|
||||
secretType !== SecretType.Personal
|
||||
) {
|
||||
throw new ForbiddenReadSecretError({
|
||||
message: `You do not have permission to view secret value on secret with name '${secretName}'`
|
||||
|
||||
Reference in New Issue
Block a user