Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix codex comment and update review step

Matheus Nogueira1af7fb39139a
diff --git a/backend/src/services/secret-sync/secret-sync-maps.ts b/backend/src/services/secret-sync/secret-sync-maps.ts
index 84074236b6..6db9133daf 100644
--- a/backend/src/services/secret-sync/secret-sync-maps.ts
+++ b/backend/src/services/secret-sync/secret-sync-maps.ts
@@ -1,6 +1,7 @@
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
import { buildAwsConnectionConfig, getAwsAccountId } from "@app/services/app-connection/aws/aws-connection-fns";
import { TAwsConnection } from "@app/services/app-connection/aws/aws-connection-types";
+import { GcpSyncScope } from "@app/services/secret-sync/gcp/gcp-sync-enums";
import { SecretSync, SecretSyncPlanType } from "@app/services/secret-sync/secret-sync-enums";
import { DestinationDuplicateCheckFn } from "@app/services/secret-sync/secret-sync-types";
@@ -158,7 +159,7 @@ export const SECRET_SYNC_SKIP_FIELDS_MAP: Record<SecretSync, string[]> = {
[SecretSync.AWSParameterStore]: [],
[SecretSync.AWSSecretsManager]: ["mappingBehavior"],
[SecretSync.GitHub]: [],
- [SecretSync.GCPSecretManager]: ["locationId"],
+ [SecretSync.GCPSecretManager]: ["scope", "locationId"],
[SecretSync.AzureKeyVault]: [],
[SecretSync.AzureAppConfiguration]: ["label"],
[SecretSync.AzureDevOps]: ["devopsProjectName"],
@@ -241,11 +242,24 @@ const awsDuplicateCheck: DestinationDuplicateCheckFn = async ({ existingSync, ne
return existingAccountId === newAccountId;
};
+const gcpDuplicateCheck: DestinationDuplicateCheckFn = async ({ existingSync, newSync }) => {
+ const existingConfig = existingSync.destinationConfig;
+ const newConfig = newSync.destinationConfig;
+
+ if (existingConfig.projectId !== newConfig.projectId) return false;
+
+ if (newConfig.scope === GcpSyncScope.Region) {
+ return existingConfig.scope === GcpSyncScope.Region && existingConfig.locationId === newConfig.locationId;
+ }
+
+ return existingConfig.scope === GcpSyncScope.Global;
+};
+
export const DESTINATION_DUPLICATE_CHECK_MAP: Record<SecretSync, DestinationDuplicateCheckFn> = {
[SecretSync.AWSParameterStore]: awsDuplicateCheck,
[SecretSync.AWSSecretsManager]: awsDuplicateCheck,
[SecretSync.GitHub]: defaultDuplicateCheck,
- [SecretSync.GCPSecretManager]: defaultDuplicateCheck,
+ [SecretSync.GCPSecretManager]: gcpDuplicateCheck,
[SecretSync.AzureKeyVault]: defaultDuplicateCheck,
[SecretSync.AzureAppConfiguration]: defaultDuplicateCheck,
[SecretSync.AzureDevOps]: defaultDuplicateCheck,
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx
index beb7998f2f..fc96bc4a38 100644
--- a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx
@@ -346,14 +346,14 @@ export const SecretSyncReviewFields = () => {
)}
</Detail>
{AdditionalSyncOptionsFieldsComponent}
- {disableSecretDeletion && (
- <Detail>
- <DetailLabel>Secret Deletion</DetailLabel>
- <DetailValue>
- <Badge variant="warning">Disabled</Badge>
- </DetailValue>
- </Detail>
- )}
+ <Detail>
+ <DetailLabel>Secret Deletion Protection</DetailLabel>
+ <DetailValue>
+ <Badge variant={disableSecretDeletion ? "success" : "neutral"}>
+ {disableSecretDeletion ? "Enabled" : "Disabled"}
+ </Badge>
+ </DetailValue>
+ </Detail>
</div>
</DetailGroup>