mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 07:27:43 +00:00
move OCI Vault Secret Sync to EE
This commit is contained in:
+2
-2
@@ -2,10 +2,10 @@ import {
|
|||||||
CreateOCIVaultSyncSchema,
|
CreateOCIVaultSyncSchema,
|
||||||
OCIVaultSyncSchema,
|
OCIVaultSyncSchema,
|
||||||
UpdateOCIVaultSyncSchema
|
UpdateOCIVaultSyncSchema
|
||||||
} from "@app/services/secret-sync/oci-vault";
|
} from "@app/ee/services/secret-sync/oci-vault";
|
||||||
import { SecretSync } from "@app/services/secret-sync/secret-sync-enums";
|
import { SecretSync } from "@app/services/secret-sync/secret-sync-enums";
|
||||||
|
|
||||||
import { registerSyncSecretsEndpoints } from "./secret-sync-endpoints";
|
import { registerSyncSecretsEndpoints } from "../../../../server/routes/v1/secret-sync-routers/secret-sync-endpoints";
|
||||||
|
|
||||||
export const registerOCIVaultSyncRouter = async (server: FastifyZodProvider) =>
|
export const registerOCIVaultSyncRouter = async (server: FastifyZodProvider) =>
|
||||||
registerSyncSecretsEndpoints({
|
registerSyncSecretsEndpoints({
|
||||||
@@ -54,7 +54,8 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
|
|||||||
projectTemplates: false,
|
projectTemplates: false,
|
||||||
kmip: false,
|
kmip: false,
|
||||||
gateway: false,
|
gateway: false,
|
||||||
sshHostGroups: false
|
sshHostGroups: false,
|
||||||
|
enterpriseSecretSyncs: false
|
||||||
});
|
});
|
||||||
|
|
||||||
export const setupLicenseRequestWithStore = (baseURL: string, refreshUrl: string, licenseKey: string) => {
|
export const setupLicenseRequestWithStore = (baseURL: string, refreshUrl: string, licenseKey: string) => {
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ export type TFeatureSet = {
|
|||||||
kmip: false;
|
kmip: false;
|
||||||
gateway: false;
|
gateway: false;
|
||||||
sshHostGroups: false;
|
sshHostGroups: false;
|
||||||
|
enterpriseSecretSyncs: false;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TOrgPlansTableDTO = {
|
export type TOrgPlansTableDTO = {
|
||||||
|
|||||||
+2
-1
@@ -6,5 +6,6 @@ export const OCI_VAULT_SYNC_LIST_OPTION: TSecretSyncListItem = {
|
|||||||
name: "OCI Vault",
|
name: "OCI Vault",
|
||||||
destination: SecretSync.OCIVault,
|
destination: SecretSync.OCIVault,
|
||||||
connection: AppConnection.OCI,
|
connection: AppConnection.OCI,
|
||||||
canImportSecrets: true
|
canImportSecrets: true,
|
||||||
|
enterprise: true
|
||||||
};
|
};
|
||||||
+3
-3
@@ -1,7 +1,5 @@
|
|||||||
import { secrets, vault } from "oci-sdk";
|
import { secrets, vault } from "oci-sdk";
|
||||||
|
|
||||||
import { delay } from "@app/lib/delay";
|
|
||||||
import { getOCIProvider } from "@app/services/app-connection/oci";
|
|
||||||
import {
|
import {
|
||||||
TCreateOCIVaultVariable,
|
TCreateOCIVaultVariable,
|
||||||
TDeleteOCIVaultVariable,
|
TDeleteOCIVaultVariable,
|
||||||
@@ -9,7 +7,9 @@ import {
|
|||||||
TOCIVaultSyncWithCredentials,
|
TOCIVaultSyncWithCredentials,
|
||||||
TUnmarkOCIVaultVariableFromDeletion,
|
TUnmarkOCIVaultVariableFromDeletion,
|
||||||
TUpdateOCIVaultVariable
|
TUpdateOCIVaultVariable
|
||||||
} from "@app/services/secret-sync/oci-vault/oci-vault-sync-types";
|
} from "@app/ee/services/secret-sync/oci-vault/oci-vault-sync-types";
|
||||||
|
import { delay } from "@app/lib/delay";
|
||||||
|
import { getOCIProvider } from "@app/services/app-connection/oci";
|
||||||
import { SecretSyncError } from "@app/services/secret-sync/secret-sync-errors";
|
import { SecretSyncError } from "@app/services/secret-sync/secret-sync-errors";
|
||||||
import { matchesSchema } from "@app/services/secret-sync/secret-sync-fns";
|
import { matchesSchema } from "@app/services/secret-sync/secret-sync-fns";
|
||||||
import { TSecretMap } from "@app/services/secret-sync/secret-sync-types";
|
import { TSecretMap } from "@app/services/secret-sync/secret-sync-types";
|
||||||
+2
-1
@@ -66,5 +66,6 @@ export const OCIVaultSyncListItemSchema = z.object({
|
|||||||
name: z.literal("OCI Vault"),
|
name: z.literal("OCI Vault"),
|
||||||
connection: z.literal(AppConnection.OCI),
|
connection: z.literal(AppConnection.OCI),
|
||||||
destination: z.literal(SecretSync.OCIVault),
|
destination: z.literal(SecretSync.OCIVault),
|
||||||
canImportSecrets: z.literal(true)
|
canImportSecrets: z.literal(true),
|
||||||
|
enterprise: z.boolean()
|
||||||
});
|
});
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { SecretSync } from "@app/services/secret-sync/secret-sync-enums";
|
import { SecretSync } from "@app/services/secret-sync/secret-sync-enums";
|
||||||
|
|
||||||
|
import { registerOCIVaultSyncRouter } from "../../../../ee/routes/v1/secret-sync-routers/oci-vault-sync-router";
|
||||||
import { registerAwsParameterStoreSyncRouter } from "./aws-parameter-store-sync-router";
|
import { registerAwsParameterStoreSyncRouter } from "./aws-parameter-store-sync-router";
|
||||||
import { registerAwsSecretsManagerSyncRouter } from "./aws-secrets-manager-sync-router";
|
import { registerAwsSecretsManagerSyncRouter } from "./aws-secrets-manager-sync-router";
|
||||||
import { registerAzureAppConfigurationSyncRouter } from "./azure-app-configuration-sync-router";
|
import { registerAzureAppConfigurationSyncRouter } from "./azure-app-configuration-sync-router";
|
||||||
@@ -10,7 +11,6 @@ import { registerGcpSyncRouter } from "./gcp-sync-router";
|
|||||||
import { registerGitHubSyncRouter } from "./github-sync-router";
|
import { registerGitHubSyncRouter } from "./github-sync-router";
|
||||||
import { registerHCVaultSyncRouter } from "./hc-vault-sync-router";
|
import { registerHCVaultSyncRouter } from "./hc-vault-sync-router";
|
||||||
import { registerHumanitecSyncRouter } from "./humanitec-sync-router";
|
import { registerHumanitecSyncRouter } from "./humanitec-sync-router";
|
||||||
import { registerOCIVaultSyncRouter } from "./oci-vault-sync-router";
|
|
||||||
import { registerTeamCitySyncRouter } from "./teamcity-sync-router";
|
import { registerTeamCitySyncRouter } from "./teamcity-sync-router";
|
||||||
import { registerTerraformCloudSyncRouter } from "./terraform-cloud-sync-router";
|
import { registerTerraformCloudSyncRouter } from "./terraform-cloud-sync-router";
|
||||||
import { registerVercelSyncRouter } from "./vercel-sync-router";
|
import { registerVercelSyncRouter } from "./vercel-sync-router";
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { EventType } from "@app/ee/services/audit-log/audit-log-types";
|
import { EventType } from "@app/ee/services/audit-log/audit-log-types";
|
||||||
|
import { OCIVaultSyncListItemSchema, OCIVaultSyncSchema } from "@app/ee/services/secret-sync/oci-vault";
|
||||||
import { ApiDocsTags, SecretSyncs } from "@app/lib/api-docs";
|
import { ApiDocsTags, SecretSyncs } from "@app/lib/api-docs";
|
||||||
import { readLimit } from "@app/server/config/rateLimiter";
|
import { readLimit } from "@app/server/config/rateLimiter";
|
||||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||||
@@ -24,7 +25,6 @@ import { GcpSyncListItemSchema, GcpSyncSchema } from "@app/services/secret-sync/
|
|||||||
import { GitHubSyncListItemSchema, GitHubSyncSchema } from "@app/services/secret-sync/github";
|
import { GitHubSyncListItemSchema, GitHubSyncSchema } from "@app/services/secret-sync/github";
|
||||||
import { HCVaultSyncListItemSchema, HCVaultSyncSchema } from "@app/services/secret-sync/hc-vault";
|
import { HCVaultSyncListItemSchema, HCVaultSyncSchema } from "@app/services/secret-sync/hc-vault";
|
||||||
import { HumanitecSyncListItemSchema, HumanitecSyncSchema } from "@app/services/secret-sync/humanitec";
|
import { HumanitecSyncListItemSchema, HumanitecSyncSchema } from "@app/services/secret-sync/humanitec";
|
||||||
import { OCIVaultSyncListItemSchema, OCIVaultSyncSchema } from "@app/services/secret-sync/oci-vault";
|
|
||||||
import { TeamCitySyncListItemSchema, TeamCitySyncSchema } from "@app/services/secret-sync/teamcity";
|
import { TeamCitySyncListItemSchema, TeamCitySyncSchema } from "@app/services/secret-sync/teamcity";
|
||||||
import { TerraformCloudSyncListItemSchema, TerraformCloudSyncSchema } from "@app/services/secret-sync/terraform-cloud";
|
import { TerraformCloudSyncListItemSchema, TerraformCloudSyncSchema } from "@app/services/secret-sync/terraform-cloud";
|
||||||
import { VercelSyncListItemSchema, VercelSyncSchema } from "@app/services/secret-sync/vercel";
|
import { VercelSyncListItemSchema, VercelSyncSchema } from "@app/services/secret-sync/vercel";
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
ProjectPermissionCertificateActions,
|
ProjectPermissionCertificateActions,
|
||||||
ProjectPermissionSub
|
ProjectPermissionSub
|
||||||
} from "@app/ee/services/permission/project-permission";
|
} from "@app/ee/services/permission/project-permission";
|
||||||
|
import { NotFoundError } from "@app/lib/errors";
|
||||||
import { TCertificateBodyDALFactory } from "@app/services/certificate/certificate-body-dal";
|
import { TCertificateBodyDALFactory } from "@app/services/certificate/certificate-body-dal";
|
||||||
import { TCertificateDALFactory } from "@app/services/certificate/certificate-dal";
|
import { TCertificateDALFactory } from "@app/services/certificate/certificate-dal";
|
||||||
import { TCertificateAuthorityCertDALFactory } from "@app/services/certificate-authority/certificate-authority-cert-dal";
|
import { TCertificateAuthorityCertDALFactory } from "@app/services/certificate-authority/certificate-authority-cert-dal";
|
||||||
@@ -29,7 +30,6 @@ import {
|
|||||||
TGetCertPrivateKeyDTO,
|
TGetCertPrivateKeyDTO,
|
||||||
TRevokeCertDTO
|
TRevokeCertDTO
|
||||||
} from "./certificate-types";
|
} from "./certificate-types";
|
||||||
import { NotFoundError } from "@app/lib/errors";
|
|
||||||
|
|
||||||
type TCertificateServiceFactoryDep = {
|
type TCertificateServiceFactoryDep = {
|
||||||
certificateDAL: Pick<TCertificateDALFactory, "findOne" | "deleteById" | "update" | "find">;
|
certificateDAL: Pick<TCertificateDALFactory, "findOne" | "deleteById" | "update" | "find">;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { AxiosError } from "axios";
|
import { AxiosError } from "axios";
|
||||||
import RE2 from "re2";
|
import RE2 from "re2";
|
||||||
|
|
||||||
|
import { OCI_VAULT_SYNC_LIST_OPTION, OCIVaultSyncFns } from "@app/ee/services/secret-sync/oci-vault";
|
||||||
import {
|
import {
|
||||||
AWS_PARAMETER_STORE_SYNC_LIST_OPTION,
|
AWS_PARAMETER_STORE_SYNC_LIST_OPTION,
|
||||||
AwsParameterStoreSyncFns
|
AwsParameterStoreSyncFns
|
||||||
@@ -29,7 +30,6 @@ import { GcpSyncFns } from "./gcp/gcp-sync-fns";
|
|||||||
import { HC_VAULT_SYNC_LIST_OPTION, HCVaultSyncFns } from "./hc-vault";
|
import { HC_VAULT_SYNC_LIST_OPTION, HCVaultSyncFns } from "./hc-vault";
|
||||||
import { HUMANITEC_SYNC_LIST_OPTION } from "./humanitec";
|
import { HUMANITEC_SYNC_LIST_OPTION } from "./humanitec";
|
||||||
import { HumanitecSyncFns } from "./humanitec/humanitec-sync-fns";
|
import { HumanitecSyncFns } from "./humanitec/humanitec-sync-fns";
|
||||||
import { OCI_VAULT_SYNC_LIST_OPTION, OCIVaultSyncFns } from "./oci-vault";
|
|
||||||
import { TEAMCITY_SYNC_LIST_OPTION, TeamCitySyncFns } from "./teamcity";
|
import { TEAMCITY_SYNC_LIST_OPTION, TeamCitySyncFns } from "./teamcity";
|
||||||
import { TERRAFORM_CLOUD_SYNC_LIST_OPTION, TerraformCloudSyncFns } from "./terraform-cloud";
|
import { TERRAFORM_CLOUD_SYNC_LIST_OPTION, TerraformCloudSyncFns } from "./terraform-cloud";
|
||||||
import { VERCEL_SYNC_LIST_OPTION, VercelSyncFns } from "./vercel";
|
import { VERCEL_SYNC_LIST_OPTION, VercelSyncFns } from "./vercel";
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
import { Job } from "bullmq";
|
import { Job } from "bullmq";
|
||||||
|
|
||||||
import { AuditLogInfo } from "@app/ee/services/audit-log/audit-log-types";
|
import { AuditLogInfo } from "@app/ee/services/audit-log/audit-log-types";
|
||||||
|
import {
|
||||||
|
TOCIVaultSync,
|
||||||
|
TOCIVaultSyncInput,
|
||||||
|
TOCIVaultSyncListItem,
|
||||||
|
TOCIVaultSyncWithCredentials
|
||||||
|
} from "@app/ee/services/secret-sync/oci-vault";
|
||||||
import { QueueJobs } from "@app/queue";
|
import { QueueJobs } from "@app/queue";
|
||||||
import { ResourceMetadataDTO } from "@app/services/resource-metadata/resource-metadata-schema";
|
import { ResourceMetadataDTO } from "@app/services/resource-metadata/resource-metadata-schema";
|
||||||
import {
|
import {
|
||||||
@@ -67,7 +73,6 @@ import {
|
|||||||
THumanitecSyncListItem,
|
THumanitecSyncListItem,
|
||||||
THumanitecSyncWithCredentials
|
THumanitecSyncWithCredentials
|
||||||
} from "./humanitec";
|
} from "./humanitec";
|
||||||
import { TOCIVaultSync, TOCIVaultSyncInput, TOCIVaultSyncListItem, TOCIVaultSyncWithCredentials } from "./oci-vault";
|
|
||||||
import {
|
import {
|
||||||
TTeamCitySync,
|
TTeamCitySync,
|
||||||
TTeamCitySyncInput,
|
TTeamCitySyncInput,
|
||||||
|
|||||||
@@ -4,14 +4,21 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { Spinner, Tooltip } from "@app/components/v2";
|
import { Spinner, Tooltip } from "@app/components/v2";
|
||||||
import { SECRET_SYNC_MAP } from "@app/helpers/secretSyncs";
|
import { SECRET_SYNC_MAP } from "@app/helpers/secretSyncs";
|
||||||
import { SecretSync, useSecretSyncOptions } from "@app/hooks/api/secretSyncs";
|
import { SecretSync, useSecretSyncOptions } from "@app/hooks/api/secretSyncs";
|
||||||
|
import { twMerge } from "tailwind-merge";
|
||||||
|
import { UpgradePlanModal } from "../license/UpgradePlanModal";
|
||||||
|
import { usePopUp } from "@app/hooks";
|
||||||
|
import { useSubscription } from "@app/context";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
onSelect: (destination: SecretSync) => void;
|
onSelect: (destination: SecretSync) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SecretSyncSelect = ({ onSelect }: Props) => {
|
export const SecretSyncSelect = ({ onSelect }: Props) => {
|
||||||
|
const { subscription } = useSubscription();
|
||||||
const { isPending, data: secretSyncOptions } = useSecretSyncOptions();
|
const { isPending, data: secretSyncOptions } = useSecretSyncOptions();
|
||||||
|
|
||||||
|
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"] as const);
|
||||||
|
|
||||||
if (isPending) {
|
if (isPending) {
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full flex-col items-center justify-center py-2.5">
|
<div className="flex h-full flex-col items-center justify-center py-2.5">
|
||||||
@@ -23,28 +30,49 @@ export const SecretSyncSelect = ({ onSelect }: Props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-4 gap-2">
|
<div className="grid grid-cols-4 gap-2">
|
||||||
{secretSyncOptions?.map(({ destination }) => {
|
{secretSyncOptions?.map(({ destination, enterprise }) => {
|
||||||
const { image, name } = SECRET_SYNC_MAP[destination];
|
const { image, name } = SECRET_SYNC_MAP[destination];
|
||||||
return (
|
return (
|
||||||
<button
|
<Tooltip
|
||||||
type="button"
|
content={
|
||||||
key={destination}
|
enterprise && !subscription.enterpriseSecretSyncs ? "Enterprise Plan Only" : undefined
|
||||||
onClick={() => onSelect(destination)}
|
}
|
||||||
className="group relative flex h-28 cursor-pointer flex-col items-center justify-center rounded-md border border-mineshaft-600 bg-mineshaft-700 p-4 duration-200 hover:bg-mineshaft-600"
|
|
||||||
>
|
>
|
||||||
<img
|
<button
|
||||||
src={`/images/integrations/${image}`}
|
type="button"
|
||||||
height={40}
|
key={destination}
|
||||||
width={40}
|
onClick={() =>
|
||||||
className="mt-auto"
|
enterprise && !subscription.enterpriseSecretSyncs
|
||||||
alt={`${name} logo`}
|
? handlePopUpOpen("upgradePlan")
|
||||||
/>
|
: onSelect(destination)
|
||||||
<div className="mt-auto max-w-xs text-center text-xs font-medium text-gray-300 duration-200 group-hover:text-gray-200">
|
}
|
||||||
{name}
|
className={twMerge(
|
||||||
</div>
|
"group relative flex h-28 cursor-pointer flex-col items-center justify-center overflow-hidden rounded-md border border-mineshaft-600 bg-mineshaft-700 p-4 duration-200 hover:bg-mineshaft-600",
|
||||||
</button>
|
enterprise && !subscription.enterpriseSecretSyncs ? "border-0 bg-opacity-0" : ""
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{enterprise && !subscription.enterpriseSecretSyncs && (
|
||||||
|
<div className="absolute h-full w-full backdrop-blur-[1px]"></div>
|
||||||
|
)}
|
||||||
|
<img
|
||||||
|
src={`/images/integrations/${image}`}
|
||||||
|
height={40}
|
||||||
|
width={40}
|
||||||
|
className="mt-auto"
|
||||||
|
alt={`${name} logo`}
|
||||||
|
/>
|
||||||
|
<div className="mt-auto max-w-xs text-center text-xs font-medium text-gray-300 duration-200 group-hover:text-gray-200">
|
||||||
|
{name}
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</Tooltip>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
<UpgradePlanModal
|
||||||
|
isOpen={popUp.upgradePlan.isOpen}
|
||||||
|
onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}
|
||||||
|
text="You can use every Secret Sync if you switch to Infisical's Enterprise plan."
|
||||||
|
/>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
side="bottom"
|
side="bottom"
|
||||||
className="max-w-sm py-4"
|
className="max-w-sm py-4"
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export type TSecretSyncOption = {
|
|||||||
name: string;
|
name: string;
|
||||||
destination: SecretSync;
|
destination: SecretSync;
|
||||||
canImportSecrets: boolean;
|
canImportSecrets: boolean;
|
||||||
|
enterprise?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TSecretSync =
|
export type TSecretSync =
|
||||||
|
|||||||
@@ -50,4 +50,5 @@ export type SubscriptionPlan = {
|
|||||||
enforceMfa: boolean;
|
enforceMfa: boolean;
|
||||||
projectTemplates: boolean;
|
projectTemplates: boolean;
|
||||||
kmip: boolean;
|
kmip: boolean;
|
||||||
|
enterpriseSecretSyncs: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user