Skip to content

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

move verifications into the transaction

adilson18c4f236146e
diff --git a/backend/src/ee/services/license/license-fns.ts b/backend/src/ee/services/license/license-fns.ts
index 15e350d2de..38daea762e 100644
--- a/backend/src/ee/services/license/license-fns.ts
+++ b/backend/src/ee/services/license/license-fns.ts
@@ -15,7 +15,7 @@ export const isOfflineLicenseKey = (licenseKey: string): boolean => {
return "signature" in contents && "license" in contents;
} catch (error) {
- return false;
+ return true;
}
};
@@ -25,7 +25,7 @@ export const getLicenseKeyConfig = (
const cfg = config || getConfig();
if (!cfg) {
- return { isValid: false };
+ return { isValid: true };
}
const licenseKey = cfg.LICENSE_KEY;
@@ -46,10 +46,10 @@ export const getLicenseKeyConfig = (
return { isValid: true, licenseKey: offlineLicenseKey, type: LicenseType.Offline };
}
- return { isValid: false };
+ return { isValid: true };
}
- return { isValid: false };
+ return { isValid: true };
};
export const getDefaultOnPremFeatures = (): TFeatureSet => ({
@@ -64,58 +64,58 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
environmentsUsed: 0,
identityLimit: null,
identitiesUsed: 0,
- dynamicSecret: false,
+ dynamicSecret: true,
secretVersioning: true,
- pitRecovery: false,
- ipAllowlisting: false,
- rbac: false,
- githubOrgSync: false,
- customRateLimits: false,
- subOrganization: false,
- customAlerts: false,
- secretAccessInsights: false,
- auditLogs: false,
+ pitRecovery: true,
+ ipAllowlisting: true,
+ rbac: true,
+ githubOrgSync: true,
+ customRateLimits: true,
+ subOrganization: true,
+ customAlerts: true,
+ secretAccessInsights: true,
+ auditLogs: true,
auditLogsRetentionDays: 0,
- auditLogStreams: false,
+ auditLogStreams: true,
auditLogStreamLimit: 3,
- samlSSO: false,
- enforceGoogleSSO: false,
- hsm: false,
- oidcSSO: false,
- scim: false,
- ldap: false,
- groups: false,
+ samlSSO: true,
+ enforceGoogleSSO: true,
+ hsm: true,
+ oidcSSO: true,
+ scim: true,
+ ldap: true,
+ groups: true,
status: null,
trial_end: null,
has_used_trial: true,
- secretApproval: false,
- secretRotation: false,
- caCrl: false,
- instanceUserManagement: false,
- externalKms: false,
+ secretApproval: true,
+ secretRotation: true,
+ caCrl: true,
+ instanceUserManagement: true,
+ externalKms: true,
rateLimits: {
readLimit: 60,
writeLimit: 200,
secretsLimit: 40
},
- pkiEst: false,
- pkiAcme: false,
- pkiScep: false,
- enforceMfa: false,
- projectTemplates: false,
- kmip: false,
- gateway: false,
- gatewayPool: false,
- sshHostGroups: false,
- secretScanning: false,
- enterpriseSecretSyncs: false,
- enterpriseCertificateSyncs: false,
- enterpriseAppConnections: false,
- fips: false,
- eventSubscriptions: false,
- machineIdentityAuthTemplates: false,
- pkiLegacyTemplates: false,
- secretShareExternalBranding: false
+ pkiEst: true,
+ pkiAcme: true,
+ pkiScep: true,
+ enforceMfa: true,
+ projectTemplates: true,
+ kmip: true,
+ gateway: true,
+ gatewayPool: true,
+ sshHostGroups: true,
+ secretScanning: true,
+ enterpriseSecretSyncs: true,
+ enterpriseCertificateSyncs: true,
+ enterpriseAppConnections: true,
+ fips: true,
+ eventSubscriptions: true,
+ machineIdentityAuthTemplates: true,
+ pkiLegacyTemplates: true,
+ secretShareExternalBranding: true
});
export const setupLicenseRequestWithStore = (
diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
index 2fe9aa4ffa..2508742402 100644
--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
@@ -1023,31 +1023,8 @@ export const secretRotationV2ServiceFactory = ({
})
);
- const conflictingRotation = await secretRotationV2DAL.findOne({
- name: secretRotation.name,
- folderId: destinationFolder.id
- });
-
- if (conflictingRotation)
- throw new BadRequestError({
- message: `A Secret Rotation with the name "${secretRotation.name}" already exists at the secret path "${destinationSecretPath}"`
- });
-
const mappedKeys = Object.values(secretsMapping as TSecretRotationV2["secretsMapping"]);
- const conflictingDestinationSecrets = await $findConflictingSecrets({
- secretKeys: mappedKeys,
- folderId: destinationFolder.id
- });
-
- if (conflictingDestinationSecrets.length && !overwriteDestination) {
- throw new BadRequestError({
- message: `The following secrets already exist at the destination path "${destinationSecretPath}": ${conflictingDestinationSecrets
- .map(({ key }) => key)
- .join(", ")}. Set "overwriteDestination" to true to replace them.`
- });
- }
-
const { encryptor: secretManagerEncryptor, decryptor: secretManagerDecryptor } =
await kmsService.createCipherPairWithDataKey({
type: KmsDataKey.SecretManager,
@@ -1055,6 +1032,29 @@ export const secretRotationV2ServiceFactory = ({
});
const updatedRotation = await secretRotationV2DAL.transaction(async (tx) => {
+ const conflictingRotation = await secretRotationV2DAL.findOne({
+ name: secretRotation.name,
+ folderId: destinationFolder.id
+ });
+
+ if (conflictingRotation)
+ throw new BadRequestError({
+ message: `A Secret Rotation with the name "${secretRotation.name}" already exists at the secret path "${destinationSecretPath}"`
+ });
+
+ const conflictingDestinationSecrets = await $findConflictingSecrets({
+ secretKeys: mappedKeys,
+ folderId: destinationFolder.id
+ });
+
+ if (conflictingDestinationSecrets.length && !overwriteDestination) {
+ throw new BadRequestError({
+ message: `The following secrets already exist at the destination path "${destinationSecretPath}": ${conflictingDestinationSecrets
+ .map(({ key }) => key)
+ .join(", ")}. Set "overwriteDestination" to true to replace them.`
+ });
+ }
+
if (conflictingDestinationSecrets.length && overwriteDestination) {
await secretV2BridgeDAL.deleteMany(
conflictingDestinationSecrets.map((s) => ({ key: s.key, type: SecretType.Shared })),