mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
misc: updated missing tx
This commit is contained in:
@@ -193,6 +193,11 @@ export const dynamicSecretLeaseServiceFactory = ({
|
|||||||
folderId: folder.id
|
folderId: folder.id
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!dynamicSecretCfg)
|
||||||
|
throw new NotFoundError({
|
||||||
|
message: `Dynamic secret with ID '${dynamicSecretLease.dynamicSecretId}' not found`
|
||||||
|
});
|
||||||
|
|
||||||
ForbiddenError.from(permission).throwUnlessCan(
|
ForbiddenError.from(permission).throwUnlessCan(
|
||||||
ProjectPermissionDynamicSecretActions.Lease,
|
ProjectPermissionDynamicSecretActions.Lease,
|
||||||
subject(ProjectPermissionSub.DynamicSecrets, {
|
subject(ProjectPermissionSub.DynamicSecrets, {
|
||||||
@@ -274,6 +279,11 @@ export const dynamicSecretLeaseServiceFactory = ({
|
|||||||
folderId: folder.id
|
folderId: folder.id
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!dynamicSecretCfg)
|
||||||
|
throw new NotFoundError({
|
||||||
|
message: `Dynamic secret with ID '${dynamicSecretLease.dynamicSecretId}' not found`
|
||||||
|
});
|
||||||
|
|
||||||
ForbiddenError.from(permission).throwUnlessCan(
|
ForbiddenError.from(permission).throwUnlessCan(
|
||||||
ProjectPermissionDynamicSecretActions.Lease,
|
ProjectPermissionDynamicSecretActions.Lease,
|
||||||
subject(ProjectPermissionSub.DynamicSecrets, {
|
subject(ProjectPermissionSub.DynamicSecrets, {
|
||||||
@@ -393,6 +403,11 @@ export const dynamicSecretLeaseServiceFactory = ({
|
|||||||
folderId: folder.id
|
folderId: folder.id
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!dynamicSecretCfg)
|
||||||
|
throw new NotFoundError({
|
||||||
|
message: `Dynamic secret with ID '${dynamicSecretLease.dynamicSecretId}' not found`
|
||||||
|
});
|
||||||
|
|
||||||
ForbiddenError.from(permission).throwUnlessCan(
|
ForbiddenError.from(permission).throwUnlessCan(
|
||||||
ProjectPermissionDynamicSecretActions.Lease,
|
ProjectPermissionDynamicSecretActions.Lease,
|
||||||
subject(ProjectPermissionSub.DynamicSecrets, {
|
subject(ProjectPermissionSub.DynamicSecrets, {
|
||||||
|
|||||||
@@ -264,14 +264,19 @@ export const dynamicSecretServiceFactory = ({
|
|||||||
if (!isConnected) throw new BadRequestError({ message: "Provider connection failed" });
|
if (!isConnected) throw new BadRequestError({ message: "Provider connection failed" });
|
||||||
|
|
||||||
const updatedDynamicCfg = await dynamicSecretDAL.transaction(async (tx) => {
|
const updatedDynamicCfg = await dynamicSecretDAL.transaction(async (tx) => {
|
||||||
const cfg = await dynamicSecretDAL.updateById(dynamicSecretCfg.id, {
|
const cfg = await dynamicSecretDAL.updateById(
|
||||||
encryptedInput: secretManagerEncryptor({ plainText: Buffer.from(JSON.stringify(updatedInput)) }).cipherTextBlob,
|
dynamicSecretCfg.id,
|
||||||
|
{
|
||||||
|
encryptedInput: secretManagerEncryptor({ plainText: Buffer.from(JSON.stringify(updatedInput)) })
|
||||||
|
.cipherTextBlob,
|
||||||
maxTTL,
|
maxTTL,
|
||||||
defaultTTL,
|
defaultTTL,
|
||||||
name: newName ?? name,
|
name: newName ?? name,
|
||||||
status: null,
|
status: null,
|
||||||
projectGatewayId: selectedGatewayId
|
projectGatewayId: selectedGatewayId
|
||||||
});
|
},
|
||||||
|
tx
|
||||||
|
);
|
||||||
|
|
||||||
if (metadata) {
|
if (metadata) {
|
||||||
await resourceMetadataDAL.delete(
|
await resourceMetadataDAL.delete(
|
||||||
|
|||||||
Reference in New Issue
Block a user