Skip to content

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

add secret sync option

adilson8ded7909acdf
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index c1df640a04..94181693a2 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -2794,10 +2794,10 @@ export const AppConnections = {
apiKey: "The Anthropic API key used to authenticate with the Anthropic API."
},
OVH: {
- pkcs12Certificate:
- "The base64-encoded contents of the PKCS#12 (.p12/.pfx) bundle issued by OVH OKMS, containing the client certificate and private key.",
- pkcs12Passphrase:
- "The passphrase that protects the PKCS#12 bundle. Leave empty if the bundle was exported without a passphrase.",
+ privateKey:
+ "The PEM-encoded private key issued by OVH OKMS for client certificate authentication (including the -----BEGIN/END PRIVATE KEY----- markers).",
+ certificate:
+ "The PEM-encoded public certificate issued by OVH OKMS for client certificate authentication (including the -----BEGIN/END CERTIFICATE----- markers).",
okmsDomain:
"The OKMS base URL, including any path prefix (e.g., 'https://ca-east-bhs.okms.ovh.net/api'). The OKMS ID and API version are appended automatically.",
okmsId: "The OKMS instance identifier from the OVH Control Panel, used as a path segment in all API calls."
@@ -2999,6 +2999,9 @@ export const SecretSyncs = {
mount: "The Hashicorp Vault Secrets Engine Mount to sync secrets to.",
path: "The Hashicorp Vault path to sync secrets to."
},
+ OVH: {
+ path: "The path in OVH OKMS where secrets will be stored as key/value pairs."
+ },
TEAMCITY: {
project: "The TeamCity project to sync secrets to.",
buildConfig: "The TeamCity build configuration to sync secrets to."
diff --git a/backend/src/server/routes/v1/secret-sync-routers/index.ts b/backend/src/server/routes/v1/secret-sync-routers/index.ts
index abe6d17f25..0a1570e7f3 100644
--- a/backend/src/server/routes/v1/secret-sync-routers/index.ts
+++ b/backend/src/server/routes/v1/secret-sync-routers/index.ts
@@ -29,6 +29,7 @@ import { registerLaravelForgeSyncRouter } from "./laravel-forge-sync-router";
import { registerNetlifySyncRouter } from "./netlify-sync-router";
import { registerNorthflankSyncRouter } from "./northflank-sync-router";
import { registerOctopusDeploySyncRouter } from "./octopus-deploy-sync-router";
+import { registerOvhSyncRouter } from "./ovh-sync-router";
import { registerRailwaySyncRouter } from "./railway-sync-router";
import { registerRenderSyncRouter } from "./render-sync-router";
import { registerSupabaseSyncRouter } from "./supabase-sync-router";
@@ -77,5 +78,6 @@ export const SECRET_SYNC_REGISTER_ROUTER_MAP: Record<SecretSync, (server: Fastif
[SecretSync.OctopusDeploy]: registerOctopusDeploySyncRouter,
[SecretSync.CircleCI]: registerCircleCISyncRouter,
[SecretSync.AzureEntraIdScim]: registerAzureEntraIdScimSyncRouter,
- [SecretSync.ExternalInfisical]: registerExternalInfisicalSyncRouter
+ [SecretSync.ExternalInfisical]: registerExternalInfisicalSyncRouter,
+ [SecretSync.OVH]: registerOvhSyncRouter
};
diff --git a/backend/src/server/routes/v1/secret-sync-routers/ovh-sync-router.ts b/backend/src/server/routes/v1/secret-sync-routers/ovh-sync-router.ts
new file mode 100644
index 0000000000..bafe1a417b
--- /dev/null
+++ b/backend/src/server/routes/v1/secret-sync-routers/ovh-sync-router.ts
@@ -0,0 +1,13 @@
+import { CreateOvhSyncSchema, OvhSyncSchema, UpdateOvhSyncSchema } from "@app/services/secret-sync/ovh";
+import { SecretSync } from "@app/services/secret-sync/secret-sync-enums";
+
+import { registerSyncSecretsEndpoints } from "./secret-sync-endpoints";
+
+export const registerOvhSyncRouter = async (server: FastifyZodProvider) =>
+ registerSyncSecretsEndpoints({
+ destination: SecretSync.OVH,
+ server,
+ responseSchema: OvhSyncSchema,
+ createSchema: CreateOvhSyncSchema,
+ updateSchema: UpdateOvhSyncSchema
+ });
diff --git a/backend/src/server/routes/v1/secret-sync-routers/secret-sync-router.ts b/backend/src/server/routes/v1/secret-sync-routers/secret-sync-router.ts
index 5b10c51756..5b7121eea5 100644
--- a/backend/src/server/routes/v1/secret-sync-routers/secret-sync-router.ts
+++ b/backend/src/server/routes/v1/secret-sync-routers/secret-sync-router.ts
@@ -58,6 +58,7 @@ import { LaravelForgeSyncListItemSchema, LaravelForgeSyncSchema } from "@app/ser
import { NetlifySyncListItemSchema, NetlifySyncSchema } from "@app/services/secret-sync/netlify";
import { NorthflankSyncListItemSchema, NorthflankSyncSchema } from "@app/services/secret-sync/northflank";
import { OctopusDeploySyncListItemSchema, OctopusDeploySyncSchema } from "@app/services/secret-sync/octopus-deploy";
+import { OvhSyncListItemSchema, OvhSyncSchema } from "@app/services/secret-sync/ovh";
import { RailwaySyncListItemSchema, RailwaySyncSchema } from "@app/services/secret-sync/railway/railway-sync-schemas";
import { RenderSyncListItemSchema, RenderSyncSchema } from "@app/services/secret-sync/render/render-sync-schemas";
import { SupabaseSyncListItemSchema, SupabaseSyncSchema } from "@app/services/secret-sync/supabase";
@@ -104,7 +105,8 @@ const SecretSyncSchema = z.discriminatedUnion("destination", [
OctopusDeploySyncSchema,
CircleCISyncSchema,
AzureEntraIdScimSyncSchema,
- ExternalInfisicalSyncSchema
+ ExternalInfisicalSyncSchema,
+ OvhSyncSchema
]);
const SecretSyncOptionsSchema = z.discriminatedUnion("destination", [
@@ -144,7 +146,8 @@ const SecretSyncOptionsSchema = z.discriminatedUnion("destination", [
OctopusDeploySyncListItemSchema,
CircleCISyncListItemSchema,
AzureEntraIdScimSyncListItemSchema,
- ExternalInfisicalSyncListItemSchema
+ ExternalInfisicalSyncListItemSchema,
+ OvhSyncListItemSchema
]);
export const registerSecretSyncRouter = async (server: FastifyZodProvider) => {
diff --git a/backend/src/services/app-connection/app-connection-fns.ts b/backend/src/services/app-connection/app-connection-fns.ts
index 83a59ace21..9cea07d5b9 100644
--- a/backend/src/services/app-connection/app-connection-fns.ts
+++ b/backend/src/services/app-connection/app-connection-fns.ts
@@ -546,8 +546,8 @@ export const getAppConnectionMethodName = (method: TAppConnection["method"]) =>
return "Machine Identity - Universal Auth";
case DopplerConnectionMethod.ApiToken:
return "API Token";
- case OVHConnectionMethod.Pkcs12Certificate:
- return "PKCS#12 Certificate";
+ case OVHConnectionMethod.Certificate:
+ return "Certificate";
default:
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
throw new Error(`Unhandled App Connection Method: ${method}`);
diff --git a/backend/src/services/app-connection/ovh/ovh-connection-enums.ts b/backend/src/services/app-connection/ovh/ovh-connection-enums.ts
index 7408c932ef..c2bd60bb36 100644
--- a/backend/src/services/app-connection/ovh/ovh-connection-enums.ts
+++ b/backend/src/services/app-connection/ovh/ovh-connection-enums.ts
@@ -1,3 +1,3 @@
export enum OVHConnectionMethod {
- Pkcs12Certificate = "pkcs12-certificate"
+ Certificate = "certificate"
}
diff --git a/backend/src/services/app-connection/ovh/ovh-connection-fns.ts b/backend/src/services/app-connection/ovh/ovh-connection-fns.ts
index d97bcb7708..0ec5bc31c1 100644
--- a/backend/src/services/app-connection/ovh/ovh-connection-fns.ts
+++ b/backend/src/services/app-connection/ovh/ovh-connection-fns.ts
@@ -6,28 +6,34 @@ import { validateSsrfUrl } from "@app/lib/validator/validate-url";
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
import { OVHConnectionMethod } from "./ovh-connection-enums";
-import { TOvhConnectionConfig } from "./ovh-connection-types";
+import { TOvhConnection, TOvhConnectionConfig } from "./ovh-connection-types";
export const getOvhConnectionListItem = () => {
return {
name: "OVH" as const,
app: AppConnection.OVH as const,
- methods: Object.values(OVHConnectionMethod) as [OVHConnectionMethod.Pkcs12Certificate]
+ methods: Object.values(OVHConnectionMethod) as [OVHConnectionMethod.Certificate]
};
};
+export const getOvhHttpsAgent = (connection: Pick<TOvhConnection, "credentials"> | TOvhConnectionConfig) => {
+ const { privateKey, certificate } = connection.credentials;
+
+ return new https.Agent({
+ key: privateKey,
+ cert: certificate
+ });
+};
+
export const validateOvhConnectionCredentials = async (config: TOvhConnectionConfig) => {
- const { pkcs12Certificate, pkcs12Passphrase, okmsDomain, okmsId } = config.credentials;
+ const { okmsDomain, okmsId } = config.credentials;
await validateSsrfUrl(okmsDomain);
- const httpsAgent = new https.Agent({
- pfx: Buffer.from(pkcs12Certificate, "base64"),
- passphrase: pkcs12Passphrase
- });
+ const httpsAgent = getOvhHttpsAgent(config);
try {
- await request.get(`${okmsDomain}/${encodeURIComponent(okmsId)}/v1/servicekey`, {
+ await request.get(`${okmsDomain}/api/${encodeURIComponent(okmsId)}/v1/servicekey`, {
httpsAgent,
timeout: 15000,
validateStatus: (status) => status === 200
diff --git a/backend/src/services/app-connection/ovh/ovh-connection-schemas.ts b/backend/src/services/app-connection/ovh/ovh-connection-schemas.ts
index 3cec7ab0e1..5ff0ca3ced 100644
--- a/backend/src/services/app-connection/ovh/ovh-connection-schemas.ts
+++ b/backend/src/services/app-connection/ovh/ovh-connection-schemas.ts
@@ -11,13 +11,9 @@ import {
import { APP_CONNECTION_NAME_MAP } from "../app-connection-maps";
import { OVHConnectionMethod } from "./ovh-connection-enums";
-export const OvhConnectionPkcs12CredentialsSchema = z.object({
- pkcs12Certificate: z
- .string()
- .trim()
- .min(1, "PKCS#12 certificate required")
- .describe(AppConnections.CREDENTIALS.OVH.pkcs12Certificate),
- pkcs12Passphrase: z.string().optional().describe(AppConnections.CREDENTIALS.OVH.pkcs12Passphrase),
+export const OvhConnectionCertificateCredentialsSchema = z.object({
+ privateKey: z.string().trim().min(1, "Private key required").describe(AppConnections.CREDENTIALS.OVH.privateKey),
+ certificate: z.string().trim().min(1, "Certificate required").describe(AppConnections.CREDENTIALS.OVH.certificate),
okmsDomain: z.string().trim().min(1, "OKMS domain required").describe(AppConnections.CREDENTIALS.OVH.okmsDomain),
okmsId: z.string().trim().min(1, "OKMS ID required").describe(AppConnections.CREDENTIALS.OVH.okmsId)
});
@@ -25,24 +21,26 @@ export const OvhConnectionPkcs12CredentialsSchema = z.object({
const BaseOvhConnectionSchema = BaseAppConnectionSchema.extend({ app: z.literal(AppConnection.OVH) });
export const OvhConnectionSchema = BaseOvhConnectionSchema.extend({
- method: z.literal(OVHConnectionMethod.Pkcs12Certificate),
- credentials: OvhConnectionPkcs12CredentialsSchema
+ method: z.literal(OVHConnectionMethod.Certificate),
+ credentials: OvhConnectionCertificateCredentialsSchema
});
export const SanitizedOvhConnectionSchema = z.discriminatedUnion("method", [
BaseOvhConnectionSchema.extend({
- method: z.literal(OVHConnectionMethod.Pkcs12Certificate),
- credentials: OvhConnectionPkcs12CredentialsSchema.pick({
+ method: z.literal(OVHConnectionMethod.Certificate),
+ credentials: OvhConnectionCertificateCredentialsSchema.pick({
okmsDomain: true,
okmsId: true
})
- }).describe(JSON.stringify({ title: `${APP_CONNECTION_NAME_MAP[AppConnection.OVH]} (PKCS#12 Certificate)` }))
+ }).describe(JSON.stringify({ title: `${APP_CONNECTION_NAME_MAP[AppConnection.OVH]} (Certificate)` }))
]);
export const ValidateOvhConnectionCredentialsSchema = z.discriminatedUnion("method", [
z.object({
- method: z.literal(OVHConnectionMethod.Pkcs12Certificate).describe(AppConnections.CREATE(AppConnection.OVH).method),
- credentials: OvhConnectionPkcs12CredentialsSchema.describe(AppConnections.CREATE(AppConnection.OVH).credentials)
+ method: z.literal(OVHConnectionMethod.Certificate).describe(AppConnections.CREATE(AppConnection.OVH).method),
+ credentials: OvhConnectionCertificateCredentialsSchema.describe(
+ AppConnections.CREATE(AppConnection.OVH).credentials
+ )
})
]);
@@ -52,7 +50,7 @@ export const CreateOvhConnectionSchema = ValidateOvhConnectionCredentialsSchema.
export const UpdateOvhConnectionSchema = z
.object({
- credentials: OvhConnectionPkcs12CredentialsSchema.optional().describe(
+ credentials: OvhConnectionCertificateCredentialsSchema.optional().describe(
AppConnections.UPDATE(AppConnection.OVH).credentials
)
})
diff --git a/backend/src/services/secret-sync/ovh/index.ts b/backend/src/services/secret-sync/ovh/index.ts
new file mode 100644
index 0000000000..84f2d68e37
--- /dev/null
+++ b/backend/src/services/secret-sync/ovh/index.ts
@@ -0,0 +1,4 @@
+export * from "./ovh-sync-constants";
+export * from "./ovh-sync-fns";
+export * from "./ovh-sync-schemas";
+export * from "./ovh-sync-types";
diff --git a/backend/src/services/secret-sync/ovh/ovh-sync-constants.ts b/backend/src/services/secret-sync/ovh/ovh-sync-constants.ts
new file mode 100644
index 0000000000..a147cc3ddc
--- /dev/null
+++ b/backend/src/services/secret-sync/ovh/ovh-sync-constants.ts
@@ -0,0 +1,11 @@
+import { AppConnection } from "@app/services/app-connection/app-connection-enums";
+import { SecretSync } from "@app/services/secret-sync/secret-sync-enums";
+import { TSecretSyncListItem } from "@app/services/secret-sync/secret-sync-types";
+
+export const OVH_SYNC_LIST_OPTION: TSecretSyncListItem = {
+ name: "OVH",
+ destination: SecretSync.OVH,
+ connection: AppConnection.OVH,
+ canRemoveSecretsOnDeletion: true,
+ canImportSecrets: true
+};
diff --git a/backend/src/services/secret-sync/ovh/ovh-sync-fns.ts b/backend/src/services/secret-sync/ovh/ovh-sync-fns.ts
new file mode 100644
index 0000000000..eca4f080d9
--- /dev/null
+++ b/backend/src/services/secret-sync/ovh/ovh-sync-fns.ts
@@ -0,0 +1,219 @@
+import { isAxiosError } from "axios";
+import https from "https";
+
+import { request } from "@app/lib/config/request";
+import { getOvhHttpsAgent } from "@app/services/app-connection/ovh";
+import { SecretSyncError } from "@app/services/secret-sync/secret-sync-errors";
+import { matchesSchema } from "@app/services/secret-sync/secret-sync-fns";
+import { TSecretMap } from "@app/services/secret-sync/secret-sync-types";
+
+import { TOvhSyncWithCredentials } from "./ovh-sync-types";
+
+const REQUEST_TIMEOUT_MS = 15_000;
+
+const getSecretUrl = (okmsDomain: string, okmsId: string, path: string) =>
+ `${okmsDomain}/api/${encodeURIComponent(okmsId)}/v2/secret/${encodeURIComponent(path)}`;
+
+type TOvhErrorBody = {
+ error_code?: number | string;
+ errors?: string[];
+ request_id?: string;
+};
+
+// Strip axios request config/headers out of the error before it bubbles up to
+// logs or API responses. Keep only the HTTP status and OVH's own error fields.
+const sanitizeOvhError = (error: unknown): Error => {
+ if (isAxiosError(error)) {
+ const status = error.response?.status;
+ const body = error.response?.data as TOvhErrorBody | undefined;
+ const parts: string[] = [];
+ if (status) parts.push(`HTTP ${status}`);
+ if (body?.error_code !== undefined) parts.push(`code=${body.error_code}`);
+ if (body?.errors?.length) parts.push(body.errors.join("; "));
+ if (body?.request_id) parts.push(`requestId=${body.request_id}`);
+ return new Error(`OVH OKMS request failed${parts.length ? `: ${parts.join(" ")}` : ""}`);
+ }
+ return new Error("OVH OKMS request failed");
+};
+
+// Shape of `GET /v2/secret/{path}?includeData=true` per OVH OKMS swagger.
+type TOvhGetSecretResponse = {
+ metadata?: { currentVersion?: number };
+ version?: { data?: Record<string, unknown> };
+};
+
+type TOvhSecretRead = {
+ exists: boolean;
+ data: Record<string, string>;
+ currentVersion: number | null;
+};
+
+const toStringRecord = (data: Record<string, unknown>): Record<string, string> => {
+ const result: Record<string, string> = {};
+ for (const [key, value] of Object.entries(data)) {
+ result[key] = typeof value === "string" ? value : JSON.stringify(value);
+ }
+ return result;
+};
+
+const readSecret = async (
+ okmsDomain: string,
+ okmsId: string,
+ path: string,
+ httpsAgent: https.Agent
+): Promise<TOvhSecretRead> => {
+ try {
+ const { data } = await request.get<TOvhGetSecretResponse>(
+ `${getSecretUrl(okmsDomain, okmsId, path)}?includeData=true`,
+ {
+ httpsAgent,
+ timeout: REQUEST_TIMEOUT_MS
+ }
+ );
+ return {
+ exists: true,
+ data: toStringRecord(data?.version?.data ?? {}),
+ currentVersion: data?.metadata?.currentVersion ?? null
+ };
+ } catch (err) {
+ if (isAxiosError(err) && err.response?.status === 404) {
+ return { exists: false, data: {}, currentVersion: null };
+ }
+ throw err;
+ }
+};
+
+const createSecret = async (
+ okmsDomain: string,
+ okmsId: string,
+ path: string,
+ data: Record<string, string>,
+ httpsAgent: https.Agent
+) =>
+ request.post(
+ `${okmsDomain}/api/${encodeURIComponent(okmsId)}/v2/secret`,
+ { path, version: { data } },
+ {
+ httpsAgent,
+ timeout: REQUEST_TIMEOUT_MS,
+ headers: {
+ "Content-Type": "application/json",
+ accept: "application/json"
+ }
+ }
+ );
+
+const updateSecret = async (
+ okmsDomain: string,
+ okmsId: string,
+ path: string,
+ data: Record<string, string>,
+ cas: number | null,
+ httpsAgent: https.Agent
+) => {
+ const base = getSecretUrl(okmsDomain, okmsId, path);
+ const url = cas !== null ? `${base}?cas=${cas}` : base;
+ return request.put(
+ url,
+ { version: { data } },
+ {
+ httpsAgent,
+ timeout: REQUEST_TIMEOUT_MS,
+ headers: {
+ "Content-Type": "application/json",
+ accept: "application/json"
+ }
+ }
+ );
+};
+
+const applyUpdate = async (
+ secretSync: TOvhSyncWithCredentials,
+ mutate: (existing: Record<string, string>) => { next: Record<string, string>; tainted: boolean }
+) => {
+ const {
+ connection,
+ destinationConfig: { path }
+ } = secretSync;
+ const { okmsDomain, okmsId } = connection.credentials;
+ const httpsAgent = getOvhHttpsAgent(connection);
+
+ try {
+ const { exists, data: existingData, currentVersion } = await readSecret(okmsDomain, okmsId, path, httpsAgent);
+
+ const { next, tainted } = mutate(existingData);
+ if (!tainted) return;
+
+ if (exists) {
+ await updateSecret(okmsDomain, okmsId, path, next, currentVersion, httpsAgent);
+ } else {
+ await createSecret(okmsDomain, okmsId, path, next, httpsAgent);
+ }
+ } catch (error) {
+ throw new SecretSyncError({ error: sanitizeOvhError(error) });
+ }
+};
+
+export const OvhSyncFns = {
+ syncSecrets: async (secretSync: TOvhSyncWithCredentials, secretMap: TSecretMap) => {
+ const {
+ environment,
+ syncOptions: { disableSecretDeletion, keySchema }
+ } = secretSync;
+
+ await applyUpdate(secretSync, (existing) => {
+ const next = { ...existing };
+ let tainted = false;
+
+ for (const [key, { value }] of Object.entries(secretMap)) {
+ if (value !== next[key]) {
+ next[key] = value;
+ tainted = true;
+ }
+ }
+
+ if (!disableSecretDeletion) {
+ for (const key of Object.keys(next)) {
+ // eslint-disable-next-line no-continue
+ if (!matchesSchema(key, environment?.slug || "", keySchema)) continue;
+ if (!(key in secretMap)) {
+ delete next[key];
+ tainted = true;
+ }
+ }
+ }
+
+ return { next, tainted };
+ });
+ },
+
+ getSecrets: async (secretSync: TOvhSyncWithCredentials): Promise<TSecretMap> => {
+ const {
+ connection,
+ destinationConfig: { path }
+ } = secretSync;
+ const { okmsDomain, okmsId } = connection.credentials;
+ const httpsAgent = getOvhHttpsAgent(connection);
+
+ try {
+ const { data } = await readSecret(okmsDomain, okmsId, path, httpsAgent);
+ return Object.fromEntries(Object.entries(data).map(([key, value]) => [key, { value }]));
+ } catch (error) {
+ throw new SecretSyncError({ error: sanitizeOvhError(error) });
+ }
+ },
+
+ removeSecrets: async (secretSync: TOvhSyncWithCredentials, secretMap: TSecretMap) => {
+ await applyUpdate(secretSync, (existing) => {
+ const next = { ...existing };
+ let tainted = false;
+ for (const key of Object.keys(secretMap)) {
+ if (key in next) {
+ delete next[key];
+ tainted = true;
+ }
+ }
+ return { next, tainted };
+ });
+ }
+};
diff --git a/backend/src/services/secret-sync/ovh/ovh-sync-schemas.ts b/backend/src/services/secret-sync/ovh/ovh-sync-schemas.ts
new file mode 100644
index 0000000000..3215f682c1
--- /dev/null
+++ b/backend/src/services/secret-sync/ovh/ovh-sync-schemas.ts
@@ -0,0 +1,55 @@
+import RE2 from "re2";
+import { z } from "zod";
+
+import { SecretSyncs } from "@app/lib/api-docs";
+import { AppConnection } from "@app/services/app-connection/app-connection-enums";
+import { SecretSync } from "@app/services/secret-sync/secret-sync-enums";
+import {
+ BaseSecretSyncSchema,
+ GenericCreateSecretSyncFieldsSchema,
+ GenericUpdateSecretSyncFieldsSchema
+} from "@app/services/secret-sync/secret-sync-schemas";
+import { TSyncOptionsConfig } from "@app/services/secret-sync/secret-sync-types";
+
+import { SECRET_SYNC_NAME_MAP } from "../secret-sync-maps";
+
+const OvhSyncDestinationConfigSchema = z.object({
+ path: z
+ .string()
+ .trim()
+ .min(1, "Path required")
+ .max(128)
+ .transform((val) => new RE2("^/+|/+$", "g").replace(val, ""))
+ .refine((val) => new RE2("^([a-zA-Z0-9._-]+/)*[a-zA-Z0-9._-]+$").test(val), {
+ message:
+ "Invalid OVH OKMS path format. Use alphanumerics, dots, dashes, underscores, and single slashes between segments."
+ })
+ .describe(SecretSyncs.DESTINATION_CONFIG.OVH.path)
+});
+
+const OvhSyncOptionsConfig: TSyncOptionsConfig = { canImportSecrets: true };
+
+export const OvhSyncSchema = BaseSecretSyncSchema(SecretSync.OVH, OvhSyncOptionsConfig)
+ .extend({
+ destination: z.literal(SecretSync.OVH),
+ destinationConfig: OvhSyncDestinationConfigSchema
+ })
+ .describe(JSON.stringify({ title: SECRET_SYNC_NAME_MAP[SecretSync.OVH] }));
+
+export const CreateOvhSyncSchema = GenericCreateSecretSyncFieldsSchema(SecretSync.OVH, OvhSyncOptionsConfig).extend({
+ destinationConfig: OvhSyncDestinationConfigSchema
+});
+
+export const UpdateOvhSyncSchema = GenericUpdateSecretSyncFieldsSchema(SecretSync.OVH, OvhSyncOptionsConfig).extend({
+ destinationConfig: OvhSyncDestinationConfigSchema.optional()
+});
+
+export const OvhSyncListItemSchema = z
+ .object({
+ name: z.literal("OVH"),
+ connection: z.literal(AppConnection.OVH),
+ destination: z.literal(SecretSync.OVH),
+ canImportSecrets: z.literal(true),
+ canRemoveSecretsOnDeletion: z.literal(true)
+ })
+ .describe(JSON.stringify({ title: SECRET_SYNC_NAME_MAP[SecretSync.OVH] }));
diff --git a/backend/src/services/secret-sync/ovh/ovh-sync-types.ts b/backend/src/services/secret-sync/ovh/ovh-sync-types.ts
new file mode 100644
index 0000000000..a6a79a93ea
--- /dev/null
+++ b/backend/src/services/secret-sync/ovh/ovh-sync-types.ts
@@ -0,0 +1,15 @@
+import { z } from "zod";
+
+import { TOvhConnection } from "@app/services/app-connection/ovh";
+
+import { CreateOvhSyncSchema, OvhSyncListItemSchema, OvhSyncSchema } from "./ovh-sync-schemas";
+
+export type TOvhSync = z.infer<typeof OvhSyncSchema>;
+
+export type TOvhSyncInput = z.infer<typeof CreateOvhSyncSchema>;
+
+export type TOvhSyncListItem = z.infer<typeof OvhSyncListItemSchema>;
+
+export type TOvhSyncWithCredentials = TOvhSync & {
+ connection: TOvhConnection;
+};
diff --git a/backend/src/services/secret-sync/secret-sync-enums.ts b/backend/src/services/secret-sync/secret-sync-enums.ts
index 92dbd907fa..52debf3410 100644
--- a/backend/src/services/secret-sync/secret-sync-enums.ts
+++ b/backend/src/services/secret-sync/secret-sync-enums.ts
@@ -35,7 +35,8 @@ export enum SecretSync {
OctopusDeploy = "octopus-deploy",
CircleCI = "circleci",
AzureEntraIdScim = "azure-entra-id-scim",
- ExternalInfisical = "external-infisical"
+ ExternalInfisical = "external-infisical",
+ OVH = "ovh"
}
export enum SecretSyncInitialSyncBehavior {
diff --git a/backend/src/services/secret-sync/secret-sync-fns.ts b/backend/src/services/secret-sync/secret-sync-fns.ts
index cfd34bf4ca..f7598d7113 100644
--- a/backend/src/services/secret-sync/secret-sync-fns.ts
+++ b/backend/src/services/secret-sync/secret-sync-fns.ts
@@ -69,6 +69,7 @@ import { LARAVEL_FORGE_SYNC_LIST_OPTION, LaravelForgeSyncFns } from "./laravel-f
import { NETLIFY_SYNC_LIST_OPTION, NetlifySyncFns } from "./netlify";
import { NORTHFLANK_SYNC_LIST_OPTION, NorthflankSyncFns } from "./northflank";
import { OCTOPUS_DEPLOY_SYNC_LIST_OPTION, OctopusDeploySyncFns } from "./octopus-deploy";
+import { OVH_SYNC_LIST_OPTION, OvhSyncFns } from "./ovh";
import { RAILWAY_SYNC_LIST_OPTION } from "./railway/railway-sync-constants";
import { RailwaySyncFns } from "./railway/railway-sync-fns";
import { RENDER_SYNC_LIST_OPTION, RenderSyncFns } from "./render";
@@ -117,7 +118,8 @@ const SECRET_SYNC_LIST_OPTIONS: Record<SecretSync, TSecretSyncListItem> = {
[SecretSync.OctopusDeploy]: OCTOPUS_DEPLOY_SYNC_LIST_OPTION,
[SecretSync.CircleCI]: CIRCLECI_SYNC_LIST_OPTION,
[SecretSync.AzureEntraIdScim]: AZURE_ENTRA_ID_SCIM_SYNC_LIST_OPTION,
- [SecretSync.ExternalInfisical]: EXTERNAL_INFISICAL_SYNC_LIST_OPTION
+ [SecretSync.ExternalInfisical]: EXTERNAL_INFISICAL_SYNC_LIST_OPTION,
+ [SecretSync.OVH]: OVH_SYNC_LIST_OPTION
};
export const listSecretSyncOptions = () => {
@@ -378,6 +380,8 @@ export const SecretSyncFns = {
// Key schema is intentionally not applied for Infisical-to-Infisical syncs to prevent
// infinite sync loops where the prefixed key triggers another sync cycle.
return ExternalInfisicalSyncFns.syncSecrets(secretSync, secretMap);
+ case SecretSync.OVH:
+ return OvhSyncFns.syncSecrets(secretSync, schemaSecretMap);
default:
throw new Error(
`Unhandled sync destination for sync secrets fns: ${(secretSync as TSecretSyncWithCredentials).destination}`
@@ -518,6 +522,9 @@ export const SecretSyncFns = {
case SecretSync.ExternalInfisical:
secretMap = await ExternalInfisicalSyncFns.getSecrets(secretSync);
break;
+ case SecretSync.OVH:
+ secretMap = await OvhSyncFns.getSecrets(secretSync);
+ break;
default:
throw new Error(
`Unhandled sync destination for get secrets fns: ${(secretSync as TSecretSyncWithCredentials).destination}`
@@ -627,6 +634,8 @@ export const SecretSyncFns = {
// Key schema is intentionally not applied for Infisical-to-Infisical syncs to prevent
// infinite sync loops where the prefixed key triggers another sync cycle.
return ExternalInfisicalSyncFns.removeSecrets(secretSync, secretMap);
+ case SecretSync.OVH:
+ return OvhSyncFns.removeSecrets(secretSync, schemaSecretMap);
default:
throw new Error(
`Unhandled sync destination for remove secrets fns: ${(secretSync as TSecretSyncWithCredentials).destination}`
diff --git a/backend/src/services/secret-sync/secret-sync-maps.ts b/backend/src/services/secret-sync/secret-sync-maps.ts
index 9fe6f03642..f4dd56b943 100644
--- a/backend/src/services/secret-sync/secret-sync-maps.ts
+++ b/backend/src/services/secret-sync/secret-sync-maps.ts
@@ -39,7 +39,8 @@ export const SECRET_SYNC_NAME_MAP: Record<SecretSync, string> = {
[SecretSync.OctopusDeploy]: "Octopus Deploy",
[SecretSync.CircleCI]: "CircleCI",
[SecretSync.AzureEntraIdScim]: "Azure Entra ID SCIM",
- [SecretSync.ExternalInfisical]: "Infisical"
+ [SecretSync.ExternalInfisical]: "Infisical",
+ [SecretSync.OVH]: "OVH"
};
export const SECRET_SYNC_CONNECTION_MAP: Record<SecretSync, AppConnection> = {
@@ -79,7 +80,8 @@ export const SECRET_SYNC_CONNECTION_MAP: Record<SecretSync, AppConnection> = {
[SecretSync.OctopusDeploy]: AppConnection.OctopusDeploy,
[SecretSync.CircleCI]: AppConnection.CircleCI,
[SecretSync.AzureEntraIdScim]: AppConnection.AzureEntraId,
- [SecretSync.ExternalInfisical]: AppConnection.ExternalInfisical
+ [SecretSync.ExternalInfisical]: AppConnection.ExternalInfisical,
+ [SecretSync.OVH]: AppConnection.OVH
};
export const SECRET_SYNC_PLAN_MAP: Record<SecretSync, SecretSyncPlanType> = {
@@ -119,7 +121,8 @@ export const SECRET_SYNC_PLAN_MAP: Record<SecretSync, SecretSyncPlanType> = {
[SecretSync.OctopusDeploy]: SecretSyncPlanType.Regular,
[SecretSync.CircleCI]: SecretSyncPlanType.Regular,
[SecretSync.AzureEntraIdScim]: SecretSyncPlanType.Regular,
- [SecretSync.ExternalInfisical]: SecretSyncPlanType.Regular
+ [SecretSync.ExternalInfisical]: SecretSyncPlanType.Regular,
+ [SecretSync.OVH]: SecretSyncPlanType.Regular
};
export const SECRET_SYNC_SKIP_FIELDS_MAP: Record<SecretSync, string[]> = {
@@ -168,7 +171,8 @@ export const SECRET_SYNC_SKIP_FIELDS_MAP: Record<SecretSync, string[]> = {
[SecretSync.OctopusDeploy]: [],
[SecretSync.CircleCI]: [],
[SecretSync.AzureEntraIdScim]: [],
- [SecretSync.ExternalInfisical]: []
+ [SecretSync.ExternalInfisical]: [],
+ [SecretSync.OVH]: []
};
const defaultDuplicateCheck: DestinationDuplicateCheckFn = () => true;
@@ -234,7 +238,8 @@ export const DESTINATION_DUPLICATE_CHECK_MAP: Record<SecretSync, DestinationDupl
[SecretSync.OctopusDeploy]: defaultDuplicateCheck,
[SecretSync.CircleCI]: defaultDuplicateCheck,
[SecretSync.AzureEntraIdScim]: defaultDuplicateCheck,
- [SecretSync.ExternalInfisical]: defaultDuplicateCheck
+ [SecretSync.ExternalInfisical]: defaultDuplicateCheck,
+ [SecretSync.OVH]: defaultDuplicateCheck
};
/**
diff --git a/backend/src/services/secret-sync/secret-sync-types.ts b/backend/src/services/secret-sync/secret-sync-types.ts
index dc2df1e2bc..57a23cf9a7 100644
--- a/backend/src/services/secret-sync/secret-sync-types.ts
+++ b/backend/src/services/secret-sync/secret-sync-types.ts
@@ -158,6 +158,7 @@ import {
TOctopusDeploySyncListItem,
TOctopusDeploySyncWithCredentials
} from "./octopus-deploy";
+import { TOvhSync, TOvhSyncInput, TOvhSyncListItem, TOvhSyncWithCredentials } from "./ovh";
import {
TRailwaySync,
TRailwaySyncInput,
@@ -227,7 +228,8 @@ export type TSecretSync =
| TOctopusDeploySync
| TCircleCISync
| TAzureEntraIdScimSync
- | TExternalInfisicalSync;
+ | TExternalInfisicalSync
+ | TOvhSync;
export type TSecretSyncWithCredentials =
| TAwsParameterStoreSyncWithCredentials
@@ -266,7 +268,8 @@ export type TSecretSyncWithCredentials =
| TOctopusDeploySyncWithCredentials
| TCircleCISyncWithCredentials
| TAzureEntraIdScimSyncWithCredentials
- | TExternalInfisicalSyncWithCredentials;
+ | TExternalInfisicalSyncWithCredentials
+ | TOvhSyncWithCredentials;
export type TSecretSyncInput =
| TAwsParameterStoreSyncInput
@@ -305,7 +308,8 @@ export type TSecretSyncInput =
| TOctopusDeploySyncInput
| TCircleCISyncInput
| TAzureEntraIdScimSyncInput
- | TExternalInfisicalSyncInput;
+ | TExternalInfisicalSyncInput
+ | TOvhSyncInput;
export type TSecretSyncListItem =
| TAwsParameterStoreSyncListItem
@@ -344,7 +348,8 @@ export type TSecretSyncListItem =
| TOctopusDeploySyncListItem
| TCircleCISyncListItem
| TAzureEntraIdScimSyncListItem
- | TExternalInfisicalSyncListItem;
+ | TExternalInfisicalSyncListItem
+ | TOvhSyncListItem;
export type TSyncOptionsConfig = {
canImportSecrets: boolean;
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/OvhSyncFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/OvhSyncFields.tsx
new file mode 100644
index 0000000000..609cfcdd2c
--- /dev/null
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/OvhSyncFields.tsx
@@ -0,0 +1,36 @@
+import { Controller, useFormContext } from "react-hook-form";
+
+import { SecretSyncConnectionField } from "@app/components/secret-syncs/forms/SecretSyncConnectionField";
+import { FormControl, Input } from "@app/components/v2";
+import { SecretSync } from "@app/hooks/api/secretSyncs";
+
+import { TSecretSyncForm } from "../schemas";
+
+export const OvhSyncFields = () => {
+ const { control, setValue } = useFormContext<TSecretSyncForm & { destination: SecretSync.OVH }>();
+
+ return (
+ <>
+ <SecretSyncConnectionField
+ onChange={() => {
+ setValue("destinationConfig.path", "");
+ }}
+ />
+ <Controller
+ name="destinationConfig.path"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl
+ tooltipClassName="max-w-sm"
+ tooltipText="The path in OVH OKMS where secrets will be stored as key/value pairs. If the path does not exist, it will be created."
+ isError={Boolean(error)}
+ errorText={error?.message}
+ label="Path"
+ >
+ <Input value={value} onChange={onChange} placeholder="app/production" />
+ </FormControl>
+ )}
+ />
+ </>
+ );
+};
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/SecretSyncDestinationFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/SecretSyncDestinationFields.tsx
index 00174af087..0aef79943b 100644
--- a/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/SecretSyncDestinationFields.tsx
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/SecretSyncDestinationFields.tsx
@@ -32,6 +32,7 @@ import { NetlifySyncFields } from "./NetlifySyncFields";
import { NorthflankSyncFields } from "./NorthflankSyncFields";
import { OCIVaultSyncFields } from "./OCIVaultSyncFields";
import { OctopusDeploySyncFields } from "./OctopusDeploySyncFields";
+import { OvhSyncFields } from "./OvhSyncFields";
import { RailwaySyncFields } from "./RailwaySyncFields";
import { RenderSyncFields } from "./RenderSyncFields";
import { SupabaseSyncFields } from "./SupabaseSyncFields";
@@ -121,6 +122,8 @@ export const SecretSyncDestinationFields = () => {
return <AzureEntraIdScimSyncFields />;
case SecretSync.ExternalInfisical:
return <ExternalInfisicalSyncFields />;
+ case SecretSync.OVH:
+ return <OvhSyncFields />;
default:
throw new Error(`Unhandled Destination Config Field: ${destination}`);
}
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncOptionsFields/SecretSyncOptionsFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncOptionsFields/SecretSyncOptionsFields.tsx
index 827aebbb5d..b096ebe2b6 100644
--- a/frontend/src/components/secret-syncs/forms/SecretSyncOptionsFields/SecretSyncOptionsFields.tsx
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncOptionsFields/SecretSyncOptionsFields.tsx
@@ -108,6 +108,7 @@ export const SecretSyncOptionsFields = ({ hideInitialSync }: Props) => {
case SecretSync.CircleCI:
case SecretSync.AzureEntraIdScim:
case SecretSync.ExternalInfisical:
+ case SecretSync.OVH:
AdditionalSyncOptionsFieldsComponent = null;
break;
default:
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/OvhSyncReviewFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/OvhSyncReviewFields.tsx
new file mode 100644
index 0000000000..660bbc797f
--- /dev/null
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/OvhSyncReviewFields.tsx
@@ -0,0 +1,12 @@
+import { useFormContext } from "react-hook-form";
+
+import { TSecretSyncForm } from "@app/components/secret-syncs/forms/schemas";
+import { GenericFieldLabel } from "@app/components/v2";
+import { SecretSync } from "@app/hooks/api/secretSyncs";
+
+export const OvhSyncReviewFields = () => {
+ const { watch } = useFormContext<TSecretSyncForm & { destination: SecretSync.OVH }>();
+ const path = watch("destinationConfig.path");
+
+ return <GenericFieldLabel label="Path">{path}</GenericFieldLabel>;
+};
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx
index ea2d1b5073..c8a57494f1 100644
--- a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx
@@ -45,6 +45,7 @@ import { NorthflankSyncReviewFields } from "./NorthflankSyncReviewFields";
import { OCIVaultSyncReviewFields } from "./OCIVaultSyncReviewFields";
import { OctopusDeploySyncReviewFields } from "./OctopusDeploySyncReviewFields";
import { OnePassSyncReviewFields } from "./OnePassSyncReviewFields";
+import { OvhSyncReviewFields } from "./OvhSyncReviewFields";
import { RailwaySyncReviewFields } from "./RailwaySyncReviewFields";
import { RenderSyncOptionsReviewFields, RenderSyncReviewFields } from "./RenderSyncReviewFields";
import { SupabaseSyncReviewFields } from "./SupabaseSyncReviewFields";
@@ -198,6 +199,9 @@ export const SecretSyncReviewFields = () => {
case SecretSync.ExternalInfisical:
DestinationFieldsComponent = <ExternalInfisicalSyncReviewFields />;
break;
+ case SecretSync.OVH:
+ DestinationFieldsComponent = <OvhSyncReviewFields />;
+ break;
default:
throw new Error(`Unhandled Destination Review Fields: ${destination}`);
}
diff --git a/frontend/src/components/secret-syncs/forms/schemas/ovh-sync-destination-schema.ts b/frontend/src/components/secret-syncs/forms/schemas/ovh-sync-destination-schema.ts
new file mode 100644
index 0000000000..05441a6c7b
--- /dev/null
+++ b/frontend/src/components/secret-syncs/forms/schemas/ovh-sync-destination-schema.ts
@@ -0,0 +1,21 @@
+import { z } from "zod";
+
+import { BaseSecretSyncSchema } from "@app/components/secret-syncs/forms/schemas/base-secret-sync-schema";
+import { SecretSync } from "@app/hooks/api/secretSyncs";
+
+export const OvhSyncDestinationSchema = BaseSecretSyncSchema().merge(
+ z.object({
+ destination: z.literal(SecretSync.OVH),
+ destinationConfig: z.object({
+ path: z
+ .string()
+ .trim()
+ .min(1, "Path required")
+ .transform((val) => val.trim().replace(/^\/+|\/+$/g, ""))
+ .refine((val) => /^([a-zA-Z0-9._-]+\/)*[a-zA-Z0-9._-]+$/.test(val), {
+ message:
+ "Invalid OVH OKMS path format. Use alphanumerics, dots, dashes, underscores, and single slashes between segments."
+ })
+ })
+ })
+);
diff --git a/frontend/src/components/secret-syncs/forms/schemas/secret-sync-schema.ts b/frontend/src/components/secret-syncs/forms/schemas/secret-sync-schema.ts
index f9bc319b74..0af31882ab 100644
--- a/frontend/src/components/secret-syncs/forms/schemas/secret-sync-schema.ts
+++ b/frontend/src/components/secret-syncs/forms/schemas/secret-sync-schema.ts
@@ -29,6 +29,7 @@ import { NetlifySyncDestinationSchema } from "./netlify-sync-destination-schema"
import { NorthflankSyncDestinationSchema } from "./northflank-sync-destination-schema";
import { OCIVaultSyncDestinationSchema } from "./oci-vault-sync-destination-schema";
import { OctopusDeploySyncDestinationSchema } from "./octopus-deploy-sync-destination-schema";
+import { OvhSyncDestinationSchema } from "./ovh-sync-destination-schema";
import { RailwaySyncDestinationSchema } from "./railway-sync-destination-schema";
import { RenderSyncDestinationSchema } from "./render-sync-destination-schema";
import { SupabaseSyncDestinationSchema } from "./supabase-sync-destination-schema";
@@ -75,7 +76,8 @@ const SecretSyncUnionSchema = z.discriminatedUnion("destination", [
ChefSyncDestinationSchema,
CircleCISyncDestinationSchema,
AzureEntraIdScimSyncDestinationSchema,
- ExternalInfisicalSyncDestinationSchema
+ ExternalInfisicalSyncDestinationSchema,
+ OvhSyncDestinationSchema
]);
export const SecretSyncFormSchema = SecretSyncUnionSchema;
diff --git a/frontend/src/helpers/appConnections.ts b/frontend/src/helpers/appConnections.ts
index 87bb22f0fe..3220a06a8f 100644
--- a/frontend/src/helpers/appConnections.ts
+++ b/frontend/src/helpers/appConnections.ts
@@ -271,8 +271,8 @@ export const getAppConnectionMethodDetails = (method: TAppConnection["method"])
return { name: "Machine Identity - Universal Auth", icon: faKey };
case NetScalerConnectionMethod.BasicAuth:
return { name: "Basic Auth", icon: faLock };
- case OVHConnectionMethod.Pkcs12Certificate:
- return { name: "PKCS#12 Certificate", icon: faCertificate };
+ case OVHConnectionMethod.Certificate:
+ return { name: "Certificate", icon: faCertificate };
default:
throw new Error(`Unhandled App Connection Method: ${method}`);
}
diff --git a/frontend/src/helpers/secretSyncs.ts b/frontend/src/helpers/secretSyncs.ts
index 4357a8a3ec..43cb184763 100644
--- a/frontend/src/helpers/secretSyncs.ts
+++ b/frontend/src/helpers/secretSyncs.ts
@@ -141,6 +141,10 @@ export const SECRET_SYNC_MAP: Record<SecretSync, { name: string; image: string }
[SecretSync.ExternalInfisical]: {
name: "Infisical",
image: "Infisical.png"
+ },
+ [SecretSync.OVH]: {
+ name: "OVH",
+ image: "OVH.png"
}
};
@@ -181,7 +185,8 @@ export const SECRET_SYNC_CONNECTION_MAP: Record<SecretSync, AppConnection> = {
[SecretSync.OctopusDeploy]: AppConnection.OctopusDeploy,
[SecretSync.CircleCI]: AppConnection.CircleCI,
[SecretSync.AzureEntraIdScim]: AppConnection.AzureEntraId,
- [SecretSync.ExternalInfisical]: AppConnection.ExternalInfisical
+ [SecretSync.ExternalInfisical]: AppConnection.ExternalInfisical,
+ [SecretSync.OVH]: AppConnection.OVH
};
export const SECRET_SYNC_INITIAL_SYNC_BEHAVIOR_MAP: Record<
diff --git a/frontend/src/hooks/api/appConnections/types/ovh-connection.ts b/frontend/src/hooks/api/appConnections/types/ovh-connection.ts
index 75377f2a38..30b23efee8 100644
--- a/frontend/src/hooks/api/appConnections/types/ovh-connection.ts
+++ b/frontend/src/hooks/api/appConnections/types/ovh-connection.ts
@@ -2,14 +2,14 @@ import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { TRootAppConnection } from "@app/hooks/api/appConnections/types/root-connection";
export enum OVHConnectionMethod {
- Pkcs12Certificate = "pkcs12-certificate"
+ Certificate = "certificate"
}
export type TOvhConnection = TRootAppConnection & { app: AppConnection.OVH } & {
- method: OVHConnectionMethod.Pkcs12Certificate;
+ method: OVHConnectionMethod.Certificate;
credentials: {
- pkcs12Certificate: string;
- pkcs12Passphrase?: string;
+ privateKey: string;
+ certificate: string;
okmsDomain: string;
okmsId: string;
};
diff --git a/frontend/src/hooks/api/secretSyncs/enums.ts b/frontend/src/hooks/api/secretSyncs/enums.ts
index 2200b02e26..acf5d37e49 100644
--- a/frontend/src/hooks/api/secretSyncs/enums.ts
+++ b/frontend/src/hooks/api/secretSyncs/enums.ts
@@ -35,7 +35,8 @@ export enum SecretSync {
OctopusDeploy = "octopus-deploy",
CircleCI = "circleci",
AzureEntraIdScim = "azure-entra-id-scim",
- ExternalInfisical = "external-infisical"
+ ExternalInfisical = "external-infisical",
+ OVH = "ovh"
}
export enum SecretSyncStatus {
diff --git a/frontend/src/hooks/api/secretSyncs/types/index.ts b/frontend/src/hooks/api/secretSyncs/types/index.ts
index 21dc0d1c8c..4d53b593e8 100644
--- a/frontend/src/hooks/api/secretSyncs/types/index.ts
+++ b/frontend/src/hooks/api/secretSyncs/types/index.ts
@@ -30,6 +30,7 @@ import { TNetlifySync } from "./netlify-sync";
import { TNorthflankSync } from "./northflank-sync";
import { TOCIVaultSync } from "./oci-vault-sync";
import { TOctopusDeploySync } from "./octopus-deploy-sync";
+import { TOvhSync } from "./ovh-sync";
import { TRailwaySync } from "./railway-sync";
import { TRenderSync } from "./render-sync";
import { TSupabaseSync } from "./supabase";
@@ -86,7 +87,8 @@ export type TSecretSync =
| TOctopusDeploySync
| TCircleCISync
| TAzureEntraIdScimSync
- | TExternalInfisicalSync;
+ | TExternalInfisicalSync
+ | TOvhSync;
export type TListSecretSyncs = { secretSyncs: TSecretSync[] };
diff --git a/frontend/src/hooks/api/secretSyncs/types/ovh-sync.ts b/frontend/src/hooks/api/secretSyncs/types/ovh-sync.ts
new file mode 100644
index 0000000000..094c740171
--- /dev/null
+++ b/frontend/src/hooks/api/secretSyncs/types/ovh-sync.ts
@@ -0,0 +1,15 @@
+import { AppConnection } from "@app/hooks/api/appConnections/enums";
+import { SecretSync } from "@app/hooks/api/secretSyncs";
+import { TRootSecretSync } from "@app/hooks/api/secretSyncs/types/root-sync";
+
+export type TOvhSync = TRootSecretSync & {
+ destination: SecretSync.OVH;
+ destinationConfig: {
+ path: string;
+ };
+ connection: {
+ app: AppConnection.OVH;
+ name: string;
+ id: string;
+ };
+};
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/OVHConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/OVHConnectionForm.tsx
index aaaf4df2dc..3a3400c028 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/OVHConnectionForm.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/OVHConnectionForm.tsx
@@ -17,7 +17,6 @@ import {
OVHConnectionMethod,
TOvhConnection
} from "@app/hooks/api/appConnections/types/ovh-connection";
-import { isBase64 } from "@app/lib/fn/base64";
import {
genericAppConnectionFieldsSchema,
@@ -33,16 +32,28 @@ const rootSchema = genericAppConnectionFieldsSchema.extend({
app: z.literal(AppConnection.OVH)
});
+const pemPrivateKey = z
+ .string()
+ .trim()
+ .min(1, "Private key required")
+ .refine((val) => val.startsWith("-----BEGIN "), {
+ message: "Private key must be in PEM format (starts with -----BEGIN ...-----)"
+ });
+
+const pemCertificate = z
+ .string()
+ .trim()
+ .min(1, "Certificate required")
+ .refine((val) => val.startsWith("-----BEGIN CERTIFICATE-----"), {
+ message: "Certificate must be in PEM format (starts with -----BEGIN CERTIFICATE-----)"
+ });
+
const formSchema = z.discriminatedUnion("method", [
rootSchema.extend({
- method: z.literal(OVHConnectionMethod.Pkcs12Certificate),
+ method: z.literal(OVHConnectionMethod.Certificate),
credentials: z.object({
- pkcs12Certificate: z
- .string()
- .trim()
- .min(1, "PKCS#12 certificate required")
- .refine(isBase64, { message: "Value must be a valid base64 string" }),
- pkcs12Passphrase: z.string().optional(),
+ privateKey: pemPrivateKey,
+ certificate: pemCertificate,
okmsDomain: z.string().trim().min(1, "OKMS domain required"),
okmsId: z.string().trim().min(1, "OKMS ID required")
})
@@ -61,16 +72,16 @@ export const OVHConnectionForm = ({ appConnection, onSubmit }: Props) => {
...appConnection,
credentials: {
...appConnection.credentials,
- pkcs12Certificate: "",
- pkcs12Passphrase: ""
+ privateKey: "",
+ certificate: ""
}
}
: {
app: AppConnection.OVH,
- method: OVHConnectionMethod.Pkcs12Certificate,
+ method: OVHConnectionMethod.Certificate,
credentials: {
- pkcs12Certificate: "",
- pkcs12Passphrase: "",
+ privateKey: "",
+ certificate: "",
okmsDomain: "",
okmsId: ""
}
@@ -117,20 +128,15 @@ export const OVHConnectionForm = ({ appConnection, onSubmit }: Props) => {
)}
/>
<Controller
- name="credentials.pkcs12Certificate"
+ name="credentials.privateKey"
control={control}
shouldUnregister
render={({ field: { value, onChange }, fieldState: { error } }) => (
<FormControl
errorText={error?.message}
isError={Boolean(error?.message)}
- label="PKCS#12 Certificate (Base64)"
- helperText={
- isUpdate
- ? "Paste the base64-encoded PKCS#12 bundle to replace the existing certificate. Generate it locally with: base64 -w 0 cert.p12"
- : "Paste the base64-encoded contents of your .p12/.pfx bundle. Generate it locally with: base64 -w 0 cert.p12"
- }
- tooltipText="The PKCS#12 bundle must be base64-encoded (no line breaks). It will be used for mTLS authentication with OVH OKMS."
+ label="Private Key (PEM)"
+ tooltipText="Paste the PEM-encoded private key issued by OVH OKMS, including the -----BEGIN/END PRIVATE KEY----- markers."
>
<SecretInput
containerClassName="text-gray-400 group-focus-within:border-primary-400/50! border border-mineshaft-500 bg-mineshaft-900 px-2.5 py-1.5"
@@ -141,20 +147,19 @@ export const OVHConnectionForm = ({ appConnection, onSubmit }: Props) => {
)}
/>
<Controller
- name="credentials.pkcs12Passphrase"
+ name="credentials.certificate"
control={control}
shouldUnregister
render={({ field: { value, onChange }, fieldState: { error } }) => (
<FormControl
errorText={error?.message}
isError={Boolean(error?.message)}
- label="PKCS#12 Passphrase"
- isOptional
- tooltipText="The passphrase set when exporting the PKCS#12 bundle. Leave empty if the bundle has no passphrase."
+ label="Certificate (PEM)"
+ tooltipText="Paste the PEM-encoded public certificate issued by OVH OKMS, including the -----BEGIN/END CERTIFICATE----- markers."
>
<SecretInput
containerClassName="text-gray-400 group-focus-within:border-primary-400/50! border border-mineshaft-500 bg-mineshaft-900 px-2.5 py-1.5"
- value={value ?? ""}
+ value={value}
onChange={(e) => onChange(e.target.value)}
/>
</FormControl>
diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/OvhSyncDestinationCol.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/OvhSyncDestinationCol.tsx
new file mode 100644
index 0000000000..9b9516b179
--- /dev/null
+++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/OvhSyncDestinationCol.tsx
@@ -0,0 +1,14 @@
+import { TOvhSync } from "@app/hooks/api/secretSyncs/types/ovh-sync";
+
+import { getSecretSyncDestinationColValues } from "../helpers";
+import { SecretSyncTableCell } from "../SecretSyncTableCell";
+
+type Props = {
+ secretSync: TOvhSync;
+};
+
+export const OvhSyncDestinationCol = ({ secretSync }: Props) => {
+ const { primaryText, secondaryText } = getSecretSyncDestinationColValues(secretSync);
+
+ return <SecretSyncTableCell primaryText={primaryText} secondaryText={secondaryText} />;
+};
diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/SecretSyncDestinationCol.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/SecretSyncDestinationCol.tsx
index 571353c10f..2e19304986 100644
--- a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/SecretSyncDestinationCol.tsx
+++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/SecretSyncDestinationCol.tsx
@@ -29,6 +29,7 @@ import { NetlifySyncDestinationCol } from "./NetlifySyncDestinationCol";
import { NorthflankSyncDestinationCol } from "./NorthflankSyncDestinationCol";
import { OCIVaultSyncDestinationCol } from "./OCIVaultSyncDestinationCol";
import { OctopusDeploySyncDestinationCol } from "./OctopusDeploySyncDestinationCol";
+import { OvhSyncDestinationCol } from "./OvhSyncDestinationCol";
import { RailwaySyncDestinationCol } from "./RailwaySyncDestinationCol";
import { RenderSyncDestinationCol } from "./RenderSyncDestinationCol";
import { SupabaseSyncDestinationCol } from "./SupabaseSyncDestinationCol";
@@ -118,6 +119,8 @@ export const SecretSyncDestinationCol = ({ secretSync }: Props) => {
return <AzureEntraIdScimSyncDestinationCol secretSync={secretSync} />;
case SecretSync.ExternalInfisical:
return <ExternalInfisicalSyncDestinationCol secretSync={secretSync} />;
+ case SecretSync.OVH:
+ return <OvhSyncDestinationCol secretSync={secretSync} />;
default:
throw new Error(
`Unhandled Secret Sync Destination Col: ${(secretSync as TSecretSync).destination}`
diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/helpers/index.ts b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/helpers/index.ts
index 974fcc1051..6e96f9d973 100644
--- a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/helpers/index.ts
+++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/helpers/index.ts
@@ -233,6 +233,9 @@ export const getSecretSyncDestinationColValues = (secretSync: TSecretSync) => {
primaryText = destinationConfig.projectId;
secondaryText = `${destinationConfig.environment} - ${destinationConfig.secretPath}`;
break;
+ case SecretSync.OVH:
+ primaryText = destinationConfig.path;
+ break;
default:
throw new Error(`Unhandled Destination Col Values ${destination}`);
}
diff --git a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/OvhSyncDestinationSection.tsx b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/OvhSyncDestinationSection.tsx
new file mode 100644
index 0000000000..7a032ddb8e
--- /dev/null
+++ b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/OvhSyncDestinationSection.tsx
@@ -0,0 +1,14 @@
+import { GenericFieldLabel } from "@app/components/secret-syncs";
+import { TOvhSync } from "@app/hooks/api/secretSyncs/types/ovh-sync";
+
+type Props = {
+ secretSync: TOvhSync;
+};
+
+export const OvhSyncDestinationSection = ({ secretSync }: Props) => {
+ const {
+ destinationConfig: { path }
+ } = secretSync;
+
+ return <GenericFieldLabel label="Path">{path}</GenericFieldLabel>;
+};
diff --git a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/SecretSyncDestinatonSection.tsx b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/SecretSyncDestinatonSection.tsx
index fa4a2a729b..c41ab009f7 100644
--- a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/SecretSyncDestinatonSection.tsx
+++ b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/SecretSyncDestinatonSection.tsx
@@ -39,6 +39,7 @@ import { NetlifySyncDestinationSection } from "./NetlifySyncDestinationSection";
import { NorthflankSyncDestinationSection } from "./NorthflankSyncDestinationSection";
import { OCIVaultSyncDestinationSection } from "./OCIVaultSyncDestinationSection";
import { OctopusDeploySyncDestinationSection } from "./OctopusDeploySyncDestinationSection";
+import { OvhSyncDestinationSection } from "./OvhSyncDestinationSection";
import { RailwaySyncDestinationSection } from "./RailwaySyncDestinationSection";
import { RenderSyncDestinationSection } from "./RenderSyncDestinationSection";
import { SupabaseSyncDestinationSection } from "./SupabaseSyncDestinationSection";
@@ -175,6 +176,9 @@ export const SecretSyncDestinationSection = ({ secretSync, onEditDestination }:
case SecretSync.ExternalInfisical:
DestinationComponents = <ExternalInfisicalSyncDestinationSection secretSync={secretSync} />;
break;
+ case SecretSync.OVH:
+ DestinationComponents = <OvhSyncDestinationSection secretSync={secretSync} />;
+ break;
default:
throw new Error(`Unhandled Destination Section components: ${destination}`);
}
diff --git a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncOptionsSection/SecretSyncOptionsSection.tsx b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncOptionsSection/SecretSyncOptionsSection.tsx
index 77e06a0be8..cc95156c93 100644
--- a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncOptionsSection/SecretSyncOptionsSection.tsx
+++ b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncOptionsSection/SecretSyncOptionsSection.tsx
@@ -80,6 +80,7 @@ export const SecretSyncOptionsSection = ({ secretSync, onEditOptions }: Props) =
case SecretSync.CircleCI:
case SecretSync.AzureEntraIdScim:
case SecretSync.ExternalInfisical:
+ case SecretSync.OVH:
AdditionalSyncOptionsComponent = null;
break;
default: