Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
feat(pki): add Nutanix Prism Central as a PKI sync destination (#6610)
Christophe Jauffret410217a3c90d
diff --git a/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts b/backend/src/server/routes/v1/app-connection-routers/app-connection-router.tsindex dee00a6bfc..b58c3889bf 100644--- a/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts+++ b/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts@@ -168,6 +168,10 @@ import {NorthflankConnectionListItemSchema,SanitizedNorthflankConnectionSchema} from "@app/services/app-connection/northflank";+import {+ NutanixPrismCentralConnectionListItemSchema,+ SanitizedNutanixPrismCentralConnectionSchema+} from "@app/services/app-connection/nutanix-prism-central";import {OctopusDeployConnectionListItemSchema,SanitizedOctopusDeployConnectionSchema@@ -325,7 +329,8 @@ const SanitizedAppConnectionSchema = z.union([...SanitizedRundeckConnectionSchema.options,...SanitizedQoveryConnectionSchema.options,...SanitizedLiteLLMConnectionSchema.options,- ...SanitizedFireworksConnectionSchema.options+ ...SanitizedFireworksConnectionSchema.options,+ ...SanitizedNutanixPrismCentralConnectionSchema.options]);const AppConnectionOptionsSchema = z.discriminatedUnion("app", [@@ -407,7 +412,8 @@ const AppConnectionOptionsSchema = z.discriminatedUnion("app", [RundeckConnectionListItemSchema,QoveryConnectionListItemSchema,LiteLLMConnectionListItemSchema,- FireworksConnectionListItemSchema+ FireworksConnectionListItemSchema,+ NutanixPrismCentralConnectionListItemSchema]);export const registerAppConnectionRouter = async (server: FastifyZodProvider) => {diff --git a/backend/src/server/routes/v1/app-connection-routers/index.ts b/backend/src/server/routes/v1/app-connection-routers/index.tsindex 61f195b647..d90f5d1645 100644--- a/backend/src/server/routes/v1/app-connection-routers/index.ts+++ b/backend/src/server/routes/v1/app-connection-routers/index.ts@@ -52,6 +52,7 @@ import { registerMySqlConnectionRouter } from "./mysql-connection-router";import { registerNetlifyConnectionRouter } from "./netlify-connection-router";import { registerNetScalerConnectionRouter } from "./netscaler-connection-router";import { registerNorthflankConnectionRouter } from "./northflank-connection-router";+import { registerNutanixPrismCentralConnectionRouter } from "./nutanix-prism-central-connection-router";import { registerOctopusDeployConnectionRouter } from "./octopus-deploy-connection-router";import { registerOktaConnectionRouter } from "./okta-connection-router";import { registerOnaConnectionRouter } from "./ona-connection-router";@@ -162,5 +163,6 @@ export const APP_CONNECTION_REGISTER_ROUTER_MAP: Record<AppConnection, (server:[AppConnection.HasuraCloud]: registerHasuraCloudConnectionRouter,[AppConnection.Qovery]: registerQoveryConnectionRouter,[AppConnection.LiteLLM]: registerLiteLLMConnectionRouter,- [AppConnection.Fireworks]: registerFireworksConnectionRouter+ [AppConnection.Fireworks]: registerFireworksConnectionRouter,+ [AppConnection.NutanixPrismCentral]: registerNutanixPrismCentralConnectionRouter};diff --git a/backend/src/server/routes/v1/app-connection-routers/nutanix-prism-central-connection-router.ts b/backend/src/server/routes/v1/app-connection-routers/nutanix-prism-central-connection-router.tsnew file mode 100644index 0000000000..f91f0c9b20--- /dev/null+++ b/backend/src/server/routes/v1/app-connection-routers/nutanix-prism-central-connection-router.ts@@ -0,0 +1,55 @@+import z from "zod";++import { readLimit } from "@app/server/config/rateLimiter";+import { verifyAuth } from "@app/server/plugins/auth/verify-auth";+import { AppConnection } from "@app/services/app-connection/app-connection-enums";+import {+ CreateNutanixPrismCentralConnectionSchema,+ SanitizedNutanixPrismCentralConnectionSchema,+ UpdateNutanixPrismCentralConnectionSchema+} from "@app/services/app-connection/nutanix-prism-central";+import { AuthMode } from "@app/services/auth/auth-type";++import { registerAppConnectionEndpoints } from "./app-connection-endpoints";++export const registerNutanixPrismCentralConnectionRouter = async (server: FastifyZodProvider) => {+ registerAppConnectionEndpoints({+ app: AppConnection.NutanixPrismCentral,+ server,+ sanitizedResponseSchema: SanitizedNutanixPrismCentralConnectionSchema,+ createSchema: CreateNutanixPrismCentralConnectionSchema,+ updateSchema: UpdateNutanixPrismCentralConnectionSchema+ });++ server.route({+ method: "GET",+ url: `/:connectionId/clusters`,+ config: {+ rateLimit: readLimit+ },+ schema: {+ operationId: "listNutanixPrismCentralClusters",+ params: z.object({+ connectionId: z.string().uuid()+ }),+ response: {+ 200: z.object({+ clusters: z.array(+ z.object({+ id: z.string(),+ name: z.string()+ })+ )+ })+ }+ },+ onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),+ handler: async (req) => {+ const clusters = await server.services.appConnection.nutanixPrismCentral.listClusters(+ { connectionId: req.params.connectionId },+ req.permission+ );+ return { clusters };+ }+ });+};diff --git a/backend/src/server/routes/v1/pki-sync-routers/index.ts b/backend/src/server/routes/v1/pki-sync-routers/index.tsindex a2e474b560..bb0417979a 100644--- a/backend/src/server/routes/v1/pki-sync-routers/index.ts+++ b/backend/src/server/routes/v1/pki-sync-routers/index.ts@@ -9,6 +9,7 @@ import { registerCloudflareCustomCertificatePkiSyncRouter } from "./cloudflare-cimport { registerF5BigIpPkiSyncRouter } from "./f5-big-ip-pki-sync-router";import { registerLinuxServerPkiSyncRouter } from "./linux-server-pki-sync-router";import { registerNetScalerPkiSyncRouter } from "./netscaler-pki-sync-router";+import { registerNutanixPrismCentralPkiSyncRouter } from "./nutanix-prism-central-pki-sync-router";import { registerWindowsServerPkiSyncRouter } from "./windows-server-pki-sync-router";export * from "./pki-sync-router";@@ -26,5 +27,6 @@ export const PKI_SYNC_REGISTER_ROUTER_MAP: Record<[PkiSync.NetScaler]: registerNetScalerPkiSyncRouter,[PkiSync.F5BigIp]: registerF5BigIpPkiSyncRouter,[PkiSync.LinuxServer]: registerLinuxServerPkiSyncRouter,- [PkiSync.WindowsServer]: registerWindowsServerPkiSyncRouter+ [PkiSync.WindowsServer]: registerWindowsServerPkiSyncRouter,+ [PkiSync.NutanixPrismCentral]: registerNutanixPrismCentralPkiSyncRouter};diff --git a/backend/src/server/routes/v1/pki-sync-routers/nutanix-prism-central-pki-sync-router.ts b/backend/src/server/routes/v1/pki-sync-routers/nutanix-prism-central-pki-sync-router.tsnew file mode 100644index 0000000000..3c9bee052a--- /dev/null+++ b/backend/src/server/routes/v1/pki-sync-routers/nutanix-prism-central-pki-sync-router.ts@@ -0,0 +1,26 @@+import {+ CreateNutanixPrismCentralPkiSyncSchema,+ NUTANIX_PRISM_CENTRAL_PKI_SYNC_LIST_OPTION,+ NutanixPrismCentralPkiSyncSchema,+ UpdateNutanixPrismCentralPkiSyncSchema+} from "@app/services/pki-sync/nutanix-prism-central";+import { PkiSync } from "@app/services/pki-sync/pki-sync-enums";++import { registerSyncPkiEndpoints } from "./pki-sync-endpoints";++export const registerNutanixPrismCentralPkiSyncRouter = async (+ server: FastifyZodProvider,+ enableOperationId: boolean = true+) =>+ registerSyncPkiEndpoints({+ destination: PkiSync.NutanixPrismCentral,+ server,+ responseSchema: NutanixPrismCentralPkiSyncSchema,+ createSchema: CreateNutanixPrismCentralPkiSyncSchema,+ updateSchema: UpdateNutanixPrismCentralPkiSyncSchema,+ syncOptions: {+ canImportCertificates: NUTANIX_PRISM_CENTRAL_PKI_SYNC_LIST_OPTION.canImportCertificates,+ canRemoveCertificates: NUTANIX_PRISM_CENTRAL_PKI_SYNC_LIST_OPTION.canRemoveCertificates+ },+ enableOperationId+ });diff --git a/backend/src/server/routes/v1/pki-sync-routers/pki-sync-endpoints.ts b/backend/src/server/routes/v1/pki-sync-routers/pki-sync-endpoints.tsindex 4a3db052da..1fedf5db3e 100644--- a/backend/src/server/routes/v1/pki-sync-routers/pki-sync-endpoints.ts+++ b/backend/src/server/routes/v1/pki-sync-routers/pki-sync-endpoints.ts@@ -352,36 +352,39 @@ export const registerSyncPkiEndpoints = ({});}- server.route({- method: "POST",- url: "/:pkiSyncId/remove-certificates",- config: {- rateLimit: writeLimit- },- schema: {- hide: false,- ...(enableOperationId ? { operationId: `remove${destinationNameForOpId}PkiSyncCertificates` } : {}),- tags: [ApiDocsTags.PkiSyncs],- description: `Remove certificates from the specified ${destinationName} PKI Sync destination.`,- params: z.object({- pkiSyncId: z.string()- }),- response: {- 200: z.object({ message: z.string() })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const { pkiSyncId } = req.params;+ // Only register remove route if the destination supports it+ if (syncOptions.canRemoveCertificates) {+ server.route({+ method: "POST",+ url: "/:pkiSyncId/remove-certificates",+ config: {+ rateLimit: writeLimit+ },+ schema: {+ hide: false,+ ...(enableOperationId ? { operationId: `remove${destinationNameForOpId}PkiSyncCertificates` } : {}),+ tags: [ApiDocsTags.PkiSyncs],+ description: `Remove certificates from the specified ${destinationName} PKI Sync destination.`,+ params: z.object({+ pkiSyncId: z.string()+ }),+ response: {+ 200: z.object({ message: z.string() })+ }+ },+ onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),+ handler: async (req) => {+ const { pkiSyncId } = req.params;- const result = await server.services.pkiSync.triggerPkiSyncRemoveCertificatesById(- {- id: pkiSyncId- },- req.permission- );+ const result = await server.services.pkiSync.triggerPkiSyncRemoveCertificatesById(+ {+ id: pkiSyncId+ },+ req.permission+ );- return result;- }- });+ return result;+ }+ });+ }};diff --git a/backend/src/server/routes/v1/pki-sync-routers/pki-sync-router.ts b/backend/src/server/routes/v1/pki-sync-routers/pki-sync-router.tsindex c9bdfaabb5..c692a41602 100644--- a/backend/src/server/routes/v1/pki-sync-routers/pki-sync-router.ts+++ b/backend/src/server/routes/v1/pki-sync-routers/pki-sync-router.ts@@ -74,6 +74,7 @@ const PkiSyncOptionsSchema = z.object({destination: z.nativeEnum(PkiSync),canImportCertificates: z.boolean(),canRemoveCertificates: z.boolean(),+ maxCertificates: z.number().optional(),defaultCertificateNameSchema: z.string().optional(),forbiddenCharacters: z.string().optional(),allowedCharacterPattern: z.string().optional(),diff --git a/backend/src/services/app-connection/app-connection-enums.ts b/backend/src/services/app-connection/app-connection-enums.tsindex 44b4109b6c..b3b0ef2d29 100644--- a/backend/src/services/app-connection/app-connection-enums.ts+++ b/backend/src/services/app-connection/app-connection-enums.ts@@ -77,7 +77,8 @@ export enum AppConnection {Qovery = "qovery",Cloud66 = "cloud-66",LiteLLM = "litellm",- Fireworks = "fireworks"+ Fireworks = "fireworks",+ NutanixPrismCentral = "nutanix-prism-central"}export enum AWSRegion {diff --git a/backend/src/services/app-connection/app-connection-fns.ts b/backend/src/services/app-connection/app-connection-fns.tsindex 751192345b..9b2e81b2fe 100644--- a/backend/src/services/app-connection/app-connection-fns.ts+++ b/backend/src/services/app-connection/app-connection-fns.ts@@ -209,6 +209,11 @@ import {NorthflankConnectionMethod,validateNorthflankConnectionCredentials} from "./northflank";+import {+ getNutanixPrismCentralConnectionListItem,+ NutanixPrismCentralConnectionMethod,+ validateNutanixPrismCentralConnectionCredentials+} from "./nutanix-prism-central";import {getOctopusDeployConnectionListItem,OctopusDeployConnectionMethod,@@ -313,7 +318,8 @@ const PKI_APP_CONNECTIONS = [AppConnection.F5BigIp,AppConnection.GoDaddy,AppConnection.SSH,- AppConnection.WinRM+ AppConnection.WinRM,+ AppConnection.NutanixPrismCentral];export const listAppConnectionOptions = (projectType?: ProjectType) => {@@ -396,7 +402,8 @@ export const listAppConnectionOptions = (projectType?: ProjectType) => {getRundeckConnectionListItem(),getQoveryConnectionListItem(),getLiteLLMConnectionListItem(),- getFireworksConnectionListItem()+ getFireworksConnectionListItem(),+ getNutanixPrismCentralConnectionListItem()].filter((option) => {switch (projectType) {@@ -646,7 +653,9 @@ export const validateAppConnectionCredentials = async ([AppConnection.Rundeck]: validateRundeckConnectionCredentials as TAppConnectionCredentialsValidator,[AppConnection.Qovery]: validateQoveryConnectionCredentials as TAppConnectionCredentialsValidator,[AppConnection.LiteLLM]: validateLiteLLMConnectionCredentials as TAppConnectionCredentialsValidator,- [AppConnection.Fireworks]: validateFireworksConnectionCredentials as TAppConnectionCredentialsValidator+ [AppConnection.Fireworks]: validateFireworksConnectionCredentials as TAppConnectionCredentialsValidator,+ [AppConnection.NutanixPrismCentral]:+ validateNutanixPrismCentralConnectionCredentials as TAppConnectionCredentialsValidator};return VALIDATE_APP_CONNECTION_CREDENTIALS_MAP[appConnection.app](appConnection, gatewayService, gatewayV2Service);@@ -751,6 +760,7 @@ export const getAppConnectionMethodName = (method: TAppConnection["method"]) =>case DatadogConnectionMethod.ApiKey:case GoDaddyConnectionMethod.ApiKey:case TriggerDevConnectionMethod.ApiKey:+ case NutanixPrismCentralConnectionMethod.ApiKey:return "API Key";case ChefConnectionMethod.UserKey:return "User Key";@@ -758,8 +768,8 @@ export const getAppConnectionMethodName = (method: TAppConnection["method"]) =>case SupabaseConnectionMethod.AccessToken:return "Access Token";case NetScalerConnectionMethod.BasicAuth:- return "Basic Auth";case F5BigIpConnectionMethod.BasicAuth:+ case NutanixPrismCentralConnectionMethod.BasicAuth:return "Basic Auth";case ExternalInfisicalConnectionMethod.MachineIdentityUniversalAuth:return "Machine Identity - Universal Auth";@@ -907,7 +917,8 @@ export const TRANSITION_CONNECTION_CREDENTIALS_TO_PLATFORM: Record<[AppConnection.Rundeck]: platformManagedCredentialsNotSupported,[AppConnection.Qovery]: platformManagedCredentialsNotSupported,[AppConnection.LiteLLM]: platformManagedCredentialsNotSupported,- [AppConnection.Fireworks]: platformManagedCredentialsNotSupported+ [AppConnection.Fireworks]: platformManagedCredentialsNotSupported,+ [AppConnection.NutanixPrismCentral]: platformManagedCredentialsNotSupported};export const enterpriseAppCheck = async (diff --git a/backend/src/services/app-connection/app-connection-maps.ts b/backend/src/services/app-connection/app-connection-maps.tsindex b034bd6d46..d6302baf3b 100644--- a/backend/src/services/app-connection/app-connection-maps.ts+++ b/backend/src/services/app-connection/app-connection-maps.ts@@ -79,7 +79,8 @@ export const APP_CONNECTION_NAME_MAP: Record<AppConnection, string> = {[AppConnection.Qovery]: "Qovery",[AppConnection.Cloud66]: "Cloud 66",[AppConnection.LiteLLM]: "LiteLLM",- [AppConnection.Fireworks]: "Fireworks"+ [AppConnection.Fireworks]: "Fireworks",+ [AppConnection.NutanixPrismCentral]: "Nutanix Prism Central"};export const APP_CONNECTION_PLAN_MAP: Record<AppConnection, AppConnectionPlanType> = {@@ -161,5 +162,6 @@ export const APP_CONNECTION_PLAN_MAP: Record<AppConnection, AppConnectionPlanTyp[AppConnection.Qovery]: AppConnectionPlanType.Regular,[AppConnection.Cloud66]: AppConnectionPlanType.Regular,[AppConnection.LiteLLM]: AppConnectionPlanType.Regular,- [AppConnection.Fireworks]: AppConnectionPlanType.Regular+ [AppConnection.Fireworks]: AppConnectionPlanType.Regular,+ [AppConnection.NutanixPrismCentral]: AppConnectionPlanType.Regular};diff --git a/backend/src/services/app-connection/app-connection-service.ts b/backend/src/services/app-connection/app-connection-service.tsindex d2ced3171f..0f7f85e50d 100644--- a/backend/src/services/app-connection/app-connection-service.ts+++ b/backend/src/services/app-connection/app-connection-service.ts@@ -144,6 +144,10 @@ import { netlifyConnectionService } from "./netlify/netlify-connection-service";import { ValidateNetScalerConnectionCredentialsSchema } from "./netscaler";import { ValidateNorthflankConnectionCredentialsSchema } from "./northflank";import { northflankConnectionService } from "./northflank/northflank-connection-service";+import {+ nutanixPrismCentralConnectionService,+ ValidateNutanixPrismCentralConnectionCredentialsSchema+} from "./nutanix-prism-central";import { ValidateOctopusDeployConnectionCredentialsSchema } from "./octopus-deploy";import { octopusDeployConnectionService } from "./octopus-deploy/octopus-deploy-connection-service";import { ValidateOktaConnectionCredentialsSchema } from "./okta";@@ -292,7 +296,8 @@ const VALIDATE_APP_CONNECTION_CREDENTIALS_MAP: Record<AppConnection, TValidateAp[AppConnection.Rundeck]: ValidateRundeckConnectionCredentialsSchema,[AppConnection.Qovery]: ValidateQoveryConnectionCredentialsSchema,[AppConnection.LiteLLM]: ValidateLiteLLMConnectionCredentialsSchema,- [AppConnection.Fireworks]: ValidateFireworksConnectionCredentialsSchema+ [AppConnection.Fireworks]: ValidateFireworksConnectionCredentialsSchema,+ [AppConnection.NutanixPrismCentral]: ValidateNutanixPrismCentralConnectionCredentialsSchema};export const appConnectionServiceFactory = ({@@ -1394,6 +1399,11 @@ export const appConnectionServiceFactory = ({travisCI: travisCIConnectionService(connectAppConnectionById),snowflake: snowflakeConnectionService(connectAppConnectionById),litellm: liteLLMConnectionService(connectAppConnectionById),- fireworks: fireworksConnectionService(connectAppConnectionById)+ fireworks: fireworksConnectionService(connectAppConnectionById),+ nutanixPrismCentral: nutanixPrismCentralConnectionService(+ connectAppConnectionById,+ gatewayV2Service,+ gatewayPoolService+ )};};diff --git a/backend/src/services/app-connection/app-connection-types.ts b/backend/src/services/app-connection/app-connection-types.tsindex 2cfb9318fd..639e9ab97b 100644--- a/backend/src/services/app-connection/app-connection-types.ts+++ b/backend/src/services/app-connection/app-connection-types.ts@@ -306,6 +306,12 @@ import {TNorthflankConnectionInput,TValidateNorthflankConnectionCredentialsSchema} from "./northflank";+import {+ TNutanixPrismCentralConnection,+ TNutanixPrismCentralConnectionConfig,+ TNutanixPrismCentralConnectionInput,+ TValidateNutanixPrismCentralConnectionCredentialsSchema+} from "./nutanix-prism-central";import {TOctopusDeployConnection,TOctopusDeployConnectionConfig,@@ -550,6 +556,7 @@ export type TAppConnection = { id: string; configuration?: TAppConnectionConfigu| TQoveryConnection| TLiteLLMConnection| TFireworksConnection+ | TNutanixPrismCentralConnection);export type TAppConnectionRaw = NonNullable<Awaited<ReturnType<TAppConnectionDALFactory["findById"]>>>;@@ -640,6 +647,7 @@ export type TAppConnectionInput = { id: string } & (| TQoveryConnectionInput| TLiteLLMConnectionInput| TFireworksConnectionInput+ | TNutanixPrismCentralConnectionInput);export type TSqlConnectionInput =@@ -761,7 +769,8 @@ export type TAppConnectionConfig =| THasuraCloudConnectionConfig| TQoveryConnectionConfig| TLiteLLMConnectionConfig- | TFireworksConnectionConfig;+ | TFireworksConnectionConfig+ | TNutanixPrismCentralConnectionConfig;export type TValidateAppConnectionCredentialsSchema =| TValidateAwsConnectionCredentialsSchema@@ -842,7 +851,8 @@ export type TValidateAppConnectionCredentialsSchema =| TValidateHasuraCloudConnectionCredentialsSchema| TValidateQoveryConnectionCredentialsSchema| TValidateLiteLLMConnectionCredentialsSchema- | TValidateFireworksConnectionCredentialsSchema;+ | TValidateFireworksConnectionCredentialsSchema+ | TValidateNutanixPrismCentralConnectionCredentialsSchema;export type TListAwsConnectionKmsKeys = {connectionId: string;diff --git a/backend/src/services/app-connection/nutanix-prism-central/index.ts b/backend/src/services/app-connection/nutanix-prism-central/index.tsnew file mode 100644index 0000000000..9cda260165--- /dev/null+++ b/backend/src/services/app-connection/nutanix-prism-central/index.ts@@ -0,0 +1,20 @@+export { NutanixPrismCentralConnectionMethod } from "./nutanix-prism-central-connection-enums";+export {+ getNutanixPrismCentralConnectionListItem,+ listNutanixClusters,+ validateNutanixPrismCentralConnectionCredentials+} from "./nutanix-prism-central-connection-fns";+export {+ CreateNutanixPrismCentralConnectionSchema,+ NutanixPrismCentralConnectionListItemSchema,+ SanitizedNutanixPrismCentralConnectionSchema,+ UpdateNutanixPrismCentralConnectionSchema,+ ValidateNutanixPrismCentralConnectionCredentialsSchema+} from "./nutanix-prism-central-connection-schemas";+export { nutanixPrismCentralConnectionService } from "./nutanix-prism-central-connection-service";+export type {+ TNutanixPrismCentralConnection,+ TNutanixPrismCentralConnectionConfig,+ TNutanixPrismCentralConnectionInput,+ TValidateNutanixPrismCentralConnectionCredentialsSchema+} from "./nutanix-prism-central-connection-types";diff --git a/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-enums.ts b/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-enums.tsnew file mode 100644index 0000000000..9bb60ba306--- /dev/null+++ b/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-enums.ts@@ -0,0 +1,4 @@+export enum NutanixPrismCentralConnectionMethod {+ ApiKey = "api-key",+ BasicAuth = "basic-auth"+}diff --git a/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-fns.ts b/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-fns.tsnew file mode 100644index 0000000000..6d83c9c633--- /dev/null+++ b/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-fns.ts@@ -0,0 +1,218 @@+import { AxiosRequestConfig } from "axios";+import crypto from "crypto";+import https from "https";++import { TGatewayServiceFactory } from "@app/ee/services/gateway/gateway-service";+import { TGatewayV2ServiceFactory } from "@app/ee/services/gateway-v2/gateway-v2-service";+import { request } from "@app/lib/config/request";+import { BadRequestError } from "@app/lib/errors";+import { GatewayProxyProtocol } from "@app/lib/gateway";+import { withGatewayV2Proxy } from "@app/lib/gateway-v2/gateway-v2";+import { blockLocalAndPrivateIpAddresses, buildSsrfSafeAgent } from "@app/lib/validator";+import { AppConnection } from "@app/services/app-connection/app-connection-enums";++import { NutanixPrismCentralConnectionMethod } from "./nutanix-prism-central-connection-enums";+import { TNutanixPrismCentralConnectionConfig } from "./nutanix-prism-central-connection-types";++export const NUTANIX_DEFAULT_PORT = 9440;++export const getNutanixPrismCentralConnectionListItem = () => {+ return {+ name: "Nutanix Prism Central" as const,+ app: AppConnection.NutanixPrismCentral as const,+ methods: Object.values(NutanixPrismCentralConnectionMethod) as [+ NutanixPrismCentralConnectionMethod.ApiKey,+ NutanixPrismCentralConnectionMethod.BasicAuth+ ]+ };+};++export const buildNutanixAuthHeaders = (+ credentials: TNutanixPrismCentralConnectionConfig["credentials"],+ method: NutanixPrismCentralConnectionMethod+): Record<string, string> => {+ // Nutanix uses NTNX-Request-Id for idempotency; must be unique per request+ const headers: Record<string, string> = {+ Accept: "application/json",+ "NTNX-Request-Id": crypto.randomUUID()+ };++ if (method === NutanixPrismCentralConnectionMethod.ApiKey) {+ const { apiKey } = credentials as { apiKey: string };+ headers["X-ntnx-api-key"] = apiKey;+ } else {+ const { username, password } = credentials as { username: string; password: string };+ headers.Authorization = `Basic ${Buffer.from(`${username}:${password}`).toString("base64")}`;+ }++ return headers;+};++export type TNutanixResponse<R> = {+ data: R;+ headers: Record<string, string | undefined>;+};++export type TNutanixMakeRequest = <R>(requestCfg: AxiosRequestConfig) => Promise<TNutanixResponse<R>>;++export const executeNutanixOperationWithGateway = async <T>(+ config: {+ gatewayId?: string | null;+ credentials: TNutanixPrismCentralConnectionConfig["credentials"];+ method: NutanixPrismCentralConnectionMethod;+ },+ gatewayV2Service: Pick<TGatewayV2ServiceFactory, "getPlatformConnectionDetailsByGatewayId"> | undefined,+ operation: (makeRequest: TNutanixMakeRequest) => Promise<T>+): Promise<T> => {+ const { gatewayId, credentials, method } = config;+ const { hostname, port: credPort } = credentials;+ const port = credPort ?? NUTANIX_DEFAULT_PORT;++ if (gatewayId && gatewayV2Service) {+ await blockLocalAndPrivateIpAddresses(`https://${hostname}`, true);++ const platformConnectionDetails = await gatewayV2Service.getPlatformConnectionDetailsByGatewayId({+ gatewayId,+ targetHost: hostname,+ targetPort: port+ });++ if (!platformConnectionDetails) {+ throw new BadRequestError({ message: "Unable to connect to gateway, no platform connection details found" });+ }++ return withGatewayV2Proxy(+ async (proxyPort) => {+ const httpsAgent = new https.Agent({+ servername: hostname,+ rejectUnauthorized: credentials.sslRejectUnauthorized,+ ca: credentials.sslCertificate ? [credentials.sslCertificate] : undefined+ });++ const proxyBaseUrl = `https://localhost:${proxyPort}`;+ const targetBaseUrl = `https://${hostname}:${port}`;++ const makeRequest: TNutanixMakeRequest = async <R>(requestCfg: AxiosRequestConfig) => {+ const resp = await request.request<R>({+ ...requestCfg,+ url: requestCfg.url?.replace(targetBaseUrl, proxyBaseUrl),+ headers: {+ ...buildNutanixAuthHeaders(credentials, method),+ ...requestCfg.headers,+ Host: hostname+ },+ httpsAgent,+ maxRedirects: 0+ });+ return { data: resp.data, headers: resp.headers as Record<string, string | undefined> };+ };++ return operation(makeRequest);+ },+ {+ protocol: GatewayProxyProtocol.Tcp,+ relayHost: platformConnectionDetails.relayHost,+ gateway: platformConnectionDetails.gateway,+ relay: platformConnectionDetails.relay+ }+ );+ }++ const httpsAgent = await buildSsrfSafeAgent(`https://${hostname}:${port}`, {+ ca: credentials.sslCertificate,+ rejectUnauthorized: credentials.sslRejectUnauthorized,+ servername: hostname+ });++ const makeRequest: TNutanixMakeRequest = async <R>(requestCfg: AxiosRequestConfig) => {+ const resp = await request.request<R>({+ ...requestCfg,+ headers: {+ ...buildNutanixAuthHeaders(credentials, method),+ ...requestCfg.headers+ },+ httpsAgent,+ maxRedirects: 0+ });+ return { data: resp.data, headers: resp.headers as Record<string, string | undefined> };+ };++ return operation(makeRequest);+};++export const validateNutanixPrismCentralConnectionCredentials = async (+ config: TNutanixPrismCentralConnectionConfig,+ _gatewayService: Pick<TGatewayServiceFactory, "fnGetGatewayClientTlsByGatewayId">,+ gatewayV2Service: Pick<TGatewayV2ServiceFactory, "getPlatformConnectionDetailsByGatewayId">+) => {+ const { credentials } = config;+ const { hostname, port: credPort } = credentials;+ const port = credPort ?? NUTANIX_DEFAULT_PORT;+ const baseUrl = `https://${hostname}:${port}`;++ try {+ await executeNutanixOperationWithGateway(+ { gatewayId: config.gatewayId, credentials, method: config.method },+ gatewayV2Service,+ async (makeRequest) => {+ await makeRequest({+ method: "GET",+ url: `${baseUrl}/api/clustermgmt/v4.2/config/clusters`,+ params: { $limit: 1 }+ });+ }+ );+ } catch (error: unknown) {+ if (error instanceof BadRequestError) throw error;+ throw new BadRequestError({+ message: `Unable to validate Nutanix Prism Central connection: ${error instanceof Error ? error.message : "verify credentials and that Prism Central is reachable"}`+ });+ }++ return config.credentials;+};++type TNutanixClusterResponse = {+ data: Array<{+ extId: string;+ name: string;+ }>;+};++export const listNutanixClusters = async (+ config: TNutanixPrismCentralConnectionConfig,+ gatewayV2Service?: Pick<TGatewayV2ServiceFactory, "getPlatformConnectionDetailsByGatewayId">+): Promise<{ id: string; name: string }[]> => {+ const { credentials } = config;+ const { hostname, port: credPort } = credentials;+ const port = credPort ?? NUTANIX_DEFAULT_PORT;+ const baseUrl = `https://${hostname}:${port}`;++ try {+ return await executeNutanixOperationWithGateway(+ { gatewayId: config.gatewayId, credentials, method: config.method },+ gatewayV2Service,+ async (makeRequest) => {+ const { data: body } = await makeRequest<TNutanixClusterResponse>({+ method: "GET",+ url: `${baseUrl}/api/clustermgmt/v4.2/config/clusters`,+ params: { $limit: 100 }+ });++ if (!Array.isArray(body?.data)) return [];++ return body.data+ .map((cluster) => ({+ id: cluster.extId,+ name: cluster.name+ }))+ .filter((c) => c.id && c.name);+ }+ );+ } catch (error: unknown) {+ if (error instanceof BadRequestError) throw error;+ throw new BadRequestError({+ message: `Failed to fetch Nutanix clusters: ${error instanceof Error ? error.message : "verify credentials and that Prism Central is reachable"}`+ });+ }+};diff --git a/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-schemas.ts b/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-schemas.tsnew file mode 100644index 0000000000..21a6a757ed--- /dev/null+++ b/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-schemas.ts@@ -0,0 +1,129 @@+import z from "zod";++import { AppConnections } from "@app/lib/api-docs";+import { AppConnection } from "@app/services/app-connection/app-connection-enums";+import {+ BaseAppConnectionSchema,+ GenericCreateAppConnectionFieldsSchema,+ GenericUpdateAppConnectionFieldsSchema+} from "@app/services/app-connection/app-connection-schemas";++import { APP_CONNECTION_NAME_MAP } from "../app-connection-maps";+import { NutanixPrismCentralConnectionMethod } from "./nutanix-prism-central-connection-enums";++const BaseHostSchema = z.object({+ hostname: z+ .string()+ .trim()+ .min(1, "Hostname is required")+ .max(512, "Hostname cannot exceed 512 characters")+ .refine(+ (val) =>+ !val.includes("/") && !val.includes("@") && !val.includes("?") && !val.includes(":") && !val.includes("#"),+ {+ message: "Hostname must not contain /, @, ?, :, or # characters"+ }+ ),+ port: z.number().int().min(1).max(65535).optional(),+ sslRejectUnauthorized: z.boolean().optional(),+ sslCertificate: z+ .string()+ .trim()+ .transform((value) => value || undefined)+ .optional()+});++export const NutanixPrismCentralApiKeyCredentialsSchema = BaseHostSchema.extend({+ apiKey: z+ .string()+ .trim()+ .regex(/^[0-9a-f]{32}$/, "API key must be a 32-character lowercase hexadecimal string")+});++export const NutanixPrismCentralBasicAuthCredentialsSchema = BaseHostSchema.extend({+ username: z.string().trim().min(1, "Username is required").max(256, "Username cannot exceed 256 characters"),+ password: z.string().trim().min(1, "Password is required").max(512, "Password cannot exceed 512 characters")+});++const BaseNutanixPrismCentralConnectionSchema = BaseAppConnectionSchema.extend({+ app: z.literal(AppConnection.NutanixPrismCentral)+});++export const NutanixPrismCentralConnectionSchema = z.discriminatedUnion("method", [+ BaseNutanixPrismCentralConnectionSchema.extend({+ method: z.literal(NutanixPrismCentralConnectionMethod.ApiKey),+ credentials: NutanixPrismCentralApiKeyCredentialsSchema+ }),+ BaseNutanixPrismCentralConnectionSchema.extend({+ method: z.literal(NutanixPrismCentralConnectionMethod.BasicAuth),+ credentials: NutanixPrismCentralBasicAuthCredentialsSchema+ })+]);++export const SanitizedNutanixPrismCentralConnectionSchema = z.discriminatedUnion("method", [+ BaseNutanixPrismCentralConnectionSchema.extend({+ method: z.literal(NutanixPrismCentralConnectionMethod.ApiKey),+ credentials: NutanixPrismCentralApiKeyCredentialsSchema.pick({+ hostname: true,+ port: true,+ sslRejectUnauthorized: true,+ sslCertificate: true+ })+ }).describe(JSON.stringify({ title: `${APP_CONNECTION_NAME_MAP[AppConnection.NutanixPrismCentral]} (API Key)` })),+ BaseNutanixPrismCentralConnectionSchema.extend({+ method: z.literal(NutanixPrismCentralConnectionMethod.BasicAuth),+ credentials: NutanixPrismCentralBasicAuthCredentialsSchema.pick({+ hostname: true,+ port: true,+ username: true,+ sslRejectUnauthorized: true,+ sslCertificate: true+ })+ }).describe(JSON.stringify({ title: `${APP_CONNECTION_NAME_MAP[AppConnection.NutanixPrismCentral]} (Basic Auth)` }))+]);++export const ValidateNutanixPrismCentralConnectionCredentialsSchema = z.discriminatedUnion("method", [+ z.object({+ method: z+ .literal(NutanixPrismCentralConnectionMethod.ApiKey)+ .describe(AppConnections.CREATE(AppConnection.NutanixPrismCentral).method),+ credentials: NutanixPrismCentralApiKeyCredentialsSchema.describe(+ AppConnections.CREATE(AppConnection.NutanixPrismCentral).credentials+ )+ }),+ z.object({+ method: z+ .literal(NutanixPrismCentralConnectionMethod.BasicAuth)+ .describe(AppConnections.CREATE(AppConnection.NutanixPrismCentral).method),+ credentials: NutanixPrismCentralBasicAuthCredentialsSchema.describe(+ AppConnections.CREATE(AppConnection.NutanixPrismCentral).credentials+ )+ })+]);++export const CreateNutanixPrismCentralConnectionSchema = ValidateNutanixPrismCentralConnectionCredentialsSchema.and(+ GenericCreateAppConnectionFieldsSchema(AppConnection.NutanixPrismCentral, {+ supportsGateways: true+ })+);++export const UpdateNutanixPrismCentralConnectionSchema = z+ .object({+ credentials: z+ .union([NutanixPrismCentralApiKeyCredentialsSchema, NutanixPrismCentralBasicAuthCredentialsSchema])+ .optional()+ .describe(AppConnections.UPDATE(AppConnection.NutanixPrismCentral).credentials)+ })+ .and(+ GenericUpdateAppConnectionFieldsSchema(AppConnection.NutanixPrismCentral, {+ supportsGateways: true+ })+ );++export const NutanixPrismCentralConnectionListItemSchema = z+ .object({+ name: z.literal("Nutanix Prism Central"),+ app: z.literal(AppConnection.NutanixPrismCentral),+ methods: z.nativeEnum(NutanixPrismCentralConnectionMethod).array()+ })+ .describe(JSON.stringify({ title: APP_CONNECTION_NAME_MAP[AppConnection.NutanixPrismCentral] }));diff --git a/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-service.ts b/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-service.tsnew file mode 100644index 0000000000..8ea9ca38e2--- /dev/null+++ b/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-service.ts@@ -0,0 +1,47 @@+import { TGatewayPoolServiceFactory } from "@app/ee/services/gateway-pool/gateway-pool-service";+import { TGatewayV2ServiceFactory } from "@app/ee/services/gateway-v2/gateway-v2-service";+import { OrgServiceActor } from "@app/lib/types";+import { AppConnection } from "@app/services/app-connection/app-connection-enums";++import { listNutanixClusters } from "./nutanix-prism-central-connection-fns";+import {+ TNutanixPrismCentralConnection,+ TNutanixPrismCentralConnectionConfig+} from "./nutanix-prism-central-connection-types";++type TGetAppConnectionFunc = (+ app: AppConnection,+ connectionId: string,+ actor: OrgServiceActor+) => Promise<TNutanixPrismCentralConnection>;++export const nutanixPrismCentralConnectionService = (+ getAppConnection: TGetAppConnectionFunc,+ gatewayV2Service?: Pick<TGatewayV2ServiceFactory, "getPlatformConnectionDetailsByGatewayId">,+ gatewayPoolService?: Pick<TGatewayPoolServiceFactory, "resolveEffectiveGatewayId">+) => {+ const listClusters = async (+ { connectionId }: { connectionId: string },+ actor: OrgServiceActor+ ): Promise<{ id: string; name: string }[]> => {+ const appConnection = await getAppConnection(AppConnection.NutanixPrismCentral, connectionId, actor);+ const effectiveGatewayId = gatewayPoolService+ ? await gatewayPoolService.resolveEffectiveGatewayId({+ gatewayId: appConnection.gatewayId,+ gatewayPoolId: appConnection.gatewayPoolId+ })+ : (appConnection.gatewayId ?? null);++ return listNutanixClusters(+ {+ ...appConnection,+ gatewayId: effectiveGatewayId,+ gatewayPoolId: null,+ orgId: actor.orgId+ } as TNutanixPrismCentralConnectionConfig,+ gatewayV2Service+ );+ };++ return { listClusters };+};diff --git a/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-types.ts b/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-types.tsnew file mode 100644index 0000000000..2c6fe175d0--- /dev/null+++ b/backend/src/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-types.ts@@ -0,0 +1,26 @@+import z from "zod";++import { DiscriminativePick } from "@app/lib/types";++import { AppConnection } from "../app-connection-enums";+import {+ CreateNutanixPrismCentralConnectionSchema,+ NutanixPrismCentralConnectionSchema,+ ValidateNutanixPrismCentralConnectionCredentialsSchema+} from "./nutanix-prism-central-connection-schemas";++export type TNutanixPrismCentralConnection = z.infer<typeof NutanixPrismCentralConnectionSchema>;++export type TNutanixPrismCentralConnectionInput = z.infer<typeof CreateNutanixPrismCentralConnectionSchema> & {+ app: AppConnection.NutanixPrismCentral;+};++export type TValidateNutanixPrismCentralConnectionCredentialsSchema =+ typeof ValidateNutanixPrismCentralConnectionCredentialsSchema;++export type TNutanixPrismCentralConnectionConfig = DiscriminativePick<+ TNutanixPrismCentralConnectionInput,+ "method" | "app" | "credentials" | "gatewayId" | "gatewayPoolId"+> & {+ orgId: string;+};diff --git a/backend/src/services/pki-sync/nutanix-prism-central/index.ts b/backend/src/services/pki-sync/nutanix-prism-central/index.tsnew file mode 100644index 0000000000..2b221e8ddd--- /dev/null+++ b/backend/src/services/pki-sync/nutanix-prism-central/index.ts@@ -0,0 +1,4 @@+export * from "./nutanix-prism-central-pki-sync-constants";+export * from "./nutanix-prism-central-pki-sync-fns";+export * from "./nutanix-prism-central-pki-sync-schemas";+export * from "./nutanix-prism-central-pki-sync-types";diff --git a/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-constants.ts b/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-constants.tsnew file mode 100644index 0000000000..aca2dc69a2--- /dev/null+++ b/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-constants.ts@@ -0,0 +1,11 @@+import { AppConnection } from "@app/services/app-connection/app-connection-enums";+import { PkiSync } from "@app/services/pki-sync/pki-sync-enums";++export const NUTANIX_PRISM_CENTRAL_PKI_SYNC_LIST_OPTION = {+ name: "Nutanix Prism Central" as const,+ connection: AppConnection.NutanixPrismCentral,+ destination: PkiSync.NutanixPrismCentral,+ canImportCertificates: false,+ canRemoveCertificates: false,+ maxCertificates: 1+} as const;diff --git a/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-fns.test.ts b/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-fns.test.tsnew file mode 100644index 0000000000..1f4b62c063--- /dev/null+++ b/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-fns.test.ts@@ -0,0 +1,133 @@+import { inferPrivateKeyAlgorithm } from "./nutanix-prism-central-pki-sync-fns";++// Self-signed test fixtures (CN=test.example.com), one per key type.+const RSA_2048_CERT = `-----BEGIN CERTIFICATE-----+MIIDFzCCAf+gAwIBAgIUDqpI0Zx8l2MdDtty5rF6ou54cl8wDQYJKoZIhvcNAQEL+BQAwGzEZMBcGA1UEAwwQdGVzdC5leGFtcGxlLmNvbTAeFw0yNjA3MTIyMzQ2NTha+Fw0yNjA4MTEyMzQ2NThaMBsxGTAXBgNVBAMMEHRlc3QuZXhhbXBsZS5jb20wggEi+MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpB1rvOeqnjUyUeWWeFAVVymUa+ze2gCxnqYhOQG7t/PVKut9LcJOu3yYmGIaV8wRvbE8xnWv6RSgHuXbgziemZfrI9+LIuD5fUsnlTzfhBwQkGCgDV0DYYlMb0f/B8oRWmDKHn3Zejh5b+fpwe41tgPuBnE+jW7L0gb/CtsHsr7QpkZewuz+g2pGgzbI4syPo2nBBjqrv3dfCTexuGFsBeZD0OIO+4dlArQbpKrbm7wcXi0sdVT8veepcXlnU8Qif/sd78wcdKuGQJZIHWMTZlcMiveBB+phiQDGhkYzQZEq7HSMkd6Dgfclgn1f/hc1N326B8kXZjkciFlRybKenMcK8rAgMB+AAGjUzBRMB0GA1UdDgQWBBREK/Jx0N6wDougrnOq3ifqOODIJTAfBgNVHSMEGDAW+gBREK/Jx0N6wDougrnOq3ifqOODIJTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3+DQEBCwUAA4IBAQBG+j9s+BUfhHv9JkZ/x6AVonE9PvWv25kaZljriktpox6J0aMU+blPmgouMcrOsr5kfRIb3JwN4M+hB8QerehRycoH7dyYwLRTZZMPVBTRCu8Ce9QJ6+Otr88IlSE49AeEPsEEYeVlL05aZTjR7x6k3z3QPE8FmiH5nElF9+u+TpVFEbryUv+64ML4anl+Dxagzpbtvq9vC8hrzO0GdY2ECifH/du87jXQwWnfXIbIM0xaBawTg3s+g71pOhA9HR15UmiIzm6wdePL0l6Cco8aPqjNnt1bx+VME+o0GlfKUfi67hm0R7vN+HuaFiqKa4+S/hnc9Ke43tW6iaZX6LzTruKRE+-----END CERTIFICATE-----`;++const RSA_4096_CERT = `-----BEGIN CERTIFICATE-----+MIIFFzCCAv+gAwIBAgIUbl0TxmCEMfEYIgbdf9e57hh8jlQwDQYJKoZIhvcNAQEL+BQAwGzEZMBcGA1UEAwwQdGVzdC5leGFtcGxlLmNvbTAeFw0yNjA3MTIyMzQ2NTha+Fw0yNjA4MTEyMzQ2NThaMBsxGTAXBgNVBAMMEHRlc3QuZXhhbXBsZS5jb20wggIi+MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCeToJ8dUJOYJlXmc1rlJ4RSr8e+hhwNKhCTujm/rXGkOMW1Hlgt+MOSqSFbrakw++eE3Ljq1tE1d2TMZuuS/kAgQq01+eXKe0glkc9Djh6TismRbTUfT5rDvf14IdS16aeq/Il2RqeXoYsFM6ar9PhDELXFI+a7lcUlbTEPGUnGpI2PvbdrF0nahn3OpGr2hXWX4s4IWoKzKkNcoSovK6r+ioKNgR+94L2htxURNe1IQrIFd2tGFCaw8s9PlJ7pnpqVNFj6SGgPZHbljSI+1WfCkNNX+Zy+7uBCTBnLeNuHb7fRJvYpgO+8eUGwoktC23JCan1dxO49WjRnQ6Z3O+I4TFaHJn2q+5hxjorcUGKWMy3skBs8ydGhEI2ayTqmcl2u3tudyR8Xm1fiuHEL7ZCb/eL8lApUV+QtQ/lyNBYRgRRWmAZZxKxcxYKIKl2oIixTy6kSkVjBxoAv/Lqqavrs7C8xYTXTZj+aiwAW4eIb8Vs8qA6xh7cj2/VNNgBLZK0ii4+GitQAFYCZU26vSeNThvnj1reeWTz+WZ1O07Rhwl0Q8JHy3CqmqTwjRw4oQ6tn01FcI1Jh4WpFeEjtdhkjDBKxLWpxS0fS+IWzCkqsHydTXo/x25dQatiziO47OMdcQ6eZtgQcKNn8wt5KIyKlzZqHNaGVRyleM+3KZRdY5PnKgPM591dQIDAQABo1MwUTAdBgNVHQ4EFgQUSkOVw+77mOm2SdOquy3P+lwDaqSUwHwYDVR0jBBgwFoAUSkOVw+77mOm2SdOquy3PlwDaqSUwDwYDVR0TAQH/+BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAZM6ImsUgqjZ+F6dlz2ZLPFyBt0zW+1h4PRWR2zk6bTH3flpQneXskFu7ibi04wyXB+vO32WwNkQxYEqv2hpUE3etrtcmE+NUhAWMFEiOwiLF1gCTvvQCGkmb5IBDK8Qh+3O5Rd0jAsfzw6AWnh/3TCgpw8tdAB+5KWx4vYkBVQfPbItFKfWHP19vf+bFfAGSbqYLAMTXtvSrBAjyEo/WILO8E63zIql+/j6aToszuA/Vw3iCGScvb3LYyxkIhZM5kBHO9jVSKy0puMDDPpTODkBGWVhbRej7+ts7p2h3/GDS77cazv/O5P+z2Vlt+AvVe7PyVBVSsXH8tvlEMs5b/zAC/7WSxLseL+GlqrQRKvg9obG39InAZRYRb3Id80z2F6YyezJc2UViyzSwq0ybCLK7vWTsFmjTJ3++LhZEup48eTd8u2z5/YVzguE8ge2xMsYWaWsBF9XxwYegT9nQgrLMN2N75ZO0kr1+IHM/Ul/x5jqlszBZrwIbZGQu1UD3kKfluVan3Bfya5EFcpY0Vg2Vo9IKh8CAHacN++WLCZjYG75foVKY0xI6pNMlPEg73kgx7Jq0Z1H6R+sabimmBEUnAenG446daXt8b+B+c7KG+/8aNNBogYnQ2iZ0mU/qquPeyqujuFnKmIFHrhFrmgs4vGQEZYwBzEicQc+JxJdJb5aXCjQ+Qs=+-----END CERTIFICATE-----`;++const ECDSA_P256_CERT = `-----BEGIN CERTIFICATE-----+MIIBjDCCATGgAwIBAgIUCXOa685pmbwZ/s2yaGhJF/jp8RIwCgYIKoZIzj0EAwIw+GzEZMBcGA1UEAwwQdGVzdC5leGFtcGxlLmNvbTAeFw0yNjA3MTIyMzQ2NThaFw0y+NjA4MTEyMzQ2NThaMBsxGTAXBgNVBAMMEHRlc3QuZXhhbXBsZS5jb20wWTATBgcq+hkjOPQIBBggqhkjOPQMBBwNCAATiSy976SW4PBRYlBOU07spBPyQo+L+WOaUaZna+qkoetRZKMg6wR2dKa0knfD0gm4frVC4LzoWp1pwuc1p7OmiJo1MwUTAdBgNVHQ4E+FgQU6l1hlXztvbJCrU+pN9OI9lWjpyMwHwYDVR0jBBgwFoAU6l1hlXztvbJCrU+p+N9OI9lWjpyMwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAgNJADBGAiEAryu7+frjQzqCjKxzSZ6Gza+Y8B7IiMh84WCVyzVAycUICIQCUjOCBXpEamDoqu7ZlX2ot+3liltK7qQadO0N+Jy4ULPQ==+-----END CERTIFICATE-----`;++const ECDSA_P384_CERT = `-----BEGIN CERTIFICATE-----+MIIByDCCAU6gAwIBAgIUDHBaOqjb83DG5qvvL51UCtyqOOkwCgYIKoZIzj0EAwIw+GzEZMBcGA1UEAwwQdGVzdC5leGFtcGxlLmNvbTAeFw0yNjA3MTIyMzQ2NThaFw0y+NjA4MTEyMzQ2NThaMBsxGTAXBgNVBAMMEHRlc3QuZXhhbXBsZS5jb20wdjAQBgcq+hkjOPQIBBgUrgQQAIgNiAAQzDte65Oc/gbSWloqxZYTjnL0NRJ/5652t6/XFK0mM+cq94BskfVrO/bo9WKxmRyAnIxcoJfrfC8MVqrOu5YcIcHLk8gKF9CHHHkBtZkSap+dmRjJ3XvIQW12JJuyUf7IAGjUzBRMB0GA1UdDgQWBBRXHC9AkU+uMB+wl8VWCsjU+6Dm9+zAfBgNVHSMEGDAWgBRXHC9AkU+uMB+wl8VWCsjU6Dm9+zAPBgNVHRMBAf8E+BTADAQH/MAoGCCqGSM49BAMCA2gAMGUCMGbj7HKNjOSL8JVCz/9TgaBxIGJqfHtf+dKpNs6FWts4sGPBvSk0INt83fjcMPUHmZQIxAIN6OBJvmO4RYahdgLEGHJfPurFk+UbXqfKTdWeP2EZFlB6hEi94AuEQMOizmxiFG4w==+-----END CERTIFICATE-----`;++const ECDSA_P521_CERT = `-----BEGIN CERTIFICATE-----+MIICEzCCAXSgAwIBAgIUZeyOdA6HBTjbtINNJ0NHh7cYH30wCgYIKoZIzj0EAwIw+GzEZMBcGA1UEAwwQdGVzdC5leGFtcGxlLmNvbTAeFw0yNjA3MTIyMzQ2NThaFw0y+NjA4MTEyMzQ2NThaMBsxGTAXBgNVBAMMEHRlc3QuZXhhbXBsZS5jb20wgZswEAYH+KoZIzj0CAQYFK4EEACMDgYYABAGQrGhyaNm2FI74xdUoG361wuFXQvwV3HrfGbmQ+tbvmKr9D3QMfug8R+7jl/MZFmEUVUcL0bdidHrlqjvEqMQpeSgBLvDsPUaGe2cR++conyhEaM5/w5J1qIlWflyIi55TeTHdtcpMxF/recTWZV/JE/NLKjjqBEfyJdHsJw+deH8Re4GZ6NTMFEwHQYDVR0OBBYEFGaUoY30ZgpwjREIBlDWfs3fwZxNMB8GA1Ud+IwQYMBaAFGaUoY30ZgpwjREIBlDWfs3fwZxNMA8GA1UdEwEB/wQFMAMBAf8wCgYI+KoZIzj0EAwIDgYwAMIGIAkIBb8EddmsEE/WyzXhG6J/bV+JmUOxndXvOFdyeuALD+LsERjoyuukzlEgiCqBUK4pIH+/yGvX9ioYMj/0hXbmKXQwgCQgExK3TnUEP3/PlB+Y4ci4qdqKxCFlfpVH9CW9xQzL/UtTSDK7ySNLUFnw7/61yy0gIpiPvja1X7P7JBW+KakO8G+LBA==+-----END CERTIFICATE-----`;++const ED25519_CERT = `-----BEGIN CERTIFICATE-----+MIIBSjCB/aADAgECAhQbvHVc+sN1qwnparoPZxQG8W0vlDAFBgMrZXAwGzEZMBcG+A1UEAwwQdGVzdC5leGFtcGxlLmNvbTAeFw0yNjA3MTIyMzQ2NThaFw0yNjA4MTEy+MzQ2NThaMBsxGTAXBgNVBAMMEHRlc3QuZXhhbXBsZS5jb20wKjAFBgMrZXADIQCS+YloLs5kerImWCnUqLDe7BKfkzyHhVIwGrpJUANxmVKNTMFEwHQYDVR0OBBYEFDCX+74yjKLKzr4bdY3vNVT9MWO1/MB8GA1UdIwQYMBaAFDCX74yjKLKzr4bdY3vNVT9M+WO1/MA8GA1UdEwEB/wQFMAMBAf8wBQYDK2VwA0EAGs70evkONrhGHprInx3+7XDr+Xzl4HDUUfphE2Rge6DSszFZsHEnW50xI9yAYxKgypLpSUScj04Z2yvbMLRrZDA==+-----END CERTIFICATE-----`;++describe("Nutanix Prism Central inferPrivateKeyAlgorithm", () => {+ test("detects RSA 2048", () => {+ expect(inferPrivateKeyAlgorithm(RSA_2048_CERT)).toBe("RSA_2048");+ });++ test("detects RSA 4096", () => {+ expect(inferPrivateKeyAlgorithm(RSA_4096_CERT)).toBe("RSA_4096");+ });++ test("detects ECDSA P-256", () => {+ expect(inferPrivateKeyAlgorithm(ECDSA_P256_CERT)).toBe("ECDSA_256");+ });++ test("detects ECDSA P-384", () => {+ expect(inferPrivateKeyAlgorithm(ECDSA_P384_CERT)).toBe("ECDSA_384");+ });++ test("detects ECDSA P-521", () => {+ expect(inferPrivateKeyAlgorithm(ECDSA_P521_CERT)).toBe("ECDSA_521");+ });++ test("rejects algorithms Nutanix does not support (Ed25519)", () => {+ expect(() => inferPrivateKeyAlgorithm(ED25519_CERT)).toThrow(/not supported by Nutanix Prism Central/);+ });++ test("rejects unparseable certificate content", () => {+ expect(() => inferPrivateKeyAlgorithm("not a certificate")).toThrow(/Failed to parse certificate/);+ });+});diff --git a/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-fns.ts b/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-fns.tsnew file mode 100644index 0000000000..31604acf81--- /dev/null+++ b/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-fns.ts@@ -0,0 +1,360 @@+/* eslint-disable no-await-in-loop */+import * as x509 from "@peculiar/x509";+import { AxiosError } from "axios";++import { TGatewayPoolServiceFactory } from "@app/ee/services/gateway-pool/gateway-pool-service";+import { TGatewayV2ServiceFactory } from "@app/ee/services/gateway-v2/gateway-v2-service";+import { logger } from "@app/lib/logger";+import { NutanixPrismCentralConnectionMethod } from "@app/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-enums";+import {+ executeNutanixOperationWithGateway,+ NUTANIX_DEFAULT_PORT+} from "@app/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-fns";+import { TNutanixPrismCentralConnection } from "@app/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-types";+import { TCertificateDALFactory } from "@app/services/certificate/certificate-dal";+import { TCertificateSyncDALFactory } from "@app/services/certificate-sync/certificate-sync-dal";+import { CertificateSyncStatus } from "@app/services/certificate-sync/certificate-sync-enums";+import { TCertificateMap } from "@app/services/pki-sync/pki-sync-types";++import { PkiSyncError } from "../pki-sync-errors";+import { TPkiSyncWithCredentials } from "../pki-sync-types";+import { TNutanixPrismCentralPkiSyncConfig } from "./nutanix-prism-central-pki-sync-types";++type TNutanixCredentials = TNutanixPrismCentralConnection["credentials"];++type TNutanixPrismCentralPkiSyncFactoryDeps = {+ certificateSyncDAL: Pick<+ TCertificateSyncDALFactory,+ "findByPkiSyncAndCertificate" | "updateById" | "addCertificates" | "updateSyncStatus" | "removeCertificates"+ >;+ certificateDAL: Pick<TCertificateDALFactory, "findById">;+ gatewayV2Service?: Pick<TGatewayV2ServiceFactory, "getPlatformConnectionDetailsByGatewayId">;+ gatewayPoolService?: Pick<TGatewayPoolServiceFactory, "resolveEffectiveGatewayId">;+};++const getNutanixCredentials = (pkiSync: TPkiSyncWithCredentials): TNutanixCredentials => {+ const credentials = pkiSync.connection.credentials as TNutanixCredentials;+ if (!credentials?.hostname) {+ throw new PkiSyncError({+ shouldRetry: false,+ message: "Nutanix Prism Central credentials (hostname) not found in connection credentials"+ });+ }+ return credentials;+};++// Values from the Nutanix clustermgmt v4 PrivateKeyAlgorithm enum+const NUTANIX_SUPPORTED_ALGORITHMS = ["RSA_2048", "RSA_4096", "ECDSA_256", "ECDSA_384", "ECDSA_521"] as const;+type NutanixKeyAlgorithm = (typeof NUTANIX_SUPPORTED_ALGORITHMS)[number];++export const inferPrivateKeyAlgorithm = (certPem: string): NutanixKeyAlgorithm => {+ let detected: string | undefined;++ try {+ const cert = new x509.X509Certificate(certPem);+ const alg = cert.publicKey.algorithm;++ if (alg.name === "RSASSA-PKCS1-v1_5" || alg.name === "RSA-PSS" || alg.name === "RSAES-PKCS1-v1_5") {+ const rsaAlg = alg as { modulusLength?: number };+ const bits = rsaAlg.modulusLength;+ if (bits === 2048) detected = "RSA_2048";+ else if (bits === 4096) detected = "RSA_4096";+ else detected = `RSA_${bits ?? "unknown"}`;+ } else if (alg.name === "ECDSA" || alg.name === "EC") {+ const ecAlg = alg as { namedCurve?: string };+ const curve = ecAlg.namedCurve ?? "";+ if (curve.includes("256") || curve.includes("P-256")) detected = "ECDSA_256";+ else if (curve.includes("384") || curve.includes("P-384")) detected = "ECDSA_384";+ else if (curve.includes("521") || curve.includes("P-521")) detected = "ECDSA_521";+ else detected = `ECDSA_${curve || "unknown"}`;+ } else {+ detected = alg.name;+ }+ } catch (err) {+ throw new PkiSyncError({+ shouldRetry: false,+ message: `Failed to parse certificate to determine key algorithm: ${err instanceof Error ? err.message : String(err)}`+ });+ }++ if (!detected || !(NUTANIX_SUPPORTED_ALGORITHMS as readonly string[]).includes(detected)) {+ throw new PkiSyncError({+ shouldRetry: false,+ message: `Certificate uses key algorithm "${detected}" which is not supported by Nutanix Prism Central. Supported algorithms: ${NUTANIX_SUPPORTED_ALGORITHMS.join(", ")}`+ });+ }++ return detected as NutanixKeyAlgorithm;+};++const pemToNutanixFormat = (pem: string): string => Buffer.from(pem.trim()).toString("base64");++const POLL_INTERVAL_MS = 3000;+const MAX_POLL_ATTEMPTS = 20;++export const nutanixPrismCentralPkiSyncFactory = ({+ certificateSyncDAL,+ certificateDAL,+ gatewayV2Service,+ gatewayPoolService+}: TNutanixPrismCentralPkiSyncFactoryDeps) => {+ const resolveGateway = async (pkiSync: TPkiSyncWithCredentials) => {+ return gatewayPoolService+ ? gatewayPoolService.resolveEffectiveGatewayId({+ gatewayId: pkiSync.connection.gatewayId,+ gatewayPoolId: pkiSync.connection.gatewayPoolId+ })+ : (pkiSync.connection.gatewayId ?? null);+ };++ const syncCertificates = async (pkiSync: TPkiSyncWithCredentials, certificateMap: TCertificateMap) => {+ const credentials = getNutanixCredentials(pkiSync);+ const destinationConfig = pkiSync.destinationConfig as TNutanixPrismCentralPkiSyncConfig;+ const { clusterId } = destinationConfig;++ if (!clusterId) {+ throw new PkiSyncError({ shouldRetry: false, message: "Nutanix cluster ID is required in destination config" });+ }++ const certEntries = Object.entries(certificateMap);+ if (certEntries.length === 0) {+ return { uploaded: 0, skipped: 0 };+ }++ const sortedEntries = [...certEntries].sort(([, a], [, b]) => {+ try {+ const certA = new x509.X509Certificate(a.cert);+ const certB = new x509.X509Certificate(b.cert);+ return certB.notAfter.getTime() - certA.notAfter.getTime();+ } catch {+ return 0;+ }+ });++ const [certName, { cert, privateKey, certificateChain, certificateId }] = sortedEntries[0];+ const skipped = certEntries.length - 1;++ // Nutanix has one certificate slot per cluster; only the newest certificate is uploaded+ const skippedCertificates = sortedEntries.slice(1).map(([name]) => ({+ name,+ reason: "Only the newest certificate is synced to the Nutanix Prism Central cluster certificate slot"+ }));++ if (sortedEntries.length > 1) {+ logger.info(+ { syncId: pkiSync.id, chosen: certName, totalCerts: certEntries.length },+ `Nutanix Prism Central PKI sync [syncId=${pkiSync.id}]: multiple certificates found, selected newest [certName=${certName}]`+ );+ }++ if (!cert || !cert.includes("-----BEGIN CERTIFICATE-----")) {+ return {+ uploaded: 0,+ skipped: certEntries.length,+ details: {+ skippedCertificates: [+ { name: certName, reason: "Certificate is missing or not in valid PEM format" },+ ...skippedCertificates+ ]+ }+ };+ }++ if (!privateKey || !privateKey.includes("-----BEGIN")) {+ return {+ uploaded: 0,+ skipped: certEntries.length,+ details: {+ skippedCertificates: [+ { name: certName, reason: "Private key is missing or not in valid PEM format" },+ ...skippedCertificates+ ]+ }+ };+ }++ const { hostname, port: credPort } = credentials;+ const port = credPort ?? NUTANIX_DEFAULT_PORT;+ const baseUrl = `https://${hostname}:${port}`;+ const gatewayId = await resolveGateway(pkiSync);++ try {+ const algo = inferPrivateKeyAlgorithm(cert);++ logger.info(+ { syncId: pkiSync.id, certName, algo, clusterId },+ `Nutanix Prism Central PKI sync [syncId=${pkiSync.id}]: uploading certificate [certName=${certName}] [clusterId=${clusterId}]`+ );++ await executeNutanixOperationWithGateway(+ {+ gatewayId,+ credentials,+ method: pkiSync.connection.method as NutanixPrismCentralConnectionMethod+ },+ gatewayV2Service,+ async (makeRequest) => {+ const clusterPath = encodeURIComponent(clusterId);++ // the ETag response header is required as If-Match on the subsequent PUT+ const getResponse = await makeRequest<unknown>({+ method: "GET",+ url: `${baseUrl}/api/clustermgmt/v4.2/config/clusters/${clusterPath}/ssl-certificate`+ });++ const { etag } = getResponse.headers;++ logger.info(+ { syncId: pkiSync.id, clusterId, hasEtag: Boolean(etag) },+ `Nutanix Prism Central PKI sync [syncId=${pkiSync.id}]: fetched current SSL certificate for ETag [clusterId=${clusterId}]`+ );++ const sslCertBody: Record<string, unknown> = {+ privateKeyAlgorithm: algo,+ privateKey: pemToNutanixFormat(privateKey),+ publicCertificate: pemToNutanixFormat(cert),+ $objectType: "clustermgmt.v4.config.SSLCertificate",+ $reserved: { $fv: "v4.r2" }+ };++ if (certificateChain) {+ sslCertBody.caChain = pemToNutanixFormat(certificateChain);+ }++ type TUpdateResponse = {+ data: {+ extId?: string;+ };+ };++ const { data: updateBody } = await makeRequest<TUpdateResponse>({+ method: "PUT",+ url: `${baseUrl}/api/clustermgmt/v4.2/config/clusters/${clusterPath}/ssl-certificate`,+ headers: {+ "Content-Type": "application/json",+ ...(etag ? { "If-Match": etag } : {})+ },+ data: sslCertBody+ });++ const taskExtId = updateBody?.data?.extId;++ logger.info(+ { syncId: pkiSync.id, clusterId, taskExtId },+ `Nutanix Prism Central PKI sync [syncId=${pkiSync.id}]: certificate update task queued [taskExtId=${taskExtId}]`+ );++ if (taskExtId) {+ let lastPollError: unknown;++ for (let attempt = 0; attempt < MAX_POLL_ATTEMPTS; attempt += 1) {+ await new Promise<void>((resolve) => {+ setTimeout(resolve, POLL_INTERVAL_MS);+ });++ try {+ type TTaskResponse = {+ data: {+ status?: string;+ errorDetails?: unknown[];+ };+ };++ const { data: taskBody } = await makeRequest<TTaskResponse>({+ method: "GET",+ url: `${baseUrl}/api/prism/v4.0/config/tasks/${encodeURIComponent(taskExtId)}`+ });++ lastPollError = undefined;+ const status = taskBody?.data?.status;++ logger.debug(+ { syncId: pkiSync.id, taskExtId, status, attempt },+ `Nutanix Prism Central PKI sync [syncId=${pkiSync.id}]: polling task status [taskExtId=${taskExtId}]`+ );++ if (status === "SUCCEEDED") return;++ if (status === "FAILED" || status === "CANCELED" || status === "ABORTED") {+ const details = JSON.stringify(taskBody?.data?.errorDetails ?? []);+ throw new PkiSyncError({+ shouldRetry: false,+ message: `Nutanix certificate update task ${taskExtId} failed with status ${status}: ${details}`+ });+ }+ } catch (err) {+ if (err instanceof PkiSyncError) throw err;+ lastPollError = err;+ logger.warn(+ { syncId: pkiSync.id, taskExtId, err },+ `Nutanix Prism Central PKI sync [syncId=${pkiSync.id}]: transient error polling task, will retry [taskExtId=${taskExtId}]`+ );+ }+ }++ if (lastPollError) {+ throw new PkiSyncError({+ shouldRetry: false,+ message: `Failed to poll Nutanix task status for ${taskExtId} -- verify the certificate was applied in Prism Central`+ });+ }++ throw new PkiSyncError({+ shouldRetry: false,+ message: `Nutanix certificate update task ${taskExtId} did not complete within the polling window -- check Prism Central task status`+ });+ }+ }+ );++ if (certificateId) {+ const existingSyncRecord = await certificateSyncDAL.findByPkiSyncAndCertificate(pkiSync.id, certificateId);+ if (existingSyncRecord) {+ await certificateSyncDAL.updateById(existingSyncRecord.id, {+ externalIdentifier: clusterId,+ syncStatus: CertificateSyncStatus.Succeeded,+ lastSyncedAt: new Date()+ });+ } else {+ await certificateSyncDAL.addCertificates(pkiSync.id, [{ certificateId, externalIdentifier: clusterId }]);+ }++ const currentCertificate = await certificateDAL.findById(certificateId);+ if (currentCertificate?.renewedFromCertificateId) {+ await certificateSyncDAL.removeCertificates(pkiSync.id, [currentCertificate.renewedFromCertificateId]);+ }+ }++ return {+ uploaded: 1,+ skipped,+ ...(skippedCertificates.length ? { details: { skippedCertificates } } : {})+ };+ } catch (error) {+ let message = "Unknown error";+ if (error instanceof AxiosError) {+ message = String((error.response?.data as { message?: string })?.message || error.message);+ } else if (error instanceof Error) {+ message = error.message;+ }++ if (certificateId) {+ await certificateSyncDAL.updateSyncStatus(+ pkiSync.id,+ certificateId,+ CertificateSyncStatus.Failed,+ `Failed to upload certificate to Nutanix cluster ${clusterId}: ${message}`+ );+ }++ if (error instanceof PkiSyncError) throw error;++ throw new PkiSyncError({+ message: `Failed to upload certificate to Nutanix Prism Central cluster ${clusterId}: ${message}`,+ cause: error instanceof Error ? error : undefined+ });+ }+ };++ return { syncCertificates };+};diff --git a/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-schemas.ts b/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-schemas.tsnew file mode 100644index 0000000000..6af3c2c8d8--- /dev/null+++ b/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-schemas.ts@@ -0,0 +1,56 @@+import { z } from "zod";++import { openApiHidden } from "@app/server/lib/schemas";+import { AppConnection } from "@app/services/app-connection/app-connection-enums";+import { PkiSync } from "@app/services/pki-sync/pki-sync-enums";+import { PkiSyncSchema } from "@app/services/pki-sync/pki-sync-schemas";++export const NutanixPrismCentralPkiSyncConfigSchema = z.object({+ clusterId: z.string().min(1, "Cluster ID is required"),+ clusterName: z.string().min(1, "Cluster name is required")+});++export const NutanixPrismCentralPkiSyncOptionsSchema = z.object({+ canImportCertificates: z.literal(false).default(false),+ canRemoveCertificates: z.literal(false).default(false)+});++export const NutanixPrismCentralPkiSyncSchema = PkiSyncSchema.extend({+ destination: z.literal(PkiSync.NutanixPrismCentral),+ destinationConfig: NutanixPrismCentralPkiSyncConfigSchema,+ syncOptions: NutanixPrismCentralPkiSyncOptionsSchema+});++export const CreateNutanixPrismCentralPkiSyncSchema = z.object({+ name: z.string().trim().min(1).max(256),+ description: z.string().optional(),+ isAutoSyncEnabled: z.boolean().default(true),+ destinationConfig: NutanixPrismCentralPkiSyncConfigSchema,+ syncOptions: NutanixPrismCentralPkiSyncOptionsSchema.optional().default({+ canImportCertificates: false,+ canRemoveCertificates: false+ }),+ subscriberId: z.string().nullish(),+ connectionId: z.string(),+ projectId: z.string().trim().min(1).optional().describe(openApiHidden()),+ applicationId: z.string().uuid().optional(),+ certificateIds: z.array(z.string().uuid()).optional()+});++export const UpdateNutanixPrismCentralPkiSyncSchema = z.object({+ name: z.string().trim().min(1).max(256).optional(),+ description: z.string().optional(),+ isAutoSyncEnabled: z.boolean().optional(),+ destinationConfig: NutanixPrismCentralPkiSyncConfigSchema.optional(),+ syncOptions: NutanixPrismCentralPkiSyncOptionsSchema.optional(),+ subscriberId: z.string().nullish(),+ connectionId: z.string().optional()+});++export const NutanixPrismCentralPkiSyncListItemSchema = z.object({+ name: z.literal("Nutanix Prism Central"),+ connection: z.literal(AppConnection.NutanixPrismCentral),+ destination: z.literal(PkiSync.NutanixPrismCentral),+ canImportCertificates: z.literal(false),+ canRemoveCertificates: z.literal(false)+});diff --git a/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-types.ts b/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-types.tsnew file mode 100644index 0000000000..99bfa2c47f--- /dev/null+++ b/backend/src/services/pki-sync/nutanix-prism-central/nutanix-prism-central-pki-sync-types.ts@@ -0,0 +1,22 @@+import { z } from "zod";++import { TNutanixPrismCentralConnection } from "@app/services/app-connection/nutanix-prism-central/nutanix-prism-central-connection-types";++import {+ CreateNutanixPrismCentralPkiSyncSchema,+ NutanixPrismCentralPkiSyncConfigSchema,+ NutanixPrismCentralPkiSyncSchema,+ UpdateNutanixPrismCentralPkiSyncSchema+} from "./nutanix-prism-central-pki-sync-schemas";++export type TNutanixPrismCentralPkiSyncConfig = z.infer<typeof NutanixPrismCentralPkiSyncConfigSchema>;++export type TNutanixPrismCentralPkiSync = z.infer<typeof NutanixPrismCentralPkiSyncSchema>;++export type TNutanixPrismCentralPkiSyncInput = z.infer<typeof CreateNutanixPrismCentralPkiSyncSchema>;++export type TNutanixPrismCentralPkiSyncUpdate = z.infer<typeof UpdateNutanixPrismCentralPkiSyncSchema>;++export type TNutanixPrismCentralPkiSyncWithCredentials = TNutanixPrismCentralPkiSync & {+ connection: TNutanixPrismCentralConnection;+};diff --git a/backend/src/services/pki-sync/pki-sync-enums.ts b/backend/src/services/pki-sync/pki-sync-enums.tsindex 6d05db17bd..16c1f6ce10 100644--- a/backend/src/services/pki-sync/pki-sync-enums.ts+++ b/backend/src/services/pki-sync/pki-sync-enums.ts@@ -8,7 +8,8 @@ export enum PkiSync {NetScaler = "netscaler",F5BigIp = "f5-big-ip",LinuxServer = "linux-server",- WindowsServer = "windows-server"+ WindowsServer = "windows-server",+ NutanixPrismCentral = "nutanix-prism-central"}export enum PkiSyncStatus {diff --git a/backend/src/services/pki-sync/pki-sync-fns.ts b/backend/src/services/pki-sync/pki-sync-fns.tsindex c3bbf4d4fb..5b7e09f889 100644--- a/backend/src/services/pki-sync/pki-sync-fns.ts+++ b/backend/src/services/pki-sync/pki-sync-fns.ts@@ -28,12 +28,15 @@ import { LINUX_SERVER_PKI_SYNC_LIST_OPTION } from "./linux-server/linux-server-pimport { linuxServerPkiSyncFactory } from "./linux-server/linux-server-pki-sync-fns";import { NETSCALER_PKI_SYNC_LIST_OPTION } from "./netscaler/netscaler-pki-sync-constants";import { netScalerPkiSyncFactory } from "./netscaler/netscaler-pki-sync-fns";+import { NUTANIX_PRISM_CENTRAL_PKI_SYNC_LIST_OPTION } from "./nutanix-prism-central/nutanix-prism-central-pki-sync-constants";+import { nutanixPrismCentralPkiSyncFactory } from "./nutanix-prism-central/nutanix-prism-central-pki-sync-fns";import {buildManagedCertificateNameRegexSource,SHORT_UUID_NAME_REGEX_FRAGMENT,UUID_NAME_REGEX_FRAGMENT} from "./pki-sync-certificate-name-fns";import { PkiSync } from "./pki-sync-enums";+import { PkiSyncError } from "./pki-sync-errors";import { TCertificateMap, TPkiSyncSyncResult, TPkiSyncWithCredentials } from "./pki-sync-types";import { WINDOWS_SERVER_PKI_SYNC_LIST_OPTION } from "./windows-server/windows-server-pki-sync-constants";import { windowsServerPkiSyncFactory } from "./windows-server/windows-server-pki-sync-fns";@@ -50,7 +53,8 @@ const PKI_SYNC_LIST_OPTIONS = {[PkiSync.NetScaler]: NETSCALER_PKI_SYNC_LIST_OPTION,[PkiSync.F5BigIp]: F5_BIG_IP_PKI_SYNC_LIST_OPTION,[PkiSync.LinuxServer]: LINUX_SERVER_PKI_SYNC_LIST_OPTION,- [PkiSync.WindowsServer]: WINDOWS_SERVER_PKI_SYNC_LIST_OPTION+ [PkiSync.WindowsServer]: WINDOWS_SERVER_PKI_SYNC_LIST_OPTION,+ [PkiSync.NutanixPrismCentral]: NUTANIX_PRISM_CENTRAL_PKI_SYNC_LIST_OPTION};export const enterprisePkiSyncCheck = async (@@ -84,6 +88,14 @@ export const getPkiSyncProviderCapabilities = (destination: PkiSync) => {};};+export const getPkiSyncMaxCertificates = (destination: PkiSync): number | undefined => {+ const providerOption = PKI_SYNC_LIST_OPTIONS[destination];+ if (providerOption && "maxCertificates" in providerOption) {+ return providerOption.maxCertificates;+ }+ return undefined;+};+export const matchesSchema = <T extends ZodSchema>(schema: T, data: unknown): data is z.infer<T> => {return schema.safeParse(data).success;};@@ -172,6 +184,11 @@ export const PkiSyncFns = {case PkiSync.WindowsServer: {throw new Error("Windows Server does not support importing certificates into Infisical");}+ case PkiSync.NutanixPrismCentral: {+ throw new Error(+ "Nutanix Prism Central does not support importing certificates into Infisical (private keys cannot be extracted)"+ );+ }default:throw new Error(`Unsupported PKI sync destination: ${String(pkiSync.destination)}`);}@@ -285,6 +302,16 @@ export const PkiSyncFns = {});return windowsServerPkiSync.syncCertificates(pkiSync, certificateMap);}+ case PkiSync.NutanixPrismCentral: {+ checkPkiSyncDestination(pkiSync, PkiSync.NutanixPrismCentral as PkiSync);+ const nutanixPkiSync = nutanixPrismCentralPkiSyncFactory({+ certificateDAL: dependencies.certificateDAL,+ certificateSyncDAL: dependencies.certificateSyncDAL,+ gatewayV2Service: dependencies.gatewayV2Service,+ gatewayPoolService: dependencies.gatewayPoolService+ });+ return nutanixPkiSync.syncCertificates(pkiSync, certificateMap);+ }default:throw new Error(`Unsupported PKI sync destination: ${String(pkiSync.destination)}`);}@@ -435,6 +462,12 @@ export const PkiSyncFns = {});break;}+ case PkiSync.NutanixPrismCentral: {+ throw new PkiSyncError({+ shouldRetry: false,+ message: "Nutanix Prism Central does not support removing certificates"+ });+ }default:throw new Error(`Unsupported PKI sync destination: ${String(pkiSync.destination)}`);}diff --git a/backend/src/services/pki-sync/pki-sync-maps.ts b/backend/src/services/pki-sync/pki-sync-maps.tsindex 9c09b8729d..3cbb94f1f5 100644--- a/backend/src/services/pki-sync/pki-sync-maps.ts+++ b/backend/src/services/pki-sync/pki-sync-maps.ts@@ -12,7 +12,8 @@ export const PKI_SYNC_NAME_MAP: Record<PkiSync, string> = {[PkiSync.NetScaler]: "NetScaler",[PkiSync.F5BigIp]: "F5 BIG-IP",[PkiSync.LinuxServer]: "Linux Server",- [PkiSync.WindowsServer]: "Windows Server"+ [PkiSync.WindowsServer]: "Windows Server",+ [PkiSync.NutanixPrismCentral]: "Nutanix Prism Central"};export const PKI_SYNC_CONNECTION_MAP: Record<PkiSync, AppConnection> = {@@ -25,5 +26,6 @@ export const PKI_SYNC_CONNECTION_MAP: Record<PkiSync, AppConnection> = {[PkiSync.NetScaler]: AppConnection.NetScaler,[PkiSync.F5BigIp]: AppConnection.F5BigIp,[PkiSync.LinuxServer]: AppConnection.SSH,- [PkiSync.WindowsServer]: AppConnection.WinRM+ [PkiSync.WindowsServer]: AppConnection.WinRM,+ [PkiSync.NutanixPrismCentral]: AppConnection.NutanixPrismCentral};diff --git a/backend/src/services/pki-sync/pki-sync-service.ts b/backend/src/services/pki-sync/pki-sync-service.tsindex 3f9726f41d..2ed1b90530 100644--- a/backend/src/services/pki-sync/pki-sync-service.ts+++ b/backend/src/services/pki-sync/pki-sync-service.ts@@ -25,7 +25,12 @@ import { encryptPkiSyncCredentials } from "./pki-sync-credentials-fns";import { TPkiSyncDALFactory } from "./pki-sync-dal";import { PkiSync, PkiSyncStatus } from "./pki-sync-enums";import { PkiSyncExportFormat } from "./pki-sync-export-fns";-import { enterprisePkiSyncCheck, getPkiSyncProviderCapabilities, listPkiSyncOptions } from "./pki-sync-fns";+import {+ enterprisePkiSyncCheck,+ getPkiSyncMaxCertificates,+ getPkiSyncProviderCapabilities,+ listPkiSyncOptions+} from "./pki-sync-fns";import { PKI_SYNC_CONNECTION_MAP, PKI_SYNC_NAME_MAP } from "./pki-sync-maps";import { TPkiSyncQueueFactory } from "./pki-sync-queue";import {@@ -197,6 +202,19 @@ export const pkiSyncServiceFactory = ({}};+ // Enforced only on user-initiated changes. The renewal path writes membership rows+ // directly via the DAL and relies on a transient old+new overlap, so it must not be capped here.+ const assertWithinCertificateLimit = (destination: PkiSync, prospectiveCount: number) => {+ const maxCertificates = getPkiSyncMaxCertificates(destination);+ if (maxCertificates !== undefined && prospectiveCount > maxCertificates) {+ throw new BadRequestError({+ message: `${PKI_SYNC_NAME_MAP[destination]} PKI sync supports at most ${maxCertificates} certificate${+ maxCertificates === 1 ? "" : "s"+ }`+ });+ }+ };+const assertSchemaAllowsCertificateCount = (syncOptions: Record<string, unknown> | undefined,resultingCertificateCount: number@@ -267,6 +285,7 @@ export const pkiSyncServiceFactory = ({};if (certificateIds.length > 0) {+ assertWithinCertificateLimit(destination, certificateIds.length);await validateCertificatesForSync(certificateIds, projectId, applicationId);assertSchemaAllowsCertificateCount(resolvedSyncOptions, certificateIds.length);}@@ -415,6 +434,7 @@ export const pkiSyncServiceFactory = ({if (certificateIds !== undefined) {if (certificateIds.length > 0) {+ assertWithinCertificateLimit(pkiSync.destination, certificateIds.length);await validateCertificatesForSync(certificateIds, pkiSync.projectId, pkiSync.applicationId);assertSchemaAllowsCertificateCount(effectiveSyncOptions, certificateIds.length);}@@ -694,6 +714,14 @@ export const pkiSyncServiceFactory = ({const pkiSync = await pkiSyncDAL.findById(id);if (!pkiSync) throw new NotFoundError({ message: "PKI sync not found" });+ // Check if the PKI sync destination supports removing certificates+ const syncOptions = listPkiSyncOptions().find((option) => option.destination === pkiSync.destination);+ if (!syncOptions?.canRemoveCertificates) {+ throw new BadRequestError({+ message: `Certificate removal is not supported for ${pkiSync.destination} PKI sync destination`+ });+ }+let removeSubscriber;if (pkiSync.subscriberId) {removeSubscriber = await pkiSubscriberDAL.findById(pkiSync.subscriberId);@@ -739,6 +767,10 @@ export const pkiSyncServiceFactory = ({actor);+ const existingCertificateIds = await certificateSyncDAL.findCertificateIdsByPkiSyncId(pkiSyncId);+ const prospectiveCount = new Set([...existingCertificateIds, ...certificateIds]).size;+ assertWithinCertificateLimit(pkiSync.destination, prospectiveCount);+await validateCertificatesForSync(certificateIds, pkiSync.projectId, pkiSync.applicationId);const existingCount = (await certificateSyncDAL.findByPkiSyncId(pkiSyncId)).length;diff --git a/docs/api-reference/endpoints/app-connections/nutanix-prism-central/available.mdx b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/available.mdxnew file mode 100644index 0000000000..93c6012142--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/available.mdx@@ -0,0 +1,4 @@+---+title: "Available"+openapi: "GET /api/v1/app-connections/nutanix-prism-central/available"+---diff --git a/docs/api-reference/endpoints/app-connections/nutanix-prism-central/create.mdx b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/create.mdxnew file mode 100644index 0000000000..e039d293fd--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/create.mdx@@ -0,0 +1,10 @@+---+title: "Create"+openapi: "POST /api/v1/app-connections/nutanix-prism-central"+---++<Note>+ Check out the configuration docs for [Nutanix Prism Central+ Connections](/integrations/app-connections/nutanix-prism-central) to learn how to obtain the+ required credentials.+</Note>diff --git a/docs/api-reference/endpoints/app-connections/nutanix-prism-central/delete.mdx b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/delete.mdxnew file mode 100644index 0000000000..79230946ce--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/delete.mdx@@ -0,0 +1,4 @@+---+title: "Delete"+openapi: "DELETE /api/v1/app-connections/nutanix-prism-central/{connectionId}"+---diff --git a/docs/api-reference/endpoints/app-connections/nutanix-prism-central/get-by-id.mdx b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/get-by-id.mdxnew file mode 100644index 0000000000..2ce51ac6bd--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/get-by-id.mdx@@ -0,0 +1,4 @@+---+title: "Get by ID"+openapi: "GET /api/v1/app-connections/nutanix-prism-central/{connectionId}"+---diff --git a/docs/api-reference/endpoints/app-connections/nutanix-prism-central/get-by-name.mdx b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/get-by-name.mdxnew file mode 100644index 0000000000..6d2e688a22--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/get-by-name.mdx@@ -0,0 +1,4 @@+---+title: "Get by Name"+openapi: "GET /api/v1/app-connections/nutanix-prism-central/connection-name/{connectionName}"+---diff --git a/docs/api-reference/endpoints/app-connections/nutanix-prism-central/list.mdx b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/list.mdxnew file mode 100644index 0000000000..5d5a1db2b9--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/list.mdx@@ -0,0 +1,4 @@+---+title: "List"+openapi: "GET /api/v1/app-connections/nutanix-prism-central"+---diff --git a/docs/api-reference/endpoints/app-connections/nutanix-prism-central/update.mdx b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/update.mdxnew file mode 100644index 0000000000..05985527ee--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/nutanix-prism-central/update.mdx@@ -0,0 +1,10 @@+---+title: "Update"+openapi: "PATCH /api/v1/app-connections/nutanix-prism-central/{connectionId}"+---++<Note>+ Check out the configuration docs for [Nutanix Prism Central+ Connections](/integrations/app-connections/nutanix-prism-central) to learn how to obtain the+ required credentials.+</Note>diff --git a/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/create.mdx b/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/create.mdxnew file mode 100644index 0000000000..50bab03b46--- /dev/null+++ b/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/create.mdx@@ -0,0 +1,4 @@+---+title: "Create Nutanix Prism Central PKI Sync"+openapi: "POST /api/v1/cert-manager/syncs/nutanix-prism-central"+---diff --git a/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/delete.mdx b/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/delete.mdxnew file mode 100644index 0000000000..c30d4c3dc1--- /dev/null+++ b/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/delete.mdx@@ -0,0 +1,4 @@+---+title: "Delete Nutanix Prism Central PKI Sync"+openapi: "DELETE /api/v1/cert-manager/syncs/nutanix-prism-central/{pkiSyncId}"+---diff --git a/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/get-by-id.mdx b/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/get-by-id.mdxnew file mode 100644index 0000000000..3e2161a7fc--- /dev/null+++ b/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/get-by-id.mdx@@ -0,0 +1,4 @@+---+title: "Get Nutanix Prism Central PKI Sync by ID"+openapi: "GET /api/v1/cert-manager/syncs/nutanix-prism-central/{pkiSyncId}"+---diff --git a/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/list.mdx b/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/list.mdxnew file mode 100644index 0000000000..410f309fac--- /dev/null+++ b/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/list.mdx@@ -0,0 +1,4 @@+---+title: "List Nutanix Prism Central PKI Syncs"+openapi: "GET /api/v1/cert-manager/syncs/nutanix-prism-central"+---diff --git a/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/sync-certificates.mdx b/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/sync-certificates.mdxnew file mode 100644index 0000000000..a6636a761e--- /dev/null+++ b/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/sync-certificates.mdx@@ -0,0 +1,4 @@+---+title: "Sync Certificates to Nutanix Prism Central"+openapi: "POST /api/v1/cert-manager/syncs/nutanix-prism-central/{pkiSyncId}/sync"+---diff --git a/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/update.mdx b/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/update.mdxnew file mode 100644index 0000000000..3cb2efe045--- /dev/null+++ b/docs/api-reference/endpoints/pki/syncs/nutanix-prism-central/update.mdx@@ -0,0 +1,4 @@+---+title: "Update Nutanix Prism Central PKI Sync"+openapi: "PATCH /api/v1/cert-manager/syncs/nutanix-prism-central/{pkiSyncId}"+---diff --git a/docs/docs.json b/docs/docs.jsonindex c611bf1fa4..7f55d8e5d9 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -156,6 +156,7 @@"integrations/app-connections/netlify","integrations/app-connections/netscaler","integrations/app-connections/northflank",+ "integrations/app-connections/nutanix-prism-central","integrations/app-connections/ona","integrations/app-connections/oci","integrations/app-connections/octopus-deploy",@@ -952,7 +953,8 @@"documentation/platform/pki/applications/certificate-syncs/f5-big-ip","documentation/platform/pki/applications/certificate-syncs/netscaler","documentation/platform/pki/applications/certificate-syncs/linux-server",- "documentation/platform/pki/applications/certificate-syncs/windows-server"+ "documentation/platform/pki/applications/certificate-syncs/windows-server",+ "documentation/platform/pki/applications/certificate-syncs/nutanix-prism-central"]}]@@ -2002,6 +2004,18 @@"api-reference/endpoints/app-connections/northflank/delete"]},+ {+ "group": "Nutanix Prism Central",+ "pages": [+ "api-reference/endpoints/app-connections/nutanix-prism-central/list",+ "api-reference/endpoints/app-connections/nutanix-prism-central/available",+ "api-reference/endpoints/app-connections/nutanix-prism-central/get-by-id",+ "api-reference/endpoints/app-connections/nutanix-prism-central/get-by-name",+ "api-reference/endpoints/app-connections/nutanix-prism-central/create",+ "api-reference/endpoints/app-connections/nutanix-prism-central/update",+ "api-reference/endpoints/app-connections/nutanix-prism-central/delete"+ ]+ },{"group": "OCI","pages": [@@ -3684,6 +3698,17 @@"api-reference/endpoints/pki/syncs/windows-server/sync-certificates","api-reference/endpoints/pki/syncs/windows-server/remove-certificates"]+ },+ {+ "group": "Nutanix Prism Central",+ "pages": [+ "api-reference/endpoints/pki/syncs/nutanix-prism-central/list",+ "api-reference/endpoints/pki/syncs/nutanix-prism-central/get-by-id",+ "api-reference/endpoints/pki/syncs/nutanix-prism-central/create",+ "api-reference/endpoints/pki/syncs/nutanix-prism-central/update",+ "api-reference/endpoints/pki/syncs/nutanix-prism-central/delete",+ "api-reference/endpoints/pki/syncs/nutanix-prism-central/sync-certificates"+ ]}]}diff --git a/docs/documentation/platform/pki/applications/certificate-syncs/nutanix-prism-central.mdx b/docs/documentation/platform/pki/applications/certificate-syncs/nutanix-prism-central.mdxnew file mode 100644index 0000000000..7289550ae4--- /dev/null+++ b/docs/documentation/platform/pki/applications/certificate-syncs/nutanix-prism-central.mdx@@ -0,0 +1,182 @@+---+title: "Nutanix Prism Central"+sidebarTitle: "Nutanix Prism Central"+description: "Update certificates on your Nutanix clusters."+---++Install certificates managed in Infisical directly on your Nutanix clusters. When a certificate is renewed, it is automatically updated on the cluster with no manual intervention required.++<Info>+ Certificate Syncs are configured per Application. First select which certificate to sync, then configure the Nutanix Prism Central destination.+</Info>++## Prerequisites++Before setting up the sync, gather the following from your Nutanix environment:++- A **Nutanix Prism Central** instance reachable from Infisical over HTTPS (hostname or IP address, port default `9440`), either directly or via an [Infisical Gateway](/documentation/platform/gateways/overview).+- A Prism Central account or API key with the **Cluster Admin** role on the target cluster.+- A [Nutanix Prism Central Connection](/integrations/app-connections/nutanix-prism-central) correctly configured.++## Create a Nutanix Prism Central Sync++<Tabs>+ <Tab title="Infisical UI">+ 1. In your Application, go to the **Certificate Syncs** tab and click **Create Sync**.++ 2. Select the **Nutanix Prism Central** option.++ 3. Configure the **Destination**:+ - **Nutanix Prism Central Connection**: Choose the connection to authenticate with.+ - **Cluster**: From the list of clusters available in Prism Central, select the target cluster.++ 4. Configure the **Sync Options**:+ - **Auto-Sync Enabled**: Automatically update the certificate on the Nutanix cluster whenever it is renewed or updated in Infisical.++ 5. Configure the **Details**:+ - **Name**: A name for this sync.+ - **Description**: Optional description.++ 6. Select the certificate to sync.++ 7. Review and click **Create Sync**.+ </Tab>+ <Tab title="API">+ To create a **Nutanix Prism Central Certificate Sync**, make an API request to the [Create Nutanix Prism Central PKI Sync](/api-reference/endpoints/pki/syncs/nutanix-prism-central/create) API endpoint.++ ### Sample request++ <Note>+ You can optionally specify `certificateIds` during sync creation to immediately add a certificate to the sync.+ If not provided, you can add one later using the certificate management endpoints.+ </Note>++ ```bash Request+ curl --request POST \+ --url https://app.infisical.com/api/v1/cert-manager/syncs/nutanix-prism-central \+ --header 'Authorization: Bearer <access-token>' \+ --header 'Content-Type: application/json' \+ --data '{+ "name": "my-nutanix-cert-sync",+ "applicationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "description": "Push TLS cert to production Nutanix cluster",+ "connectionId": "550e8400-e29b-41d4-a716-446655440000",+ "destination": "nutanix-prism-central",+ "isAutoSyncEnabled": true,+ "certificateIds": [+ "550e8400-e29b-41d4-a716-446655440000"+ ],+ "destinationConfig": {+ "clusterId": "a29facad-8d6e-4f64-b745-bceca6f990d6",+ "clusterName": "prod-cluster-01"+ },+ "syncOptions": {+ "canImportCertificates": false,+ "canRemoveCertificates": false+ }+ }'+ ```++ ### Sample response++ ```json Response+ {+ "pkiSync": {+ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "name": "my-nutanix-cert-sync",+ "description": "Push TLS cert to production Nutanix cluster",+ "destination": "nutanix-prism-central",+ "isAutoSyncEnabled": true,+ "destinationConfig": {+ "clusterId": "a29facad-8d6e-4f64-b745-bceca6f990d6",+ "clusterName": "prod-cluster-01"+ },+ "syncOptions": {+ "canImportCertificates": false,+ "canRemoveCertificates": false+ },+ "applicationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "connectionId": "550e8400-e29b-41d4-a716-446655440000",+ "createdAt": "2026-05-26T00:00:00.000Z",+ "updatedAt": "2026-05-26T00:00:00.000Z"+ }+ }+ ```+ </Tab>+</Tabs>++## How It Works++When a sync runs, Infisical calls the Nutanix Clustermgmt API v4 to replace the SSL certificate on the selected cluster:++1. Connects to Prism Central using the configured credentials (Basic Auth or API Key).+2. Takes the certificate associated with the sync.+3. Configures the certificate and private key onto the Nutanix cluster.++After a few seconds, the Nutanix cluster will use the new certificate, no restart is required.++<Note>+ Each Nutanix Prism Central sync targets a single cluster. To update multiple clusters, create one sync per cluster.+</Note>++## Certificate Management++The Nutanix Prism Central Certificate Sync provides:++- **Automatic Deployment**: Replace the SSL certificate on the target Nutanix cluster whenever the synced certificate changes in Infisical.+- **Certificate Updates**: Push renewed certificates to the cluster automatically when auto-sync is enabled.++<Note>+ Certificate removal is not supported for Nutanix Prism Central. A cluster always has exactly one active SSL certificate, which can only be replaced, not deleted.+</Note>++## Manual Certificate Sync++You can manually trigger certificate synchronization to the Nutanix cluster using the sync certificates functionality. This is useful for:++- Initial setup when deploying a certificate to a cluster for the first time+- Testing certificate sync configurations+- Force sync after making changes++To manually sync certificates, use the [Sync Certificates](/api-reference/endpoints/pki/syncs/nutanix-prism-central/sync-certificates) API endpoint or the manual sync option in the Infisical UI.++## Certificate Renewal Behavior++When a certificate is renewed in Infisical, the renewed certificate is automatically pushed to the Nutanix cluster on the next sync. If **Auto-Sync** is enabled, this happens without any manual action.++## FAQ++<AccordionGroup>+ <Accordion title="Can I import certificates from Nutanix back into Infisical?">+ No. The Nutanix API does not allow private key extraction, so importing certificates from Nutanix into Infisical is not supported.+ </Accordion>++ <Accordion title="What happens if my Prism Central uses a self-signed TLS certificate?">+ When creating the App Connection, disable the **Reject Unauthorized** option to allow connections to Prism Central instances with self-signed or untrusted TLS certificates. Use this only in trusted network environments.+ </Accordion>++ <Accordion title="Which Nutanix API version is used?">+ Infisical uses the **Nutanix Clustermgmt API v4.2** to manage SSL certificates on clusters.+ </Accordion>++ <Accordion title="Do I need to restart the cluster after updating the certificate?">+ No restart is required. Nutanix applies the new SSL certificate as an async task. Infisical waits for the task to complete before marking the sync as successful.+ </Accordion>+</AccordionGroup>++## What's Next?++<CardGroup cols={2}>+ <Card title="NetScaler" icon="network-wired" href="/documentation/platform/pki/applications/certificate-syncs/netscaler">+ Deploy certificates to Citrix NetScaler ADC appliances.+ </Card>+ <Card title="Auto-Renewal" icon="arrows-spin" href="/documentation/platform/pki/applications/certificates#server-driven-renewal">+ Enable automatic certificate renewal and syncing.+ </Card>+ <Card title="Alerting" icon="bell" href="/documentation/platform/pki/applications/alerting/overview">+ Get notified about certificate lifecycle events.+ </Card>+ <Card title="Other Sync Destinations" icon="arrows-rotate" href="/documentation/platform/pki/applications/certificate-syncs/overview">+ View all supported sync destinations.+ </Card>+</CardGroup>diff --git a/docs/documentation/platform/pki/applications/certificate-syncs/overview.mdx b/docs/documentation/platform/pki/applications/certificate-syncs/overview.mdxindex 516a49d3ca..5261a1f728 100644--- a/docs/documentation/platform/pki/applications/certificate-syncs/overview.mdx+++ b/docs/documentation/platform/pki/applications/certificate-syncs/overview.mdx@@ -80,12 +80,18 @@ flowchart LR<Card title="NetScaler" icon="server" href="/documentation/platform/pki/applications/certificate-syncs/netscaler">Deploy certificates to Citrix NetScaler ADC.</Card>+ <Card title="F5 BIG-IP" icon="server" href="/documentation/platform/pki/applications/certificate-syncs/f5-big-ip">+ Deploy certificates to F5 BIG-IP appliances and SSL profiles.+ </Card><Card title="Linux Server" icon="linux" href="/documentation/platform/pki/applications/certificate-syncs/linux-server">Deploy certificates to Linux servers over SSH.</Card><Card title="Windows Server" icon="windows" href="/documentation/platform/pki/applications/certificate-syncs/windows-server">Deploy certificates to Windows servers over WinRM.</Card>+ <Card title="Nutanix Prism Central" icon="server" href="/documentation/platform/pki/applications/certificate-syncs/nutanix-prism-central">+ Update SSL certificates on Nutanix clusters.+ </Card></CardGroup><Note>diff --git a/docs/integrations/app-connections/nutanix-prism-central.mdx b/docs/integrations/app-connections/nutanix-prism-central.mdxnew file mode 100644index 0000000000..176a20297f--- /dev/null+++ b/docs/integrations/app-connections/nutanix-prism-central.mdx@@ -0,0 +1,129 @@+---+title: "Nutanix Prism Central Connection"+description: "Learn how to configure a Nutanix Prism Central Connection for Infisical."+---++Infisical supports connecting to Nutanix Prism Central using either Basic Auth credentials or an API Key to manage SSL certificates on your clusters.++## Setup++<Tabs>+ <Tab title="Infisical UI">+ <Steps>+ <Step title="Gather Nutanix Credentials">+ You will need the following from your Nutanix Prism Central instance:++ - **Hostname**: The FQDN or IP address of your Prism Central instance (e.g., `pc.acme.com`).+ - **Port**: The API port (default: `9440`).+ - **Auth Method**: Choose one of the following:+ - **Basic Auth**: A Prism Central user account with the **Cluster Admin** role on the target cluster.+ - **API Key**: Create a Service Account with the **Cluster Admin** role on the target cluster and generate a key.++ <Note>+ The account or API key must have permission to read cluster information and manage SSL certificates on the target cluster.+ </Note>++ <Warning>+ Nutanix Prism Central instances on private networks (e.g., `10.x.x.x`, `192.168.x.x`) are blocked by default. For self-hosted Infisical, set the `ALLOW_INTERNAL_IP_CONNECTIONS=true` environment variable, or use an [Infisical Gateway](/documentation/platform/gateways/overview) to reach your Prism Central instance.+ </Warning>+ </Step>+ <Step title="Navigate to App Connections">+ In the Infisical dashboard, navigate to **Organization Settings** > **App Connections** and click **Add Connection**.++ + </Step>+ <Step title="Select Nutanix Prism Central">+ Select the **Nutanix Prism Central** option from the list of available connections.+ </Step>+ <Step title="Fill in Connection Details">+ Fill in the connection form:++ - **Name**: A label for this connection (e.g., `prod-prism-central`).+ - **Hostname**: The FQDN or IP address of your Prism Central instance.+ - **Port** (Optional): API port, default is `9440`.+ - **Auth Method**: Select **API Key** or **Basic Auth**:+ - *API Key*: Enter your API key.+ - *Basic Auth*: Enter your **Username** and **Password**.++ Configure the **SSL** tab:++ - **SSL Certificate** (Optional): A CA certificate in PEM format to verify the Prism Central instance's TLS certificate.+ - **Reject Unauthorized**: When enabled, Infisical will only connect if Prism Central has a valid, trusted TLS certificate. Disable for self-signed certificates or provide a CA certificate.++ Optionally select a **Gateway** to route the connection through an [Infisical Gateway](/documentation/platform/gateways/overview) when Prism Central is hosted in an air-gapped or private network.++ Click **Connect to Nutanix Prism Central** to validate and save the connection. Infisical will verify connectivity before saving.+ </Step>+ <Step title="Connection Created">+ Your Nutanix Prism Central Connection is now available for use with certificate syncs.+ </Step>+ </Steps>+ </Tab>+ <Tab title="API">+ To create a Nutanix Prism Central Connection, make an API request to the [Create App Connection](/api-reference/endpoints/app-connections/nutanix-prism-central/create) endpoint.++ ### Sample request (Basic Auth)++ ```bash Request+ curl --request POST \+ --url https://app.infisical.com/api/v1/app-connections/nutanix-prism-central \+ --header 'Authorization: Bearer <access-token>' \+ --header 'Content-Type: application/json' \+ --data '{+ "name": "my-nutanix-connection",+ "method": "basic-auth",+ "credentials": {+ "hostname": "pc.acme.com",+ "port": 9440,+ "username": "admin",+ "password": "<your-password>",+ "sslRejectUnauthorized": false+ }+ }'+ ```++ ### Sample request (API Key)++ ```bash Request+ curl --request POST \+ --url https://app.infisical.com/api/v1/app-connections/nutanix-prism-central \+ --header 'Authorization: Bearer <access-token>' \+ --header 'Content-Type: application/json' \+ --data '{+ "name": "my-nutanix-connection",+ "method": "api-key",+ "credentials": {+ "hostname": "pc.acme.com",+ "port": 9440,+ "apiKey": "<your-api-key>"+ }+ }'+ ```++ ### Sample response++ ```json Response+ {+ "appConnection": {+ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "name": "my-nutanix-connection",+ "app": "nutanix-prism-central",+ "method": "api-key",+ "createdAt": "2026-05-26T00:00:00.000Z",+ "updatedAt": "2026-05-26T00:00:00.000Z"+ }+ }+ ```+ </Tab>+</Tabs>++## What's Next?++<CardGroup cols={2}>+ <Card title="Nutanix Prism Central Sync" icon="rotate" href="/documentation/platform/pki/applications/certificate-syncs/nutanix-prism-central">+ Update certificates on your Nutanix clusters automatically.+ </Card>+ <Card title="Other App Connections" icon="plug" href="/integrations/app-connections/overview">+ View all supported app connections.+ </Card>+</CardGroup>diff --git a/docs/snippets/AppConnectionsBrowser.jsx b/docs/snippets/AppConnectionsBrowser.jsxindex f5b66c2f41..cb96b4c2af 100644--- a/docs/snippets/AppConnectionsBrowser.jsx+++ b/docs/snippets/AppConnectionsBrowser.jsx@@ -410,6 +410,14 @@ export const AppConnectionsBrowser = () => {"Learn how to connect your Northflank projects to pull secrets from Infisical.",category: "Hosting",},+ {+ name: "Nutanix Prism Central",+ slug: "nutanix-prism-central",+ path: "/integrations/app-connections/nutanix-prism-central",+ description:+ "Learn how to connect your Nutanix Prism Central to push certificates from Infisical.",+ category: "Cloud Providers",+ },{name: "Ona",slug: "ona",diff --git a/frontend/public/images/integrations/Nutanix.png b/frontend/public/images/integrations/Nutanix.pngnew file mode 100644index 0000000000..d52a4d6ad7Binary files /dev/null and b/frontend/public/images/integrations/Nutanix.png differdiff --git a/frontend/src/components/pki-syncs/CertificateManagementModal.tsx b/frontend/src/components/pki-syncs/CertificateManagementModal.tsxindex d1abf7c94b..48e22729ad 100644--- a/frontend/src/components/pki-syncs/CertificateManagementModal.tsx+++ b/frontend/src/components/pki-syncs/CertificateManagementModal.tsx@@ -27,13 +27,14 @@ import {useListPkiSyncCertificates,useRemoveCertificatesFromPkiSync} from "@app/hooks/api";-import { TPkiSync } from "@app/hooks/api/pkiSyncs";+import { PkiSync, TPkiSync, usePkiSyncOption } from "@app/hooks/api/pkiSyncs";import { useListWorkspaceCertificates } from "@app/hooks/api/projects";type Props = {isOpen: boolean;onClose: () => void;pkiSync?: TPkiSync;+ destination?: PkiSync;applicationId?: string;onCertificatesUpdated?: () => void;selectedCertificateIds?: string[];@@ -47,6 +48,7 @@ export const CertificateManagementModal = ({isOpen,onClose,pkiSync,+ destination,applicationId: applicationIdProp,onCertificatesUpdated,selectedCertificateIds,@@ -64,6 +66,9 @@ export const CertificateManagementModal = ({const isCreateMode = !pkiSync;const scopedApplicationId = pkiSync?.applicationId ?? applicationIdProp;+ const { syncOption } = usePkiSyncOption((pkiSync?.destination ?? destination) as PkiSync);+ const isSingleSelect = syncOption?.maxCertificates === 1;+useEffect(() => {const handler = setTimeout(() => {setDebouncedSearchTerm(searchTerm);@@ -106,9 +111,13 @@ export const CertificateManagementModal = ({}, [JSON.stringify(syncedCertificateIds)]);const handleToggleSelection = (certId: string) => {- setSelectedIds((prev) =>- prev.includes(certId) ? prev.filter((id) => id !== certId) : [...prev, certId]- );+ setSelectedIds((prev) => {+ if (prev.includes(certId)) {+ return prev.filter((id) => id !== certId);+ }+ // Single-slot destinations (e.g. Nutanix) allow only one certificate+ return isSingleSelect ? [certId] : [...prev, certId];+ });};const handleSelectAll = () => {@@ -167,51 +176,53 @@ export const CertificateManagementModal = ({return;}- const operations = [];-- if (certificatesToAdd.length > 0) {- operations.push(- addCertificatesToSync- .mutateAsync({- pkiSyncId: pkiSync.id,- certificateIds: certificatesToAdd- })- .then(() => ({- type: "add",- count: certificatesToAdd.length,- success: true- }))- .catch((error) => ({- type: "add",- count: certificatesToAdd.length,- success: false,- error- }))- );+ type TOperationResult = {+ type: "add" | "remove";+ count: number;+ success: boolean;+ error?: unknown;+ };++ const runRemove = async (): Promise<TOperationResult | null> => {+ if (certificatesToRemove.length === 0) return null;+ try {+ await removeCertificatesFromSync.mutateAsync({+ pkiSyncId: pkiSync.id,+ certificateIds: certificatesToRemove+ });+ return { type: "remove", count: certificatesToRemove.length, success: true };+ } catch (error) {+ return { type: "remove", count: certificatesToRemove.length, success: false, error };+ }+ };++ const runAdd = async (): Promise<TOperationResult | null> => {+ if (certificatesToAdd.length === 0) return null;+ try {+ await addCertificatesToSync.mutateAsync({+ pkiSyncId: pkiSync.id,+ certificateIds: certificatesToAdd+ });+ return { type: "add", count: certificatesToAdd.length, success: true };+ } catch (error) {+ return { type: "add", count: certificatesToAdd.length, success: false, error };+ }+ };++ let results: (TOperationResult | null)[];+ if (isSingleSelect) {+ // Single-slot destinations (e.g. Nutanix, maxCertificates: 1) must remove the+ // existing certificate before adding the replacement, otherwise the add would+ // transiently exceed the limit and be rejected. Other destinations keep the+ // original parallel behavior so their flow is unchanged.+ results = [await runRemove(), await runAdd()];+ } else {+ results = await Promise.all([runAdd(), runRemove()]);}- if (certificatesToRemove.length > 0) {- operations.push(- removeCertificatesFromSync- .mutateAsync({- pkiSyncId: pkiSync.id,- certificateIds: certificatesToRemove- })- .then(() => ({- type: "remove",- count: certificatesToRemove.length,- success: true- }))- .catch((error) => ({- type: "remove",- count: certificatesToRemove.length,- success: false,- error- }))- );- }+ const completed = results.filter((r): r is TOperationResult => r !== null);- if (operations.length === 0) {+ if (completed.length === 0) {createNotification({text: "No changes to save",type: "info"@@ -220,9 +231,8 @@ export const CertificateManagementModal = ({return;}- const results = await Promise.all(operations);- const failures = results.filter((r) => !r.success);- const successes = results.filter((r) => r.success);+ const failures = completed.filter((r) => !r.success);+ const successes = completed.filter((r) => r.success);if (failures.length === 0) {const addCount = successes.find((r) => r.type === "add")?.count || 0;@@ -308,14 +318,16 @@ export const CertificateManagementModal = ({<THead><Tr><Th className="w-12">- <Checkbox- id="select-all-certificates"- isChecked={- allCertificates.length > 0 &&- allCertificates.every((cert) => selectedIds.includes(cert.id))- }- onCheckedChange={handleSelectAll}- />+ {!isSingleSelect && (+ <Checkbox+ id="select-all-certificates"+ isChecked={+ allCertificates.length > 0 &&+ allCertificates.every((cert) => selectedIds.includes(cert.id))+ }+ onCheckedChange={handleSelectAll}+ />+ )}</Th><Th className="w-1/3">SAN / CN</Th><Th className="w-1/4">Serial Number</Th>diff --git a/frontend/src/components/pki-syncs/PkiSyncModalHeader.tsx b/frontend/src/components/pki-syncs/PkiSyncModalHeader.tsxindex 66eb080035..3a2511228b 100644--- a/frontend/src/components/pki-syncs/PkiSyncModalHeader.tsx+++ b/frontend/src/components/pki-syncs/PkiSyncModalHeader.tsx@@ -15,7 +15,7 @@ export const PkiSyncModalHeader = ({ destination, isConfigured }: Props) => {<imgalt={`${destinationDetails.name} logo`}src={`/images/integrations/${destinationDetails.image}`}- className="h-12 w-12 rounded-md bg-bunker-500 p-2"+ className="h-12 w-12 rounded-md bg-bunker-500 object-contain p-2"/><div><div className="flex items-center gap-x-2 text-mineshaft-300">diff --git a/frontend/src/components/pki-syncs/PkiSyncSelect.tsx b/frontend/src/components/pki-syncs/PkiSyncSelect.tsxindex 251f88ee26..0a17815020 100644--- a/frontend/src/components/pki-syncs/PkiSyncSelect.tsx+++ b/frontend/src/components/pki-syncs/PkiSyncSelect.tsx@@ -79,9 +79,7 @@ export const PkiSyncSelect = ({ onSelect }: Props) => {><imgsrc={`/images/integrations/${image}`}- height={40}- width={40}- className="mt-auto"+ className="mt-auto h-10 w-full max-w-24 object-contain"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">diff --git a/frontend/src/components/pki-syncs/forms/NutanixPrismCentralPkiSyncFields.tsx b/frontend/src/components/pki-syncs/forms/NutanixPrismCentralPkiSyncFields.tsxnew file mode 100644index 0000000000..5fa54db394--- /dev/null+++ b/frontend/src/components/pki-syncs/forms/NutanixPrismCentralPkiSyncFields.tsx@@ -0,0 +1,84 @@+import { Controller, useFormContext, useWatch } from "react-hook-form";+import { AxiosError } from "axios";++import { FormControl, Select, SelectItem, Spinner } from "@app/components/v2";+import { useNutanixPrismCentralConnectionListClusters } from "@app/hooks/api/appConnections/nutanix-prism-central";+import { PkiSync } from "@app/hooks/api/pkiSyncs";++import { TPkiSyncForm } from "./schemas/pki-sync-schema";+import { PkiSyncConnectionField } from "./PkiSyncConnectionField";++type TNutanixForm = TPkiSyncForm & { destination: PkiSync.NutanixPrismCentral };++export const NutanixPrismCentralPkiSyncFields = () => {+ const { control, setValue } = useFormContext<TNutanixForm>();++ const connectionId = useWatch({ name: "connection.id", control });++ const {+ data: clusters,+ isFetching: isLoadingClusters,+ isError: isClustersError,+ error: clustersError+ } = useNutanixPrismCentralConnectionListClusters(connectionId, {+ enabled: Boolean(connectionId)+ });++ return (+ <>+ <PkiSyncConnectionField+ onChange={() => {+ setValue("destinationConfig.clusterId", "");+ setValue("destinationConfig.clusterName", "");+ }}+ />+ <Controller+ name="destinationConfig.clusterId"+ control={control}+ render={({ field: { value, onChange }, fieldState: { error } }) => {+ const clusterFetchErrorText =+ isClustersError && connectionId+ ? ((clustersError as AxiosError<{ message?: string }>)?.response?.data?.message ??+ "Failed to fetch clusters. Check connection settings.")+ : undefined;++ return (+ <FormControl+ isError={Boolean(error) || Boolean(clusterFetchErrorText)}+ errorText={error?.message ?? clusterFetchErrorText}+ label="Target Cluster"+ tooltipText="The Nutanix cluster that will receive the certificate."+ >+ {connectionId && isLoadingClusters ? (+ <div className="flex items-center gap-2 py-2 text-sm text-mineshaft-400">+ <Spinner size="sm" />+ Loading clusters...+ </div>+ ) : (+ <Select+ value={value}+ onValueChange={(newValue) => {+ const cluster = clusters?.find((c) => c.id === newValue);+ onChange(newValue);+ setValue("destinationConfig.clusterName", cluster?.name ?? "");+ }}+ placeholder={connectionId ? "Select a cluster" : "Select a connection first"}+ isDisabled={!connectionId || isLoadingClusters}+ className="w-full"+ position="popper"+ dropdownContainerClassName="max-w-none"+ >+ {(clusters ?? []).map((cluster) => (+ <SelectItem key={cluster.id} value={cluster.id}>+ {cluster.name}+ </SelectItem>+ ))}+ </Select>+ )}+ </FormControl>+ );+ }}+ />+ </>+ );+};diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncCertificatesFields.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncCertificatesFields.tsxindex 4e3f491484..41e13be51c 100644--- a/frontend/src/components/pki-syncs/forms/PkiSyncCertificatesFields.tsx+++ b/frontend/src/components/pki-syncs/forms/PkiSyncCertificatesFields.tsx@@ -181,6 +181,7 @@ export const PkiSyncCertificatesFields = ({ applicationId }: Props = {}) => {<CertificateManagementModalisOpen={isSelectionModalOpen}onClose={() => setIsSelectionModalOpen(false)}+ destination={watch("destination")}applicationId={applicationId}selectedCertificateIds={certificateIds}onCertificateSelectionChange={(newCertificateIds) => {diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncDestinationFields.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncDestinationFields.tsxindex af1024f1e5..c230b5d768 100644--- a/frontend/src/components/pki-syncs/forms/PkiSyncDestinationFields.tsx+++ b/frontend/src/components/pki-syncs/forms/PkiSyncDestinationFields.tsx@@ -12,6 +12,7 @@ import { CloudflareCustomCertificatePkiSyncFields } from "./CloudflareCustomCertimport { F5BigIpPkiSyncFields } from "./F5BigIpPkiSyncFields";import { LinuxServerPkiSyncFields } from "./LinuxServerPkiSyncFields";import { NetScalerPkiSyncFields } from "./NetScalerPkiSyncFields";+import { NutanixPrismCentralPkiSyncFields } from "./NutanixPrismCentralPkiSyncFields";import { WindowsServerPkiSyncFields } from "./WindowsServerPkiSyncFields";export const PkiSyncDestinationFields = () => {@@ -40,6 +41,8 @@ export const PkiSyncDestinationFields = () => {return <LinuxServerPkiSyncFields />;case PkiSync.WindowsServer:return <WindowsServerPkiSyncFields />;+ case PkiSync.NutanixPrismCentral:+ return <NutanixPrismCentralPkiSyncFields />;default:return (<div className="flex items-center justify-center rounded-md border border-red-500 bg-red-100 p-4 text-red-700">diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/PkiSyncOptionsFields.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/PkiSyncOptionsFields.tsxindex 02bfd3f187..168f9b887c 100644--- a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/PkiSyncOptionsFields.tsx+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/PkiSyncOptionsFields.tsx@@ -79,83 +79,41 @@ export const PkiSyncOptionsFields = ({ destination, isUpdate }: Props) => {)}/>*/}- <Controller- control={control}- name="syncOptions.canRemoveCertificates"- render={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl isError={Boolean(error)} errorText={error?.message}>- <Switch- className="bg-mineshaft-400/80 shadow-inner data-[state=checked]:bg-green/80"- id="can-remove-certificates"- thumbClassName="bg-mineshaft-800"- onCheckedChange={onChange}- isChecked={value}- >- <p>- Enable Removal of Expired/Revoked Certificates{" "}- <Tooltip- className="max-w-md"- content={- <>- <p>- When enabled, Infisical will remove certificates from the destination during- a sync if they are no longer active in Infisical.- </p>- {currentDestination === PkiSync.AwsElasticLoadBalancer && (- <p className="mt-4">- For AWS Elastic Load Balancer, this will remove the certificate from both- the load balancer listeners and AWS Certificate Manager. This only affects- certificates managed by this specific sync and will not interfere with- certificates managed by other syncs (such as ACM syncs or other ELB- syncs).- </p>- )}- <p className="mt-4">- Disable this option if you intend to manage some certificates manually- outside of Infisical.- </p>- </>- }- >- <FontAwesomeIcon icon={faQuestionCircle} size="sm" className="ml-1" />- </Tooltip>- </p>- </Switch>- </FormControl>- )}- />-- {currentDestination !== PkiSync.CloudflareCustomCertificate && (+ {syncOption?.canRemoveCertificates && (<Controllercontrol={control}- name="syncOptions.includeRootCa"+ name="syncOptions.canRemoveCertificates"render={({ field: { value, onChange }, fieldState: { error } }) => (<FormControl isError={Boolean(error)} errorText={error?.message}><SwitchclassName="bg-mineshaft-400/80 shadow-inner data-[state=checked]:bg-green/80"- id="include-root-ca"+ id="can-remove-certificates"thumbClassName="bg-mineshaft-800"onCheckedChange={onChange}isChecked={value}><p>- Include Root CA in Certificate Chain{" "}+ Enable Removal of Expired/Revoked Certificates{" "}<TooltipclassName="max-w-md"content={<><p>- When enabled, the full certificate chain including the root CA will be- synced to the destination.- </p>- <p className="mt-4">- When disabled, the root CA will be excluded from the certificate chain- during sync operations, reducing the size of the synced certificate chain.+ When enabled, Infisical will remove certificates from the destination+ during a sync if they are no longer active in Infisical.</p>+ {currentDestination === PkiSync.AwsElasticLoadBalancer && (+ <p className="mt-4">+ For AWS Elastic Load Balancer, this will remove the certificate from+ both the load balancer listeners and AWS Certificate Manager. This only+ affects certificates managed by this specific sync and will not+ interfere with certificates managed by other syncs (such as ACM syncs or+ other ELB syncs).+ </p>+ )}<p className="mt-4">- Most applications and services work correctly with intermediate- certificates only, as they can validate the trust chain up to a root CA- they already trust.+ Disable this option if you intend to manage some certificates manually+ outside of Infisical.</p></>}@@ -169,6 +127,52 @@ export const PkiSyncOptionsFields = ({ destination, isUpdate }: Props) => {/>)}+ {currentDestination !== PkiSync.CloudflareCustomCertificate &&+ currentDestination !== PkiSync.NutanixPrismCentral && (+ <Controller+ control={control}+ name="syncOptions.includeRootCa"+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <FormControl isError={Boolean(error)} errorText={error?.message}>+ <Switch+ className="bg-mineshaft-400/80 shadow-inner data-[state=checked]:bg-green/80"+ id="include-root-ca"+ thumbClassName="bg-mineshaft-800"+ onCheckedChange={onChange}+ isChecked={value}+ >+ <p>+ Include Root CA in Certificate Chain{" "}+ <Tooltip+ className="max-w-md"+ content={+ <>+ <p>+ When enabled, the full certificate chain including the root CA will be+ synced to the destination.+ </p>+ <p className="mt-4">+ When disabled, the root CA will be excluded from the certificate chain+ during sync operations, reducing the size of the synced certificate+ chain.+ </p>+ <p className="mt-4">+ Most applications and services work correctly with intermediate+ certificates only, as they can validate the trust chain up to a root CA+ they already trust.+ </p>+ </>+ }+ >+ <FontAwesomeIcon icon={faQuestionCircle} size="sm" className="ml-1" />+ </Tooltip>+ </p>+ </Switch>+ </FormControl>+ )}+ />+ )}+{(currentDestination === PkiSync.AwsCertificateManager ||currentDestination === PkiSync.AwsElasticLoadBalancer) && (<Controller@@ -709,98 +713,101 @@ export const PkiSyncOptionsFields = ({ destination, isUpdate }: Props) => {</FormControl>)}- <Controller- control={control}- name="syncOptions.certificateNameSchema"- render={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- tooltipClassName="max-w-md"- tooltipText={- <div className="flex flex-col gap-3">- <span>- When a certificate is synced, the certificate name schema will be applied before- it reaches the destination.- </span>+ {currentDestination !== PkiSync.NutanixPrismCentral && (+ <Controller+ control={control}+ name="syncOptions.certificateNameSchema"+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <FormControl+ tooltipClassName="max-w-md"+ tooltipText={+ <div className="flex flex-col gap-3">+ <span>+ When a certificate is synced, the certificate name schema will be applied before+ it reaches the destination.+ </span>- <div className="flex flex-col">- <span>Available placeholders:</span>- <ul className="list-disc pl-4 text-sm">- <li>- <code>{"{{certificateId}}"}</code> - The unique ID of the certificate- </li>- <li>- <code>{"{{shortCertificateId}}"}</code> - A shorter (22-character) form of the- certificate ID. Use it instead of <code>{"{{certificateId}}"}</code> when the- destination's name limit is tight (e.g. NetScaler's 63 characters).- </li>- <li>- <code>{"{{commonName}}"}</code> - The certificate's common name (FQDN)- </li>- <li>- <code>{"{{profileId}}"}</code> - The certificate profile ID (falls back to the- certificate ID when none is set)- </li>- <li>- <code>{"{{applicationId}}"}</code> - The ID of the application the sync- belongs to- </li>- <li>- <code>{"{{applicationName}}"}</code> - The name of the application the sync- belongs to- </li>- </ul>- {currentDestination === PkiSync.LinuxServer ||- currentDestination === PkiSync.WindowsServer ? (- <span className="mt-1 text-xs text-bunker-300">- A placeholder is optional here. Include one (for example{" "}- <code>{"{{commonName}}"}</code>) so each certificate resolves to a distinct- file name. A schema with no placeholder resolves to a fixed name and can be- linked to only one certificate. When placeholders resolve, any characters the- destination doesn't support are replaced with hyphens.- </span>- ) : (- <span className="mt-1 text-xs text-bunker-300">- The schema must include <code>{"{{certificateId}}"}</code> or{" "}- <code>{"{{shortCertificateId}}"}</code> so each certificate gets a unique- name. The template itself can only contain letters, numbers, and the- separators allowed by the destination. When placeholders resolve, any- characters the destination doesn't support are replaced with hyphens.- </span>- )}- </div>- {syncOption?.forbiddenCharacters && syncOption.forbiddenCharacters.length > 0 && (<div className="flex flex-col">- <span className="text-yellow">- Character restrictions for {syncOption.name}:- </span>- <div className="text-xs text-bunker-300">- The following characters are not allowed:{" "}- {syncOption.forbiddenCharacters.split("").join(" ")}- </div>+ <span>Available placeholders:</span>+ <ul className="list-disc pl-4 text-sm">+ <li>+ <code>{"{{certificateId}}"}</code> - The unique ID of the certificate+ </li>+ <li>+ <code>{"{{shortCertificateId}}"}</code> - A shorter (22-character) form of+ the certificate ID. Use it instead of <code>{"{{certificateId}}"}</code>{" "}+ when the destination's name limit is tight (e.g. NetScaler's 63+ characters).+ </li>+ <li>+ <code>{"{{commonName}}"}</code> - The certificate's common name (FQDN)+ </li>+ <li>+ <code>{"{{profileId}}"}</code> - The certificate profile ID (falls back to+ the certificate ID when none is set)+ </li>+ <li>+ <code>{"{{applicationId}}"}</code> - The ID of the application the sync+ belongs to+ </li>+ <li>+ <code>{"{{applicationName}}"}</code> - The name of the application the sync+ belongs to+ </li>+ </ul>+ {currentDestination === PkiSync.LinuxServer ||+ currentDestination === PkiSync.WindowsServer ? (+ <span className="mt-1 text-xs text-bunker-300">+ A placeholder is optional here. Include one (for example{" "}+ <code>{"{{commonName}}"}</code>) so each certificate resolves to a distinct+ file name. A schema with no placeholder resolves to a fixed name and can be+ linked to only one certificate. When placeholders resolve, any characters+ the destination doesn't support are replaced with hyphens.+ </span>+ ) : (+ <span className="mt-1 text-xs text-bunker-300">+ The schema must include <code>{"{{certificateId}}"}</code> or{" "}+ <code>{"{{shortCertificateId}}"}</code> so each certificate gets a unique+ name. The template itself can only contain letters, numbers, and the+ separators allowed by the destination. When placeholders resolve, any+ characters the destination doesn't support are replaced with hyphens.+ </span>+ )}</div>- )}- </div>- }- isError={Boolean(error)}- isOptional={currentDestination === PkiSync.AwsElasticLoadBalancer}- errorText={error?.message}- label="Certificate Name Schema"- helperText={- currentDestination === PkiSync.AwsElasticLoadBalancer- ? "Set a Certificate Name Schema so Infisical only manages the specific certificates you intend to, keeping everything else untouched."- : "The Certificate Name Schema ensures Infisical only manages the specific certificates you intend to, keeping everything else untouched."- }- >- <Input- value={value || ""}- onChange={(e) => onChange(e.target.value)}- placeholder={- syncOption?.defaultCertificateNameSchema || "INFISICAL_{{certificateId}}"+ {syncOption?.forbiddenCharacters && syncOption.forbiddenCharacters.length > 0 && (+ <div className="flex flex-col">+ <span className="text-yellow">+ Character restrictions for {syncOption.name}:+ </span>+ <div className="text-xs text-bunker-300">+ The following characters are not allowed:{" "}+ {syncOption.forbiddenCharacters.split("").join(" ")}+ </div>+ </div>+ )}+ </div>}- />- </FormControl>- )}- />+ isError={Boolean(error)}+ isOptional={currentDestination === PkiSync.AwsElasticLoadBalancer}+ errorText={error?.message}+ label="Certificate Name Schema"+ helperText={+ currentDestination === PkiSync.AwsElasticLoadBalancer+ ? "Set a Certificate Name Schema so Infisical only manages the specific certificates you intend to, keeping everything else untouched."+ : "The Certificate Name Schema ensures Infisical only manages the specific certificates you intend to, keeping everything else untouched."+ }+ >+ <Input+ value={value || ""}+ onChange={(e) => onChange(e.target.value)}+ placeholder={+ syncOption?.defaultCertificateNameSchema || "INFISICAL_{{certificateId}}"+ }+ />+ </FormControl>+ )}+ />+ )}</>);};diff --git a/frontend/src/components/pki-syncs/forms/schemas/nutanix-prism-central-pki-sync-destination-schema.ts b/frontend/src/components/pki-syncs/forms/schemas/nutanix-prism-central-pki-sync-destination-schema.tsnew file mode 100644index 0000000000..e4a3f21eb6--- /dev/null+++ b/frontend/src/components/pki-syncs/forms/schemas/nutanix-prism-central-pki-sync-destination-schema.ts@@ -0,0 +1,43 @@+import { z } from "zod";++import { PkiSync } from "@app/hooks/api/pkiSyncs";++import { BasePkiSyncSchema } from "./base-pki-sync-schema";++const NutanixPrismCentralSyncOptionsSchema = z.object({+ canImportCertificates: z.literal(false).default(false),+ canRemoveCertificates: z.literal(false).default(false),+ // hidden in the UI; overrides the base schema's required field+ certificateNameSchema: z.string().optional()+});++export const NutanixPrismCentralPkiSyncDestinationSchema = BasePkiSyncSchema(+ NutanixPrismCentralSyncOptionsSchema+).merge(+ z.object({+ destination: z.literal(PkiSync.NutanixPrismCentral),+ destinationConfig: z.object({+ clusterId: z.string().min(1, "Cluster is required"),+ clusterName: z.string().min(1, "Cluster is required")+ })+ })+);++export const UpdateNutanixPrismCentralPkiSyncDestinationSchema =+ NutanixPrismCentralPkiSyncDestinationSchema.partial().merge(+ z.object({+ name: z+ .string()+ .trim()+ .min(1, "Name is required")+ .max(255, "Name must be less than 255 characters"),+ destination: z.literal(PkiSync.NutanixPrismCentral),+ connection: z.object({+ id: z.string().uuid("Invalid connection ID format"),+ name: z+ .string()+ .min(1, "Connection name is required")+ .max(255, "Connection name must be less than 255 characters")+ })+ })+ );diff --git a/frontend/src/components/pki-syncs/forms/schemas/pki-sync-schema.ts b/frontend/src/components/pki-syncs/forms/schemas/pki-sync-schema.tsindex 127ab9197a..3c43c371a9 100644--- a/frontend/src/components/pki-syncs/forms/schemas/pki-sync-schema.ts+++ b/frontend/src/components/pki-syncs/forms/schemas/pki-sync-schema.ts@@ -38,6 +38,10 @@ import {NetScalerPkiSyncDestinationSchema,UpdateNetScalerPkiSyncDestinationSchema} from "./netscaler-pki-sync-destination-schema";+import {+ NutanixPrismCentralPkiSyncDestinationSchema,+ UpdateNutanixPrismCentralPkiSyncDestinationSchema+} from "./nutanix-prism-central-pki-sync-destination-schema";import {UpdateWindowsServerPkiSyncDestinationSchema,WindowsServerPkiSyncDestinationSchema@@ -53,7 +57,8 @@ const PkiSyncUnionSchema = z.discriminatedUnion("destination", [NetScalerPkiSyncDestinationSchema,F5BigIpPkiSyncDestinationSchema,LinuxServerPkiSyncDestinationSchema,- WindowsServerPkiSyncDestinationSchema+ WindowsServerPkiSyncDestinationSchema,+ NutanixPrismCentralPkiSyncDestinationSchema]);const UpdatePkiSyncUnionSchema = z.discriminatedUnion("destination", [@@ -66,7 +71,8 @@ const UpdatePkiSyncUnionSchema = z.discriminatedUnion("destination", [UpdateNetScalerPkiSyncDestinationSchema,UpdateF5BigIpPkiSyncDestinationSchema,UpdateLinuxServerPkiSyncDestinationSchema,- UpdateWindowsServerPkiSyncDestinationSchema+ UpdateWindowsServerPkiSyncDestinationSchema,+ UpdateNutanixPrismCentralPkiSyncDestinationSchema]);export const PkiSyncFormSchema = PkiSyncUnionSchema.superRefine((data, ctx) => {diff --git a/frontend/src/helpers/appConnections.ts b/frontend/src/helpers/appConnections.tsindex b11bb9febe..980d7c37f0 100644--- a/frontend/src/helpers/appConnections.ts+++ b/frontend/src/helpers/appConnections.ts@@ -76,6 +76,7 @@ import { LiteLLMConnectionMethod } from "@app/hooks/api/appConnections/types/litimport { NetlifyConnectionMethod } from "@app/hooks/api/appConnections/types/netlify-connection";import { NetScalerConnectionMethod } from "@app/hooks/api/appConnections/types/netscaler-connection";import { NorthflankConnectionMethod } from "@app/hooks/api/appConnections/types/northflank-connection";+import { NutanixPrismCentralConnectionMethod } from "@app/hooks/api/appConnections/types/nutanix-prism-central-connection";import { OCIConnectionMethod } from "@app/hooks/api/appConnections/types/oci-connection";import { OnaConnectionMethod } from "@app/hooks/api/appConnections/types/ona-connection";import { OpenAIConnectionMethod } from "@app/hooks/api/appConnections/types/open-ai-connection";@@ -594,6 +595,12 @@ export const APP_CONNECTION_MAP: Record<image: "Rundeck.svg",category: "INFRASTRUCTURE",description: "Job and project access for Rundeck."+ },+ [AppConnection.NutanixPrismCentral]: {+ name: "Nutanix Prism Central",+ image: "Nutanix.png",+ category: "INFRASTRUCTURE",+ description: "Manage a Nutanix Prism Central instance."}};@@ -732,11 +739,13 @@ export const getAppConnectionMethodDetails = (method: TAppConnection["method"])case ExternalInfisicalConnectionMethod.MachineIdentityUniversalAuth:return { name: "Machine Identity - Universal Auth", icon: faKey };case NetScalerConnectionMethod.BasicAuth:+ case NutanixPrismCentralConnectionMethod.BasicAuth:+ case F5BigIpConnectionMethod.BasicAuth:return { name: "Basic Auth", icon: faLock };+ case NutanixPrismCentralConnectionMethod.ApiKey:+ return { name: "API Key", icon: faKey };case OVHConnectionMethod.Certificate:return { name: "Certificate", icon: faCertificate };- case F5BigIpConnectionMethod.BasicAuth:- return { name: "Basic Auth", icon: faLock };default:throw new Error(`Unhandled App Connection Method: ${method}`);}diff --git a/frontend/src/helpers/pkiSyncs.ts b/frontend/src/helpers/pkiSyncs.tsindex feff1d6264..39c4ddf7b9 100644--- a/frontend/src/helpers/pkiSyncs.ts+++ b/frontend/src/helpers/pkiSyncs.ts@@ -47,6 +47,10 @@ export const PKI_SYNC_MAP: Record<[PkiSync.WindowsServer]: {name: "Windows Server",image: "Windows.png"+ },+ [PkiSync.NutanixPrismCentral]: {+ name: "Nutanix Prism Central",+ image: "Nutanix.png"}};@@ -60,5 +64,6 @@ export const PKI_SYNC_CONNECTION_MAP: Record<PkiSync, AppConnection> = {[PkiSync.NetScaler]: AppConnection.NetScaler,[PkiSync.F5BigIp]: AppConnection.F5BigIp,[PkiSync.LinuxServer]: AppConnection.SSH,- [PkiSync.WindowsServer]: AppConnection.WinRM+ [PkiSync.WindowsServer]: AppConnection.WinRM,+ [PkiSync.NutanixPrismCentral]: AppConnection.NutanixPrismCentral};diff --git a/frontend/src/hooks/api/appConnections/enums.ts b/frontend/src/hooks/api/appConnections/enums.tsindex 963b67f21e..9891ace9a0 100644--- a/frontend/src/hooks/api/appConnections/enums.ts+++ b/frontend/src/hooks/api/appConnections/enums.ts@@ -77,5 +77,6 @@ export enum AppConnection {Qovery = "qovery",Cloud66 = "cloud-66",LiteLLM = "litellm",- Fireworks = "fireworks"+ Fireworks = "fireworks",+ NutanixPrismCentral = "nutanix-prism-central"}diff --git a/frontend/src/hooks/api/appConnections/nutanix-prism-central/index.ts b/frontend/src/hooks/api/appConnections/nutanix-prism-central/index.tsnew file mode 100644index 0000000000..b69c251208--- /dev/null+++ b/frontend/src/hooks/api/appConnections/nutanix-prism-central/index.ts@@ -0,0 +1 @@+export * from "./queries";diff --git a/frontend/src/hooks/api/appConnections/nutanix-prism-central/queries.tsx b/frontend/src/hooks/api/appConnections/nutanix-prism-central/queries.tsxnew file mode 100644index 0000000000..1df0a468ea--- /dev/null+++ b/frontend/src/hooks/api/appConnections/nutanix-prism-central/queries.tsx@@ -0,0 +1,42 @@+import { useQuery, UseQueryOptions } from "@tanstack/react-query";++import { apiRequest } from "@app/config/request";++import { appConnectionKeys } from "../queries";++export type TNutanixCluster = {+ id: string;+ name: string;+};++const nutanixPrismCentralConnectionKeys = {+ all: [...appConnectionKeys.all, "nutanix-prism-central"] as const,+ listClusters: (connectionId: string) =>+ [...nutanixPrismCentralConnectionKeys.all, "clusters", connectionId] as const+};++export const useNutanixPrismCentralConnectionListClusters = (+ connectionId: string,+ options?: Omit<+ UseQueryOptions<+ TNutanixCluster[],+ unknown,+ TNutanixCluster[],+ ReturnType<typeof nutanixPrismCentralConnectionKeys.listClusters>+ >,+ "queryKey" | "queryFn"+ >+) => {+ return useQuery({+ queryKey: nutanixPrismCentralConnectionKeys.listClusters(connectionId),+ queryFn: async () => {+ const { data } = await apiRequest.get<{ clusters: TNutanixCluster[] }>(+ `/api/v1/app-connections/nutanix-prism-central/${connectionId}/clusters`+ );++ return data.clusters;+ },+ enabled: Boolean(connectionId),+ ...options+ });+};diff --git a/frontend/src/hooks/api/appConnections/types/app-options.ts b/frontend/src/hooks/api/appConnections/types/app-options.tsindex 00a90ce405..5bba6da562 100644--- a/frontend/src/hooks/api/appConnections/types/app-options.ts+++ b/frontend/src/hooks/api/appConnections/types/app-options.ts@@ -329,6 +329,10 @@ export type THasuraCloudConnectionOption = TAppConnectionOptionBase & {app: AppConnection.HasuraCloud;};+export type TNutanixPrismCentralConnectionOption = TAppConnectionOptionBase & {+ app: AppConnection.NutanixPrismCentral;+};+export type TAppConnectionOption =| TAwsConnectionOption| TGitHubConnectionOption@@ -408,7 +412,8 @@ export type TAppConnectionOption =| THasuraCloudConnectionOption| TQoveryConnectionOption| TLiteLLMConnectionOption- | TFireworksConnectionOption;+ | TFireworksConnectionOption+ | TNutanixPrismCentralConnectionOption;export type TAppConnectionOptionMap = {[AppConnection.AWS]: TAwsConnectionOption;@@ -490,4 +495,5 @@ export type TAppConnectionOptionMap = {[AppConnection.Qovery]: TQoveryConnectionOption;[AppConnection.LiteLLM]: TLiteLLMConnectionOption;[AppConnection.Fireworks]: TFireworksConnectionOption;+ [AppConnection.NutanixPrismCentral]: TNutanixPrismCentralConnectionOption;};diff --git a/frontend/src/hooks/api/appConnections/types/index.ts b/frontend/src/hooks/api/appConnections/types/index.tsindex 0b8a8f4f66..8637f54520 100644--- a/frontend/src/hooks/api/appConnections/types/index.ts+++ b/frontend/src/hooks/api/appConnections/types/index.ts@@ -50,6 +50,7 @@ import { TMySqlConnection } from "./mysql-connection";import { TNetlifyConnection } from "./netlify-connection";import { TNetScalerConnection } from "./netscaler-connection";import { TNorthflankConnection } from "./northflank-connection";+import { TNutanixPrismCentralConnection } from "./nutanix-prism-central-connection";import { TOCIConnection } from "./oci-connection";import { TOctopusDeployConnection } from "./octopus-deploy-connection";import { TOktaConnection } from "./okta-connection";@@ -127,6 +128,7 @@ export * from "./mysql-connection";export * from "./netlify-connection";export * from "./netscaler-connection";export * from "./northflank-connection";+export * from "./nutanix-prism-central-connection";export * from "./oci-connection";export * from "./octopus-deploy-connection";export * from "./okta-connection";@@ -236,7 +238,8 @@ export type TAppConnection =| THasuraCloudConnection| TQoveryConnection| TLiteLLMConnection- | TFireworksConnection;+ | TFireworksConnection+ | TNutanixPrismCentralConnection;export type TAvailableAppConnection = Pick<TAppConnection, "name" | "id" | "projectId">;diff --git a/frontend/src/hooks/api/appConnections/types/nutanix-prism-central-connection.ts b/frontend/src/hooks/api/appConnections/types/nutanix-prism-central-connection.tsnew file mode 100644index 0000000000..9cb9ec7aaf--- /dev/null+++ b/frontend/src/hooks/api/appConnections/types/nutanix-prism-central-connection.ts@@ -0,0 +1,31 @@+import { AppConnection } from "@app/hooks/api/appConnections/enums";+import { TRootAppConnection } from "@app/hooks/api/appConnections/types/root-connection";++export enum NutanixPrismCentralConnectionMethod {+ ApiKey = "api-key",+ BasicAuth = "basic-auth"+}++type TApiKeyCredentials = {+ hostname: string;+ port?: number;+ sslRejectUnauthorized?: boolean;+ sslCertificate?: string;+ apiKey: string;+};++type TBasicAuthCredentials = {+ hostname: string;+ port?: number;+ sslRejectUnauthorized?: boolean;+ sslCertificate?: string;+ username: string;+ password: string;+};++export type TNutanixPrismCentralConnection = TRootAppConnection & {+ app: AppConnection.NutanixPrismCentral;+} & (+ | { method: NutanixPrismCentralConnectionMethod.ApiKey; credentials: TApiKeyCredentials }+ | { method: NutanixPrismCentralConnectionMethod.BasicAuth; credentials: TBasicAuthCredentials }+ );diff --git a/frontend/src/hooks/api/pkiSyncs/enums.ts b/frontend/src/hooks/api/pkiSyncs/enums.tsindex ff8203bb9c..05143945f7 100644--- a/frontend/src/hooks/api/pkiSyncs/enums.ts+++ b/frontend/src/hooks/api/pkiSyncs/enums.ts@@ -8,7 +8,8 @@ export enum PkiSync {NetScaler = "netscaler",F5BigIp = "f5-big-ip",LinuxServer = "linux-server",- WindowsServer = "windows-server"+ WindowsServer = "windows-server",+ NutanixPrismCentral = "nutanix-prism-central"}export enum PkiSyncExportFormat {diff --git a/frontend/src/hooks/api/pkiSyncs/types/index.ts b/frontend/src/hooks/api/pkiSyncs/types/index.tsindex a2082896f1..eb971536d5 100644--- a/frontend/src/hooks/api/pkiSyncs/types/index.ts+++ b/frontend/src/hooks/api/pkiSyncs/types/index.ts@@ -9,6 +9,7 @@ import { TCloudflareCustomCertificatePkiSync } from "./cloudflare-custom-certifiimport { TF5BigIpPkiSync } from "./f5-big-ip-sync";import { TLinuxServerPkiSync } from "./linux-server-sync";import { TNetScalerPkiSync } from "./netscaler-sync";+import { TNutanixPrismCentralPkiSync } from "./nutanix-prism-central-sync";import { TWindowsServerPkiSync } from "./windows-server-sync";export type TPkiSyncOption = {@@ -16,6 +17,7 @@ export type TPkiSyncOption = {destination: PkiSync;canImportCertificates: boolean;canRemoveCertificates: boolean;+ maxCertificates?: number;enterprise?: boolean;defaultCertificateNameSchema?: string;forbiddenCharacters?: string;@@ -34,7 +36,8 @@ export type TPkiSync =| TNetScalerPkiSync| TF5BigIpPkiSync| TLinuxServerPkiSync- | TWindowsServerPkiSync;+ | TWindowsServerPkiSync+ | TNutanixPrismCentralPkiSync;export type TListPkiSyncs = { pkiSyncs: TPkiSync[] };@@ -93,6 +96,8 @@ export type TCreatePkiSyncDTO = TCreatePkiSyncDTOBase & {profileName?: string;createProfileIfMissing?: boolean;parentProfile?: string;+ clusterId?: string;+ clusterName?: string;destinationPath?: string;};};@@ -136,4 +141,5 @@ export * from "./common";export * from "./f5-big-ip-sync";export * from "./linux-server-sync";export * from "./netscaler-sync";+export * from "./nutanix-prism-central-sync";export * from "./windows-server-sync";diff --git a/frontend/src/hooks/api/pkiSyncs/types/nutanix-prism-central-sync.ts b/frontend/src/hooks/api/pkiSyncs/types/nutanix-prism-central-sync.tsnew file mode 100644index 0000000000..1f534a869f--- /dev/null+++ b/frontend/src/hooks/api/pkiSyncs/types/nutanix-prism-central-sync.ts@@ -0,0 +1,17 @@+import { AppConnection } from "@app/hooks/api/appConnections/enums";++import { PkiSync } from "../enums";+import { TRootPkiSync } from "./common";++export type TNutanixPrismCentralPkiSync = TRootPkiSync & {+ destination: PkiSync.NutanixPrismCentral;+ destinationConfig: {+ clusterId: string;+ clusterName: string;+ };+ connection: {+ app: AppConnection.NutanixPrismCentral;+ name: string;+ id: string;+ };+};diff --git a/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncRow.tsx b/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncRow.tsxindex c7f4d52bb5..3f798666ab 100644--- a/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncRow.tsx+++ b/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncRow.tsx@@ -302,25 +302,27 @@ export const PkiSyncRow = ({</Tooltip></DropdownMenuItem>)}- <DropdownMenuItem- icon={<FontAwesomeIcon icon={faEraser} />}- onClick={(e) => {- e.stopPropagation();- onTriggerRemoveCertificates(pkiSync);- }}- isDisabled={!canRemoveCertificates}- >- <Tooltip- position="left"- sideOffset={42}- content={`Remove certificates synced by Infisical from this ${destinationName} destination.`}+ {syncOption?.canRemoveCertificates && (+ <DropdownMenuItem+ icon={<FontAwesomeIcon icon={faEraser} />}+ onClick={(e) => {+ e.stopPropagation();+ onTriggerRemoveCertificates(pkiSync);+ }}+ isDisabled={!canRemoveCertificates}>- <div className="flex h-full w-full items-center justify-between gap-1">- <span>Remove Certificates</span>- <FontAwesomeIcon className="text-bunker-300" size="sm" icon={faInfoCircle} />- </div>- </Tooltip>- </DropdownMenuItem>+ <Tooltip+ position="left"+ sideOffset={42}+ content={`Remove certificates synced by Infisical from this ${destinationName} destination.`}+ >+ <div className="flex h-full w-full items-center justify-between gap-1">+ <span>Remove Certificates</span>+ <FontAwesomeIcon className="text-bunker-300" size="sm" icon={faInfoCircle} />+ </div>+ </Tooltip>+ </DropdownMenuItem>+ )}<DropdownMenuItemisDisabled={!canEditSync}icon={<FontAwesomeIcon icon={isAutoSyncEnabled ? faToggleOff : faToggleOn} />}diff --git a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncActionTriggers.tsx b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncActionTriggers.tsxindex 5ca99e4f9f..b36f43f406 100644--- a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncActionTriggers.tsx+++ b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncActionTriggers.tsx@@ -188,22 +188,24 @@ export const PkiSyncActionTriggers = ({ pkiSync }: Props) => {</DropdownMenuItem>)}- <DropdownMenuItem- icon={<FontAwesomeIcon icon={faEraser} />}- onClick={() => handlePopUpOpen("removeCertificates")}- isDisabled={!canRemoveCertificates}- >- <Tooltip- position="left"- sideOffset={42}- content={`Remove certificates synced by Infisical from this ${destinationName} destination.`}+ {syncOption?.canRemoveCertificates && (+ <DropdownMenuItem+ icon={<FontAwesomeIcon icon={faEraser} />}+ onClick={() => handlePopUpOpen("removeCertificates")}+ isDisabled={!canRemoveCertificates}>- <div className="flex h-full w-full items-center justify-between gap-1">- <span>Remove Certificates</span>- <FontAwesomeIcon className="text-bunker-300" size="sm" icon={faInfoCircle} />- </div>- </Tooltip>- </DropdownMenuItem>+ <Tooltip+ position="left"+ sideOffset={42}+ content={`Remove certificates synced by Infisical from this ${destinationName} destination.`}+ >+ <div className="flex h-full w-full items-center justify-between gap-1">+ <span>Remove Certificates</span>+ <FontAwesomeIcon className="text-bunker-300" size="sm" icon={faInfoCircle} />+ </div>+ </Tooltip>+ </DropdownMenuItem>+ )}<DropdownMenuItemisDisabled={!canEditSync || updatePkiSyncMutation.isPending}@@ -234,11 +236,13 @@ export const PkiSyncActionTriggers = ({ pkiSync }: Props) => {pkiSync={pkiSync}/>)}- <PkiSyncRemoveCertificatesModal- onOpenChange={(isOpen) => handlePopUpToggle("removeCertificates", isOpen)}- isOpen={popUp.removeCertificates.isOpen}- pkiSync={pkiSync}- />+ {syncOption?.canRemoveCertificates && (+ <PkiSyncRemoveCertificatesModal+ onOpenChange={(isOpen) => handlePopUpToggle("removeCertificates", isOpen)}+ isOpen={popUp.removeCertificates.isOpen}+ pkiSync={pkiSync}+ />+ )}<DeletePkiSyncModalonOpenChange={(isOpen) => handlePopUpToggle("deleteSync", isOpen)}isOpen={popUp.deleteSync.isOpen}diff --git a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection.tsx b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection.tsxindex c24e1f2aee..08a94fc662 100644--- a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection.tsx+++ b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection.tsx@@ -16,6 +16,7 @@ import {F5BigIpPkiSyncDestinationSection,LinuxServerPkiSyncDestinationSection,NetScalerPkiSyncDestinationSection,+ NutanixPrismCentralPkiSyncDestinationSection,WindowsServerPkiSyncDestinationSection} from "./PkiSyncDestinationSection/index";@@ -65,6 +66,9 @@ export const PkiSyncDestinationSection = ({ pkiSync, onEditDestination }: Props)case PkiSync.WindowsServer:DestinationComponents = <WindowsServerPkiSyncDestinationSection pkiSync={pkiSync} />;break;+ case PkiSync.NutanixPrismCentral:+ DestinationComponents = <NutanixPrismCentralPkiSyncDestinationSection pkiSync={pkiSync} />;+ break;default:// For future destinations, return null (no additional fields to show)DestinationComponents = null;diff --git a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/NutanixPrismCentralPkiSyncDestinationSection.tsx b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/NutanixPrismCentralPkiSyncDestinationSection.tsxnew file mode 100644index 0000000000..87f64d146a--- /dev/null+++ b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/NutanixPrismCentralPkiSyncDestinationSection.tsx@@ -0,0 +1,23 @@+import { TNutanixPrismCentralPkiSync } from "@app/hooks/api/pkiSyncs/types/nutanix-prism-central-sync";++const GenericFieldLabel = ({ label, children }: { label: string; children: React.ReactNode }) => (+ <div className="mb-4">+ <p className="text-sm font-medium text-mineshaft-300">{label}</p>+ <div className="text-sm text-mineshaft-300">{children}</div>+ </div>+);++type Props = {+ pkiSync: TNutanixPrismCentralPkiSync;+};++export const NutanixPrismCentralPkiSyncDestinationSection = ({ pkiSync }: Props) => {+ const { clusterName, clusterId } = pkiSync.destinationConfig;++ return (+ <>+ <GenericFieldLabel label="Cluster Name">{clusterName}</GenericFieldLabel>+ <GenericFieldLabel label="Cluster ID">{clusterId}</GenericFieldLabel>+ </>+ );+};diff --git a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/index.ts b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/index.tsindex 435fde4d0d..02ceb00ceb 100644--- a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/index.ts+++ b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/index.ts@@ -6,4 +6,5 @@ export { ChefPkiSyncDestinationSection } from "./ChefPkiSyncDestinationSection";export { F5BigIpPkiSyncDestinationSection } from "./F5BigIpPkiSyncDestinationSection";export { LinuxServerPkiSyncDestinationSection } from "./LinuxServerPkiSyncDestinationSection";export { NetScalerPkiSyncDestinationSection } from "./NetScalerPkiSyncDestinationSection";+export { NutanixPrismCentralPkiSyncDestinationSection } from "./NutanixPrismCentralPkiSyncDestinationSection";export { WindowsServerPkiSyncDestinationSection } from "./WindowsServerPkiSyncDestinationSection";diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsxindex 648766e265..1b100791d0 100644--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx@@ -65,6 +65,7 @@ import { MySqlConnectionForm } from "./MySqlConnectionForm";import { NetlifyConnectionForm } from "./NetlifyConnectionForm";import { NetScalerConnectionForm } from "./NetScalerConnectionForm";import { NorthflankConnectionForm } from "./NorthflankConnectionForm";+import { NutanixPrismCentralConnectionForm } from "./NutanixPrismCentralConnectionForm";import { OCIConnectionForm } from "./OCIConnectionForm";import { OctopusDeployConnectionForm } from "./OctopusDeployConnectionForm";import { OktaConnectionForm } from "./OktaConnectionForm";@@ -351,6 +352,8 @@ const CreateForm = ({ app, onComplete, projectId }: CreateFormProps) => {return <ConvexConnectionForm onSubmit={onSubmit} />;case AppConnection.Rundeck:return <RundeckConnectionForm onSubmit={onSubmit} />;+ case AppConnection.NutanixPrismCentral:+ return <NutanixPrismCentralConnectionForm onSubmit={onSubmit} />;default:throw new Error(`Unhandled App ${app}`);}@@ -614,6 +617,10 @@ const UpdateForm = ({ appConnection, onComplete }: UpdateFormProps) => {return <ConvexConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;case AppConnection.Rundeck:return <RundeckConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;+ case AppConnection.NutanixPrismCentral:+ return (+ <NutanixPrismCentralConnectionForm onSubmit={onSubmit} appConnection={appConnection} />+ );case AppConnection.Venafi:return <VenafiConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;case AppConnection.VenafiTpp:diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/NutanixPrismCentralConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/NutanixPrismCentralConnectionForm.tsxnew file mode 100644index 0000000000..54d05c9d9e--- /dev/null+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/NutanixPrismCentralConnectionForm.tsx@@ -0,0 +1,378 @@+import { useState } from "react";+import { Controller, FormProvider, useForm } from "react-hook-form";+import { zodResolver } from "@hookform/resolvers/zod";+import { Info } from "lucide-react";+import { z } from "zod";++import { OrgPermissionCan } from "@app/components/permissions";+import {+ Field,+ FieldContent,+ FieldDescription,+ FieldError,+ FieldLabel,+ Input,+ Label,+ SecretInput,+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,+ Switch,+ Tabs,+ TabsContent,+ TabsList,+ TabsTrigger,+ TextArea,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";+import { GatewayPicker } from "@app/components/v3/platform/GatewayPicker";+import { OrgPermissionSubjects } from "@app/context";+import { OrgGatewayPermissionActions } from "@app/context/OrgPermissionContext/types";+import { APP_CONNECTION_MAP, getAppConnectionMethodDetails } from "@app/helpers/appConnections";+import { useScopeVariant } from "@app/hooks";+import {+ NutanixPrismCentralConnectionMethod,+ TNutanixPrismCentralConnection+} from "@app/hooks/api/appConnections";+import { AppConnection } from "@app/hooks/api/appConnections/enums";++import { AppConnectionFormFooter } from "./AppConnectionFormFooter";+import {+ genericAppConnectionFieldsSchema,+ GenericAppConnectionsFields+} from "./GenericAppConnectionFields";++type Props = {+ appConnection?: TNutanixPrismCentralConnection;+ onSubmit: (formData: FormData) => Promise<void>;+};++const rootSchema = genericAppConnectionFieldsSchema.extend({+ app: z.literal(AppConnection.NutanixPrismCentral)+});++const credentialsBase = z.object({+ hostname: z+ .string()+ .trim()+ .min(1, "Hostname is required")+ .max(512, "Hostname cannot exceed 512 characters")+ .refine(+ (val) =>+ !val.includes("/") &&+ !val.includes("@") &&+ !val.includes("?") &&+ !val.includes(":") &&+ !val.includes("#"),+ { message: "Hostname must not contain /, @, ?, :, or # characters" }+ ),+ port: z+ .union([z.coerce.number().int().min(1).max(65535), z.literal("")])+ .optional()+ .transform((val) => (val === "" ? undefined : val)),+ sslRejectUnauthorized: z.boolean(),+ sslCertificate: z+ .string()+ .trim()+ .transform((value) => value || undefined)+ .optional()+});++const formSchema = z.discriminatedUnion("method", [+ rootSchema.extend({+ method: z.literal(NutanixPrismCentralConnectionMethod.ApiKey),+ credentials: credentialsBase.extend({+ apiKey: z+ .string()+ .trim()+ .regex(/^[0-9a-f]{32}$/, "API key must be a 32-character lowercase hexadecimal string")+ })+ }),+ rootSchema.extend({+ method: z.literal(NutanixPrismCentralConnectionMethod.BasicAuth),+ credentials: credentialsBase.extend({+ username: z+ .string()+ .trim()+ .min(1, "Username is required")+ .max(256, "Username cannot exceed 256 characters"),+ password: z+ .string()+ .trim()+ .min(1, "Password is required")+ .max(512, "Password cannot exceed 512 characters")+ })+ })+]);++type FormData = z.infer<typeof formSchema>;++export const NutanixPrismCentralConnectionForm = ({ appConnection, onSubmit }: Props) => {+ const isUpdate = Boolean(appConnection);+ const [selectedTab, setSelectedTab] = useState("configuration");++ const form = useForm<FormData>({+ resolver: zodResolver(formSchema),+ defaultValues: appConnection ?? {+ app: AppConnection.NutanixPrismCentral,+ method: NutanixPrismCentralConnectionMethod.BasicAuth,+ gatewayId: null,+ gatewayPoolId: null,+ credentials: {+ sslRejectUnauthorized: true,+ sslCertificate: undefined+ }+ }+ });++ const { handleSubmit, control, setValue, watch } = form;+ const scopeVariant = useScopeVariant();++ const method = watch("method");+ const gatewayId = watch("gatewayId");+ const gatewayPoolId = watch("gatewayPoolId");++ return (+ <FormProvider {...form}>+ <form onSubmit={handleSubmit(onSubmit)}>+ {!isUpdate && <GenericAppConnectionsFields />}+ <OrgPermissionCan+ I={OrgGatewayPermissionActions.AttachGateways}+ a={OrgPermissionSubjects.Gateway}+ >+ {(isAllowed) => {+ const picker = (+ <GatewayPicker+ isDisabled={!isAllowed}+ value={{ gatewayId: gatewayId ?? null, gatewayPoolId: gatewayPoolId ?? null }}+ onChange={({ gatewayId: newGwId, gatewayPoolId: newPoolId }) => {+ setValue("gatewayId", newGwId, { shouldDirty: true });+ setValue("gatewayPoolId", newPoolId, { shouldDirty: true });+ }}+ />+ );++ return (+ <Field className="mb-4">+ <FieldLabel>Gateway</FieldLabel>+ {isAllowed ? (+ picker+ ) : (+ <Tooltip>+ <TooltipTrigger asChild>+ <span className="block w-full cursor-not-allowed">{picker}</span>+ </TooltipTrigger>+ <TooltipContent>+ Restricted access. You don't have permission to attach gateways to+ resources.+ </TooltipContent>+ </Tooltip>+ )}+ </Field>+ );+ }}+ </OrgPermissionCan>+ <Controller+ name="method"+ control={control}+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="method">+ Method+ <Tooltip>+ <TooltipTrigger asChild>+ <Info />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">+ {`The method you would like to use to connect with ${+ APP_CONNECTION_MAP[AppConnection.NutanixPrismCentral].name+ }. This field cannot be changed after creation.`}+ </TooltipContent>+ </Tooltip>+ </FieldLabel>+ <Select disabled={isUpdate} value={value} onValueChange={(val) => onChange(val)}>+ <SelectTrigger id="method" className="w-full" isError={Boolean(error)}>+ <SelectValue placeholder="Select a method..." />+ </SelectTrigger>+ <SelectContent position="popper">+ {Object.values(NutanixPrismCentralConnectionMethod).map((m) => {+ return (+ <SelectItem value={m} key={m}>+ {getAppConnectionMethodDetails(m).name}+ </SelectItem>+ );+ })}+ </SelectContent>+ </Select>+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Tabs value={selectedTab} onValueChange={setSelectedTab} className="mb-4">+ <TabsList variant={scopeVariant}>+ <TabsTrigger value="configuration">Configuration</TabsTrigger>+ <TabsTrigger value="ssl">SSL</TabsTrigger>+ </TabsList>+ <TabsContent value="configuration">+ <div className="grid grid-cols-[1fr_auto] gap-2">+ <Controller+ name="credentials.hostname"+ control={control}+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="hostname">Hostname</FieldLabel>+ <Input+ id="hostname"+ value={value}+ onChange={(e) => onChange(e.target.value)}+ placeholder="e.g. prism.example.com"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ name="credentials.port"+ control={control}+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="port">+ Port <span className="text-muted">(optional)</span>+ </FieldLabel>+ <Input+ id="port"+ type="number"+ placeholder="9440"+ {...field}+ value={field.value ?? ""}+ className="w-24"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ </div>+ {method === NutanixPrismCentralConnectionMethod.ApiKey && (+ <Controller+ name="credentials.apiKey"+ control={control}+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="api-key">+ API Key+ <Tooltip>+ <TooltipTrigger asChild>+ <Info />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">+ A Nutanix API key with permission to manage SSL certificates.+ </TooltipContent>+ </Tooltip>+ </FieldLabel>+ <SecretInput+ id="api-key"+ value={value}+ onChange={(e) => onChange(e.target.value)}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ )}+ {method === NutanixPrismCentralConnectionMethod.BasicAuth && (+ <div className="grid grid-cols-2 gap-2">+ <Controller+ name="credentials.username"+ control={control}+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="username">Username</FieldLabel>+ <Input+ id="username"+ value={value}+ onChange={(e) => onChange(e.target.value)}+ placeholder="admin"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ name="credentials.password"+ control={control}+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="password">Password</FieldLabel>+ <SecretInput+ id="password"+ value={value}+ onChange={(e) => onChange(e.target.value)}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ </div>+ )}+ </TabsContent>+ <TabsContent value="ssl">+ <Controller+ name="credentials.sslCertificate"+ control={control}+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="ssl-certificate">+ SSL Certificate <span className="text-muted">(optional)</span>+ </FieldLabel>+ <TextArea+ id="ssl-certificate"+ className="h-[3.6rem] resize-none!"+ {...field}+ placeholder="-----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ name="credentials.sslRejectUnauthorized"+ control={control}+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <Field>+ <Field orientation="horizontal">+ <FieldContent>+ <Label htmlFor="ssl-reject-unauthorized">Reject Unauthorized</Label>+ <FieldDescription>+ If enabled, Infisical will only connect if Prism Central presents a valid,+ trusted SSL certificate. Disable this for self-signed certificates or+ provide a CA certificate above.+ </FieldDescription>+ </FieldContent>+ <Switch+ id="ssl-reject-unauthorized"+ variant={scopeVariant}+ checked={value}+ onCheckedChange={onChange}+ />+ </Field>+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ </TabsContent>+ </Tabs>+ <AppConnectionFormFooter+ submitLabel={isUpdate ? "Update Credentials" : "Connect to Nutanix Prism Central"}+ />+ </form>+ </FormProvider>+ );+};