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