Skip to content

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

feat: add sync for cloud 66

adilson16c86adc3cc5
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index 1e7b495884..8782965207 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -3242,6 +3242,10 @@ export const SecretSyncs = {
dataBagName: "The name of the Chef data bag to sync secrets to.",
dataBagItemName: "The name of the Chef data bag item to sync secrets to."
},
+ CLOUD66: {
+ stackId: "The unique identifier (uid) of the Cloud 66 stack to sync secrets to.",
+ stackName: "The name of the Cloud 66 stack to sync secrets to."
+ },
NORTHFLANK: {
projectId: "The ID of the Northflank project to sync secrets to.",
projectName: "The name of the Northflank project to sync secrets to.",
diff --git a/backend/src/server/routes/v1/app-connection-routers/cloud-66-connection-router.ts b/backend/src/server/routes/v1/app-connection-routers/cloud-66-connection-router.ts
index 37665afd7a..8c79f13e4d 100644
--- a/backend/src/server/routes/v1/app-connection-routers/cloud-66-connection-router.ts
+++ b/backend/src/server/routes/v1/app-connection-routers/cloud-66-connection-router.ts
@@ -1,9 +1,15 @@
+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 {
CreateCloud66ConnectionSchema,
SanitizedCloud66ConnectionSchema,
+ TCloud66Stack,
UpdateCloud66ConnectionSchema
} from "@app/services/app-connection/cloud-66";
+import { AuthMode } from "@app/services/auth/auth-type";
import { registerAppConnectionEndpoints } from "./app-connection-endpoints";
@@ -15,4 +21,38 @@ export const registerCloud66ConnectionRouter = async (server: FastifyZodProvider
createSchema: CreateCloud66ConnectionSchema,
updateSchema: UpdateCloud66ConnectionSchema
});
+
+ // The below endpoints are not exposed and for Infisical App use
+ server.route({
+ method: "GET",
+ url: `/:connectionId/stacks`,
+ config: {
+ rateLimit: readLimit
+ },
+ schema: {
+ operationId: "listCloud66Stacks",
+ params: z.object({
+ connectionId: z.string().uuid()
+ }),
+ response: {
+ 200: z
+ .object({
+ id: z.string(),
+ name: z.string()
+ })
+ .array()
+ }
+ },
+ onRequest: verifyAuth([AuthMode.JWT]),
+ handler: async (req) => {
+ const { connectionId } = req.params;
+
+ const stacks: TCloud66Stack[] = await server.services.appConnection.cloud66.listStacks(
+ connectionId,
+ req.permission
+ );
+
+ return stacks;
+ }
+ });
};
diff --git a/backend/src/server/routes/v1/secret-sync-routers/cloud66-sync-router.ts b/backend/src/server/routes/v1/secret-sync-routers/cloud66-sync-router.ts
new file mode 100644
index 0000000000..c43ff3f494
--- /dev/null
+++ b/backend/src/server/routes/v1/secret-sync-routers/cloud66-sync-router.ts
@@ -0,0 +1,17 @@
+import {
+ Cloud66SyncSchema,
+ CreateCloud66SyncSchema,
+ UpdateCloud66SyncSchema
+} from "@app/services/secret-sync/cloud66/cloud66-sync-schemas";
+import { SecretSync } from "@app/services/secret-sync/secret-sync-enums";
+
+import { registerSyncSecretsEndpoints } from "./secret-sync-endpoints";
+
+export const registerCloud66SyncRouter = async (server: FastifyZodProvider) =>
+ registerSyncSecretsEndpoints({
+ destination: SecretSync.Cloud66,
+ server,
+ responseSchema: Cloud66SyncSchema,
+ createSchema: CreateCloud66SyncSchema,
+ updateSchema: UpdateCloud66SyncSchema
+ });
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 2b39b89dab..d6d234445d 100644
--- a/backend/src/server/routes/v1/secret-sync-routers/index.ts
+++ b/backend/src/server/routes/v1/secret-sync-routers/index.ts
@@ -13,6 +13,7 @@ import { registerBitbucketSyncRouter } from "./bitbucket-sync-router";
import { registerCamundaSyncRouter } from "./camunda-sync-router";
import { registerChecklySyncRouter } from "./checkly-sync-router";
import { registerCircleCISyncRouter } from "./circleci-sync-router";
+import { registerCloud66SyncRouter } from "./cloud66-sync-router";
import { registerCloudflarePagesSyncRouter } from "./cloudflare-pages-sync-router";
import { registerCloudflareWorkersSyncRouter } from "./cloudflare-workers-sync-router";
import { registerDatabricksSyncRouter } from "./databricks-sync-router";
@@ -89,5 +90,6 @@ export const SECRET_SYNC_REGISTER_ROUTER_MAP: Record<SecretSync, (server: Fastif
[SecretSync.Devin]: registerDevinSyncRouter,
[SecretSync.Ona]: registerOnaSyncRouter,
[SecretSync.TravisCI]: registerTravisCISyncRouter,
- [SecretSync.Snowflake]: registerSnowflakeSyncRouter
+ [SecretSync.Snowflake]: registerSnowflakeSyncRouter,
+ [SecretSync.Cloud66]: registerCloud66SyncRouter
};
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 d512ea9b2f..a6797d0bdd 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
@@ -30,6 +30,7 @@ import { BitbucketSyncListItemSchema, BitbucketSyncSchema } from "@app/services/
import { CamundaSyncListItemSchema, CamundaSyncSchema } from "@app/services/secret-sync/camunda";
import { ChecklySyncListItemSchema, ChecklySyncSchema } from "@app/services/secret-sync/checkly/checkly-sync-schemas";
import { CircleCISyncListItemSchema, CircleCISyncSchema } from "@app/services/secret-sync/circleci";
+import { Cloud66SyncListItemSchema, Cloud66SyncSchema } from "@app/services/secret-sync/cloud66";
import {
CloudflarePagesSyncListItemSchema,
CloudflarePagesSyncSchema
@@ -116,7 +117,8 @@ const SecretSyncSchema = z.discriminatedUnion("destination", [
DevinSyncSchema,
OnaSyncSchema,
TravisCISyncSchema,
- SnowflakeSyncSchema
+ SnowflakeSyncSchema,
+ Cloud66SyncSchema
]);
const SecretSyncOptionsSchema = z.discriminatedUnion("destination", [
@@ -162,7 +164,8 @@ const SecretSyncOptionsSchema = z.discriminatedUnion("destination", [
DevinSyncListItemSchema,
OnaSyncListItemSchema,
TravisCISyncListItemSchema,
- SnowflakeSyncListItemSchema
+ SnowflakeSyncListItemSchema,
+ Cloud66SyncListItemSchema
]);
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 1a1991f971..3bb3a9cce5 100644
--- a/backend/src/services/app-connection/app-connection-fns.ts
+++ b/backend/src/services/app-connection/app-connection-fns.ts
@@ -297,11 +297,6 @@ const PKI_APP_CONNECTIONS = [
AppConnection.GoDaddy
];
-// App Connections available within Secret Manager projects ahead of a dedicated secret sync /
-// rotation / external migration mapping. Once Cloud 66 gains a secret sync it will be derived from
-// SECRET_SYNC_CONNECTION_MAP and can be removed from here.
-const SECRET_MANAGER_APP_CONNECTIONS = [AppConnection.Cloud66];
-
export const listAppConnectionOptions = (projectType?: ProjectType) => {
return [
getAwsConnectionListItem(),
@@ -382,8 +377,7 @@ export const listAppConnectionOptions = (projectType?: ProjectType) => {
return (
Boolean(SECRET_SYNC_APP_CONNECTION_MAP[option.app]) ||
Boolean(SECRET_ROTATION_APP_CONNECTION_MAP[option.app]) ||
- EXTERNAL_MIGRATION_APP_CONNECTIONS.includes(option.app) ||
- SECRET_MANAGER_APP_CONNECTIONS.includes(option.app)
+ EXTERNAL_MIGRATION_APP_CONNECTIONS.includes(option.app)
);
case ProjectType.SecretScanning:
return Boolean(SECRET_SCANNING_APP_CONNECTION_MAP[option.app]);
diff --git a/backend/src/services/app-connection/app-connection-service.ts b/backend/src/services/app-connection/app-connection-service.ts
index 13f1b41271..dcf8ab2670 100644
--- a/backend/src/services/app-connection/app-connection-service.ts
+++ b/backend/src/services/app-connection/app-connection-service.ts
@@ -85,6 +85,7 @@ import { checklyConnectionService } from "./checkly/checkly-connection-service";
import { ValidateCircleCIConnectionCredentialsSchema } from "./circleci";
import { circleciConnectionService } from "./circleci/circleci-connection-service";
import { ValidateCloud66ConnectionCredentialsSchema } from "./cloud-66";
+import { cloud66ConnectionService } from "./cloud-66/cloud-66-connection-service";
import { ValidateCloudflareConnectionCredentialsSchema } from "./cloudflare/cloudflare-connection-schema";
import { cloudflareConnectionService } from "./cloudflare/cloudflare-connection-service";
import { ValidateConvexConnectionCredentialsSchema } from "./convex";
@@ -1332,6 +1333,7 @@ export const appConnectionServiceFactory = ({
teamcity: teamcityConnectionService(connectAppConnectionById),
oci: ociConnectionService(connectAppConnectionById, licenseService),
onepass: onePassConnectionService(connectAppConnectionById),
+ cloud66: cloud66ConnectionService(connectAppConnectionById),
heroku: herokuConnectionService(connectAppConnectionById, appConnectionDAL, kmsService),
render: renderConnectionService(connectAppConnectionById),
flyio: flyioConnectionService(connectAppConnectionById),
diff --git a/backend/src/services/app-connection/cloud-66/cloud-66-connection-fns.ts b/backend/src/services/app-connection/cloud-66/cloud-66-connection-fns.ts
index ef93fbc7ed..993f934b29 100644
--- a/backend/src/services/app-connection/cloud-66/cloud-66-connection-fns.ts
+++ b/backend/src/services/app-connection/cloud-66/cloud-66-connection-fns.ts
@@ -4,7 +4,7 @@ import { logger } from "@app/lib/logger";
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
import { Cloud66ConnectionMethod } from "./cloud-66-connection-enums";
-import { TCloud66ConnectionConfig } from "./cloud-66-connection-types";
+import { TCloud66Connection, TCloud66ConnectionConfig, TCloud66Stack } from "./cloud-66-connection-types";
export const CLOUD_66_API_BASE_URL = "https://app.cloud66.com/api";
@@ -37,3 +37,31 @@ export const validateCloud66ConnectionCredentials = async (config: TCloud66Conne
return config.credentials;
};
+
+export const listCloud66Stacks = async (appConnection: TCloud66Connection): Promise<TCloud66Stack[]> => {
+ const { accessToken } = appConnection.credentials;
+
+ const stacks: TCloud66Stack[] = [];
+ let page: number | null = 1;
+
+ while (page) {
+ // eslint-disable-next-line no-await-in-loop
+ const res = await request.get(`${CLOUD_66_API_BASE_URL}/3/stacks?page=${page}&per_page=30`, {
+ headers: {
+ Authorization: `Bearer ${accessToken}`,
+ Accept: "application/json"
+ }
+ });
+
+ const { response, pagination } = res.data as {
+ response: { uid: string; name: string }[];
+ pagination?: { next: number | null };
+ };
+
+ stacks.push(...response.map((stack) => ({ id: stack.uid, name: stack.name })));
+
+ page = pagination?.next ?? null;
+ }
+
+ return stacks;
+};
diff --git a/backend/src/services/app-connection/cloud-66/cloud-66-connection-service.ts b/backend/src/services/app-connection/cloud-66/cloud-66-connection-service.ts
new file mode 100644
index 0000000000..c9fe99432a
--- /dev/null
+++ b/backend/src/services/app-connection/cloud-66/cloud-66-connection-service.ts
@@ -0,0 +1,30 @@
+import { logger } from "@app/lib/logger";
+import { OrgServiceActor } from "@app/lib/types";
+
+import { AppConnection } from "../app-connection-enums";
+import { listCloud66Stacks } from "./cloud-66-connection-fns";
+import { TCloud66Connection } from "./cloud-66-connection-types";
+
+type TGetAppConnectionFunc = (
+ app: AppConnection,
+ connectionId: string,
+ actor: OrgServiceActor
+) => Promise<TCloud66Connection>;
+
+export const cloud66ConnectionService = (getAppConnection: TGetAppConnectionFunc) => {
+ const listStacks = async (connectionId: string, actor: OrgServiceActor) => {
+ const appConnection = await getAppConnection(AppConnection.Cloud66, connectionId, actor);
+
+ try {
+ const stacks = await listCloud66Stacks(appConnection);
+ return stacks;
+ } catch (error) {
+ logger.error(error, `Failed to list Cloud 66 stacks for connection ${connectionId}`);
+ return [];
+ }
+ };
+
+ return {
+ listStacks
+ };
+};
diff --git a/backend/src/services/app-connection/cloud-66/cloud-66-connection-types.ts b/backend/src/services/app-connection/cloud-66/cloud-66-connection-types.ts
index ad9ccd1b0c..037b6ae168 100644
--- a/backend/src/services/app-connection/cloud-66/cloud-66-connection-types.ts
+++ b/backend/src/services/app-connection/cloud-66/cloud-66-connection-types.ts
@@ -20,3 +20,8 @@ export type TValidateCloud66ConnectionCredentialsSchema = typeof ValidateCloud66
export type TCloud66ConnectionConfig = DiscriminativePick<TCloud66ConnectionInput, "method" | "app" | "credentials"> & {
orgId: string;
};
+
+export type TCloud66Stack = {
+ id: string;
+ name: string;
+};
diff --git a/backend/src/services/secret-sync/cloud66/cloud66-sync-constants.ts b/backend/src/services/secret-sync/cloud66/cloud66-sync-constants.ts
new file mode 100644
index 0000000000..37359a88e0
--- /dev/null
+++ b/backend/src/services/secret-sync/cloud66/cloud66-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 CLOUD66_SYNC_LIST_OPTION: TSecretSyncListItem = {
+ name: "Cloud 66",
+ destination: SecretSync.Cloud66,
+ connection: AppConnection.Cloud66,
+ canImportSecrets: true,
+ canRemoveSecretsOnDeletion: true
+};
diff --git a/backend/src/services/secret-sync/cloud66/cloud66-sync-fns.ts b/backend/src/services/secret-sync/cloud66/cloud66-sync-fns.ts
new file mode 100644
index 0000000000..3a4df3c251
--- /dev/null
+++ b/backend/src/services/secret-sync/cloud66/cloud66-sync-fns.ts
@@ -0,0 +1,158 @@
+import { request } from "@app/lib/config/request";
+import { CLOUD_66_API_BASE_URL } from "@app/services/app-connection/cloud-66/cloud-66-connection-fns";
+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 { TCloud66EnvVar, TCloud66SyncWithCredentials } from "./cloud66-sync-types";
+
+const getHeaders = (accessToken: string) => ({
+ Authorization: `Bearer ${accessToken}`,
+ Accept: "application/json"
+});
+
+// Cloud 66 system-managed variables (readonly / generated) cannot be modified or deleted via the API.
+const isModifiable = (envVar: TCloud66EnvVar) => !envVar.readonly && !envVar.is_generated;
+
+const listCloud66EnvVars = async (accessToken: string, stackId: string): Promise<TCloud66EnvVar[]> => {
+ const envVars: TCloud66EnvVar[] = [];
+ let page: number | null = 1;
+
+ while (page) {
+ // eslint-disable-next-line no-await-in-loop
+ const res = await request.get(
+ `${CLOUD_66_API_BASE_URL}/3/stacks/${stackId}/environments?page=${page}&per_page=30`,
+ {
+ headers: getHeaders(accessToken)
+ }
+ );
+
+ const { response, pagination } = res.data as {
+ response: TCloud66EnvVar[];
+ pagination?: { next: number | null };
+ };
+
+ envVars.push(...response);
+
+ page = pagination?.next ?? null;
+ }
+
+ return envVars;
+};
+
+const createCloud66EnvVar = (accessToken: string, stackId: string, key: string, value: string) =>
+ request.post(
+ `${CLOUD_66_API_BASE_URL}/3/stacks/${stackId}/environments`,
+ { key, value },
+ { headers: getHeaders(accessToken) }
+ );
+
+const updateCloud66EnvVar = (accessToken: string, stackId: string, key: string, value: string) =>
+ request.put(
+ `${CLOUD_66_API_BASE_URL}/3/stacks/${stackId}/environments/${encodeURIComponent(key)}`,
+ { value },
+ { headers: getHeaders(accessToken) }
+ );
+
+const deleteCloud66EnvVar = (accessToken: string, stackId: string, key: string) =>
+ request.delete(`${CLOUD_66_API_BASE_URL}/3/stacks/${stackId}/environments/${encodeURIComponent(key)}`, {
+ headers: getHeaders(accessToken)
+ });
+
+export const Cloud66SyncFns = {
+ async syncSecrets(secretSync: TCloud66SyncWithCredentials, secretMap: TSecretMap) {
+ const {
+ connection,
+ environment,
+ destinationConfig: { stackId },
+ syncOptions: { disableSecretDeletion, keySchema }
+ } = secretSync;
+
+ const { accessToken } = connection.credentials;
+
+ const existingEnvVars = await listCloud66EnvVars(accessToken, stackId);
+ const existingByKey = new Map(existingEnvVars.map((envVar) => [envVar.key, envVar]));
+
+ for (const [key, { value }] of Object.entries(secretMap)) {
+ const existing = existingByKey.get(key);
+
+ // Cloud 66 does not allow environment variables with hyphens
+ if (key.includes("-")) {
+ // eslint-disable-next-line no-continue
+ continue;
+ }
+
+ try {
+ if (existing) {
+ // Skip system-managed variables and unchanged values
+ if (!isModifiable(existing) || existing.value === value) {
+ // eslint-disable-next-line no-continue
+ continue;
+ }
+
+ // eslint-disable-next-line no-await-in-loop
+ await updateCloud66EnvVar(accessToken, stackId, key, value);
+ } else {
+ // eslint-disable-next-line no-await-in-loop
+ await createCloud66EnvVar(accessToken, stackId, key, value);
+ }
+ } catch (error) {
+ throw new SecretSyncError({ error, secretKey: key });
+ }
+ }
+
+ if (disableSecretDeletion) return;
+
+ for (const envVar of existingEnvVars) {
+ // Never touch system-managed variables, and only consider keys matching the configured schema
+ if (!isModifiable(envVar) || !matchesSchema(envVar.key, environment?.slug || "", keySchema)) {
+ // eslint-disable-next-line no-continue
+ continue;
+ }
+
+ if (!(envVar.key in secretMap)) {
+ try {
+ // eslint-disable-next-line no-await-in-loop
+ await deleteCloud66EnvVar(accessToken, stackId, envVar.key);
+ } catch (error) {
+ throw new SecretSyncError({ error, secretKey: envVar.key });
+ }
+ }
+ }
+ },
+
+ async getSecrets(secretSync: TCloud66SyncWithCredentials): Promise<TSecretMap> {
+ const {
+ connection,
+ destinationConfig: { stackId }
+ } = secretSync;
+
+ const { accessToken } = connection.credentials;
+
+ const existingEnvVars = await listCloud66EnvVars(accessToken, stackId);
+
+ return Object.fromEntries(existingEnvVars.map((envVar) => [envVar.key, { value: envVar.value }]));
+ },
+
+ async removeSecrets(secretSync: TCloud66SyncWithCredentials, secretMap: TSecretMap) {
+ const {
+ connection,
+ destinationConfig: { stackId }
+ } = secretSync;
+
+ const { accessToken } = connection.credentials;
+
+ const existingEnvVars = await listCloud66EnvVars(accessToken, stackId);
+
+ for (const envVar of existingEnvVars) {
+ if (isModifiable(envVar) && envVar.key in secretMap) {
+ try {
+ // eslint-disable-next-line no-await-in-loop
+ await deleteCloud66EnvVar(accessToken, stackId, envVar.key);
+ } catch (error) {
+ throw new SecretSyncError({ error, secretKey: envVar.key });
+ }
+ }
+ }
+ }
+};
diff --git a/backend/src/services/secret-sync/cloud66/cloud66-sync-schemas.ts b/backend/src/services/secret-sync/cloud66/cloud66-sync-schemas.ts
new file mode 100644
index 0000000000..1b870a9f70
--- /dev/null
+++ b/backend/src/services/secret-sync/cloud66/cloud66-sync-schemas.ts
@@ -0,0 +1,54 @@
+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 { SECRET_SYNC_NAME_MAP } from "@app/services/secret-sync/secret-sync-maps";
+import {
+ BaseSecretSyncSchema,
+ GenericCreateSecretSyncFieldsSchema,
+ GenericUpdateSecretSyncFieldsSchema
+} from "@app/services/secret-sync/secret-sync-schemas";
+import { TSyncOptionsConfig } from "@app/services/secret-sync/secret-sync-types";
+
+const Cloud66SyncDestinationConfigSchema = z.object({
+ stackId: z.string().trim().min(1, "Stack ID is required").describe(SecretSyncs.DESTINATION_CONFIG.CLOUD66.stackId),
+ stackName: z
+ .string()
+ .trim()
+ .min(1, "Stack Name is required")
+ .describe(SecretSyncs.DESTINATION_CONFIG.CLOUD66.stackName)
+});
+
+const Cloud66SyncOptionsConfig: TSyncOptionsConfig = { canImportSecrets: true };
+
+export const Cloud66SyncSchema = BaseSecretSyncSchema(SecretSync.Cloud66, Cloud66SyncOptionsConfig)
+ .extend({
+ destination: z.literal(SecretSync.Cloud66),
+ destinationConfig: Cloud66SyncDestinationConfigSchema
+ })
+ .describe(JSON.stringify({ title: SECRET_SYNC_NAME_MAP[SecretSync.Cloud66] }));
+
+export const CreateCloud66SyncSchema = GenericCreateSecretSyncFieldsSchema(
+ SecretSync.Cloud66,
+ Cloud66SyncOptionsConfig
+).extend({
+ destinationConfig: Cloud66SyncDestinationConfigSchema
+});
+
+export const UpdateCloud66SyncSchema = GenericUpdateSecretSyncFieldsSchema(
+ SecretSync.Cloud66,
+ Cloud66SyncOptionsConfig
+).extend({
+ destinationConfig: Cloud66SyncDestinationConfigSchema.optional()
+});
+
+export const Cloud66SyncListItemSchema = z
+ .object({
+ name: z.literal("Cloud 66"),
+ connection: z.literal(AppConnection.Cloud66),
+ destination: z.literal(SecretSync.Cloud66),
+ canImportSecrets: z.literal(true),
+ canRemoveSecretsOnDeletion: z.literal(true)
+ })
+ .describe(JSON.stringify({ title: SECRET_SYNC_NAME_MAP[SecretSync.Cloud66] }));
diff --git a/backend/src/services/secret-sync/cloud66/cloud66-sync-types.ts b/backend/src/services/secret-sync/cloud66/cloud66-sync-types.ts
new file mode 100644
index 0000000000..1037de6ef6
--- /dev/null
+++ b/backend/src/services/secret-sync/cloud66/cloud66-sync-types.ts
@@ -0,0 +1,23 @@
+import z from "zod";
+
+import { TCloud66Connection } from "@app/services/app-connection/cloud-66";
+
+import { Cloud66SyncListItemSchema, Cloud66SyncSchema, CreateCloud66SyncSchema } from "./cloud66-sync-schemas";
+
+export type TCloud66SyncListItem = z.infer<typeof Cloud66SyncListItemSchema>;
+
+export type TCloud66Sync = z.infer<typeof Cloud66SyncSchema>;
+
+export type TCloud66SyncInput = z.infer<typeof CreateCloud66SyncSchema>;
+
+export type TCloud66SyncWithCredentials = TCloud66Sync & {
+ connection: TCloud66Connection;
+};
+
+export type TCloud66EnvVar = {
+ id: number;
+ key: string;
+ value: string;
+ readonly: boolean;
+ is_generated: boolean;
+};
diff --git a/backend/src/services/secret-sync/cloud66/index.ts b/backend/src/services/secret-sync/cloud66/index.ts
new file mode 100644
index 0000000000..ccb8b7b81b
--- /dev/null
+++ b/backend/src/services/secret-sync/cloud66/index.ts
@@ -0,0 +1,4 @@
+export * from "./cloud66-sync-constants";
+export * from "./cloud66-sync-fns";
+export * from "./cloud66-sync-schemas";
+export * from "./cloud66-sync-types";
diff --git a/backend/src/services/secret-sync/secret-sync-enums.ts b/backend/src/services/secret-sync/secret-sync-enums.ts
index b7c3793f77..8115730f02 100644
--- a/backend/src/services/secret-sync/secret-sync-enums.ts
+++ b/backend/src/services/secret-sync/secret-sync-enums.ts
@@ -41,7 +41,8 @@ export enum SecretSync {
Devin = "devin",
Ona = "ona",
TravisCI = "travis-ci",
- Snowflake = "snowflake"
+ Snowflake = "snowflake",
+ Cloud66 = "cloud-66"
}
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 c0fbc56495..916e311477 100644
--- a/backend/src/services/secret-sync/secret-sync-fns.ts
+++ b/backend/src/services/secret-sync/secret-sync-fns.ts
@@ -51,6 +51,7 @@ import { CAMUNDA_SYNC_LIST_OPTION, camundaSyncFactory } from "./camunda";
import { CHECKLY_SYNC_LIST_OPTION } from "./checkly/checkly-sync-constants";
import { ChecklySyncFns } from "./checkly/checkly-sync-fns";
import { CIRCLECI_SYNC_LIST_OPTION, CircleCISyncFns } from "./circleci";
+import { CLOUD66_SYNC_LIST_OPTION, Cloud66SyncFns } from "./cloud66";
import { CLOUDFLARE_PAGES_SYNC_LIST_OPTION } from "./cloudflare-pages/cloudflare-pages-constants";
import { CloudflarePagesSyncFns } from "./cloudflare-pages/cloudflare-pages-fns";
import { CLOUDFLARE_WORKERS_SYNC_LIST_OPTION, CloudflareWorkersSyncFns } from "./cloudflare-workers";
@@ -131,7 +132,8 @@ const SECRET_SYNC_LIST_OPTIONS: Record<SecretSync, TSecretSyncListItem> = {
[SecretSync.Devin]: DEVIN_SYNC_LIST_OPTION,
[SecretSync.Ona]: ONA_SYNC_LIST_OPTION,
[SecretSync.TravisCI]: TRAVIS_CI_SYNC_LIST_OPTION,
- [SecretSync.Snowflake]: SNOWFLAKE_SYNC_LIST_OPTION
+ [SecretSync.Snowflake]: SNOWFLAKE_SYNC_LIST_OPTION,
+ [SecretSync.Cloud66]: CLOUD66_SYNC_LIST_OPTION
};
export const listSecretSyncOptions = () => {
@@ -429,6 +431,8 @@ export const SecretSyncFns = {
return TravisCISyncFns.syncSecrets(secretSync, schemaSecretMap);
case SecretSync.Snowflake:
return SnowflakeSyncFns.syncSecrets(secretSync, schemaSecretMap);
+ case SecretSync.Cloud66:
+ return Cloud66SyncFns.syncSecrets(secretSync, schemaSecretMap);
default:
throw new Error(
`Unhandled sync destination for sync secrets fns: ${(secretSync as TSecretSyncWithCredentials).destination}`
@@ -590,6 +594,9 @@ export const SecretSyncFns = {
case SecretSync.Snowflake:
secretMap = await SnowflakeSyncFns.getSecrets(secretSync);
break;
+ case SecretSync.Cloud66:
+ secretMap = await Cloud66SyncFns.getSecrets(secretSync);
+ break;
default:
throw new Error(
`Unhandled sync destination for get secrets fns: ${(secretSync as TSecretSyncWithCredentials).destination}`
@@ -734,6 +741,8 @@ export const SecretSyncFns = {
return TravisCISyncFns.removeSecrets(secretSync, schemaSecretMap);
case SecretSync.Snowflake:
return SnowflakeSyncFns.removeSecrets(secretSync, schemaSecretMap);
+ case SecretSync.Cloud66:
+ return Cloud66SyncFns.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 2012c99ae7..8eb98b3a92 100644
--- a/backend/src/services/secret-sync/secret-sync-maps.ts
+++ b/backend/src/services/secret-sync/secret-sync-maps.ts
@@ -45,7 +45,8 @@ export const SECRET_SYNC_NAME_MAP: Record<SecretSync, string> = {
[SecretSync.Devin]: "Devin",
[SecretSync.Ona]: "Ona",
[SecretSync.TravisCI]: "Travis CI",
- [SecretSync.Snowflake]: "Snowflake"
+ [SecretSync.Snowflake]: "Snowflake",
+ [SecretSync.Cloud66]: "Cloud 66"
};
export const SECRET_SYNC_CONNECTION_MAP: Record<SecretSync, AppConnection> = {
@@ -91,7 +92,8 @@ export const SECRET_SYNC_CONNECTION_MAP: Record<SecretSync, AppConnection> = {
[SecretSync.Devin]: AppConnection.Devin,
[SecretSync.Ona]: AppConnection.Ona,
[SecretSync.TravisCI]: AppConnection.TravisCI,
- [SecretSync.Snowflake]: AppConnection.Snowflake
+ [SecretSync.Snowflake]: AppConnection.Snowflake,
+ [SecretSync.Cloud66]: AppConnection.Cloud66
};
export const SECRET_SYNC_PLAN_MAP: Record<SecretSync, SecretSyncPlanType> = {
@@ -137,7 +139,8 @@ export const SECRET_SYNC_PLAN_MAP: Record<SecretSync, SecretSyncPlanType> = {
[SecretSync.Devin]: SecretSyncPlanType.Regular,
[SecretSync.Ona]: SecretSyncPlanType.Regular,
[SecretSync.TravisCI]: SecretSyncPlanType.Regular,
- [SecretSync.Snowflake]: SecretSyncPlanType.Regular
+ [SecretSync.Snowflake]: SecretSyncPlanType.Regular,
+ [SecretSync.Cloud66]: SecretSyncPlanType.Regular
};
export const SECRET_SYNC_SKIP_FIELDS_MAP: Record<SecretSync, string[]> = {
@@ -192,7 +195,8 @@ export const SECRET_SYNC_SKIP_FIELDS_MAP: Record<SecretSync, string[]> = {
[SecretSync.Devin]: [],
[SecretSync.Ona]: ["projectName"],
[SecretSync.TravisCI]: ["repositorySlug"],
- [SecretSync.Snowflake]: []
+ [SecretSync.Snowflake]: [],
+ [SecretSync.Cloud66]: ["stackName"]
};
const defaultDuplicateCheck: DestinationDuplicateCheckFn = () => true;
@@ -264,7 +268,8 @@ export const DESTINATION_DUPLICATE_CHECK_MAP: Record<SecretSync, DestinationDupl
[SecretSync.Devin]: defaultDuplicateCheck,
[SecretSync.Ona]: defaultDuplicateCheck,
[SecretSync.TravisCI]: defaultDuplicateCheck,
- [SecretSync.Snowflake]: defaultDuplicateCheck
+ [SecretSync.Snowflake]: defaultDuplicateCheck,
+ [SecretSync.Cloud66]: defaultDuplicateCheck
};
/**
diff --git a/backend/src/services/secret-sync/secret-sync-types.ts b/backend/src/services/secret-sync/secret-sync-types.ts
index ba577e867d..0acf18b209 100644
--- a/backend/src/services/secret-sync/secret-sync-types.ts
+++ b/backend/src/services/secret-sync/secret-sync-types.ts
@@ -100,6 +100,12 @@ import {
TChecklySyncWithCredentials
} from "./checkly/checkly-sync-types";
import { TCircleCISync, TCircleCISyncInput, TCircleCISyncListItem, TCircleCISyncWithCredentials } from "./circleci";
+import {
+ TCloud66Sync,
+ TCloud66SyncInput,
+ TCloud66SyncListItem,
+ TCloud66SyncWithCredentials
+} from "./cloud66/cloud66-sync-types";
import {
TCloudflarePagesSync,
TCloudflarePagesSyncInput,
@@ -249,7 +255,8 @@ export type TSecretSync =
| TDevinSync
| TOnaSync
| TTravisCISync
- | TSnowflakeSync;
+ | TSnowflakeSync
+ | TCloud66Sync;
export type TSecretSyncWithCredentials =
| TAwsParameterStoreSyncWithCredentials
@@ -294,7 +301,8 @@ export type TSecretSyncWithCredentials =
| TDevinSyncWithCredentials
| TOnaSyncWithCredentials
| TTravisCISyncWithCredentials
- | TSnowflakeSyncWithCredentials;
+ | TSnowflakeSyncWithCredentials
+ | TCloud66SyncWithCredentials;
export type TSecretSyncInput =
| TAwsParameterStoreSyncInput
@@ -339,7 +347,8 @@ export type TSecretSyncInput =
| TDevinSyncInput
| TOnaSyncInput
| TTravisCISyncInput
- | TSnowflakeSyncInput;
+ | TSnowflakeSyncInput
+ | TCloud66SyncInput;
export type TSecretSyncListItem =
| TAwsParameterStoreSyncListItem
@@ -384,7 +393,8 @@ export type TSecretSyncListItem =
| TDevinSyncListItem
| TOnaSyncListItem
| TTravisCISyncListItem
- | TSnowflakeSyncListItem;
+ | TSnowflakeSyncListItem
+ | TCloud66SyncListItem;
export type TSyncOptionsConfig = {
canImportSecrets: boolean;
diff --git a/docs/docs.json b/docs/docs.json
index 9d92bfca8f..13371114d8 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -122,6 +122,7 @@
"integrations/app-connections/checkly",
"integrations/app-connections/circleci",
"integrations/app-connections/chef",
+ "integrations/app-connections/cloud-66",
"integrations/app-connections/cloudflare",
"integrations/app-connections/convex",
"integrations/app-connections/databricks",
@@ -634,6 +635,7 @@
"integrations/secret-syncs/checkly",
"integrations/secret-syncs/chef",
"integrations/secret-syncs/circleci",
+ "integrations/secret-syncs/cloud-66",
"integrations/secret-syncs/cloudflare-pages",
"integrations/secret-syncs/cloudflare-workers",
"integrations/secret-syncs/databricks",
diff --git a/docs/integrations/app-connections/cloud-66.mdx b/docs/integrations/app-connections/cloud-66.mdx
new file mode 100644
index 0000000000..550c099433
--- /dev/null
+++ b/docs/integrations/app-connections/cloud-66.mdx
@@ -0,0 +1,38 @@
+---
+title: "Cloud 66 Connection"
+description: "Learn how to configure a Cloud 66 Connection for Infisical using a Personal Access Token."
+---
+
+Infisical supports connecting to Cloud 66 using a **Personal Access Token**.
+
+## Setup Cloud 66 Connection in Infisical
+
+<Steps>
+ <Step title="Generate a Cloud 66 Personal Access Token">
+ Log in to your [Cloud 66 account](https://app.cloud66.com) and navigate to your account's **Personal Access Tokens** settings to create a new token.
+
+ Ensure the token has permission to read your stacks and manage their environment variables.
+
+ <Warning>
+ Keep your Personal Access Token secure and do not share it. Anyone with access to this token can manage your Cloud 66 stacks.
+ </Warning>
+ </Step>
+ <Step title="Navigate to App Connections">
+ Navigate to the **Integrations** tab in the desired project, then select **App Connections**.
+ ![App Connections Tab](/images/app-connections/general/add-connection.png)
+ </Step>
+ <Step title="Add Connection">
+ Select the **Cloud 66 Connection** option from the connection options modal.
+ </Step>
+ <Step title="Configure Personal Access Token">
+ Paste your Cloud 66 Personal Access Token into the provided field, then click **Connect**.
+ </Step>
+ <Step title="Connection Created">
+ Your **Cloud 66 Connection** is now available for use.
+ </Step>
+</Steps>
+
+<Info>
+ Personal Access Token connections require manual token rotation when your Cloud 66 token expires or is
+ regenerated. Monitor your connection status and update the token as needed.
+</Info>
diff --git a/docs/integrations/secret-syncs/cloud-66.mdx b/docs/integrations/secret-syncs/cloud-66.mdx
new file mode 100644
index 0000000000..03b498687d
--- /dev/null
+++ b/docs/integrations/secret-syncs/cloud-66.mdx
@@ -0,0 +1,144 @@
+---
+title: "Cloud 66 Sync"
+description: "Learn how to configure a Cloud 66 Sync for Infisical."
+---
+
+**Prerequisites:**
+
+- Set up and add secrets to [Infisical Cloud](https://app.infisical.com)
+- Create a [Cloud 66 Connection](/integrations/app-connections/cloud-66)
+
+<Note>
+ Cloud 66 only applies environment variable changes to your servers on the
+ next deployment. After a sync runs, redeploy the target stack in Cloud 66
+ for the updated secrets to take effect. System-managed variables (read-only
+ or generated by Cloud 66) are never modified or removed by Infisical.
+</Note>
+
+<Tabs>
+ <Tab title="Infisical UI">
+ 1. Navigate to **Project** > **Integrations** and select the **Secret Syncs** tab. Click on the **Add Sync** button.
+ ![Secret Syncs Tab](/images/secret-syncs/general/secret-sync-tab.png)
+
+ 2. Select the **Cloud 66** option.
+
+ 3. Configure the **Source** from where secrets should be retrieved, then click **Next**.
+
+ - **Environment**: The project environment to retrieve secrets from.
+ - **Secret Path**: The folder path to retrieve secrets from.
+
+ <Tip>
+ If you need to sync secrets from multiple folder locations, check out [secret imports](/documentation/platform/secret-reference#secret-imports).
+ </Tip>
+
+ 4. Configure the **Destination** to where secrets should be deployed, then click **Next**.
+
+ - **Cloud 66 Connection**: The Cloud 66 Connection to authenticate with.
+ - **Stack**: The Cloud 66 stack (application) to sync secrets to.
+
+ 5. Configure the **Sync Options** to specify how secrets should be synced, then click **Next**.
+
+ - **Initial Sync Behavior**: Determines how Infisical should resolve the initial sync.
+ - **Import - Prefer values from Infisical**: Import secrets from Cloud 66 to Infisical; if a secret with the same name already exists in Infisical, do nothing. Afterwards, sync secrets to Cloud 66.
+ - **Import - Prefer values from Cloud 66**: Import secrets from Cloud 66 to Infisical; if a secret with the same name already exists in Infisical, replace its value with the one from Cloud 66. Afterwards, sync secrets to Cloud 66.
+ - **Overwrite Destination Secrets**: Removes any secrets at the destination endpoint not present in Infisical.
+ - **Key Schema**: Template that determines how secret names are transformed when syncing, using `{{secretKey}}` as a placeholder for the original secret name and `{{environment}}` for the environment.
+ <Note>
+ We highly recommend using a Key Schema to ensure that Infisical only manages the specific keys you intend, keeping everything else untouched.
+ </Note>
+ - **Auto-Sync Enabled**: If enabled, secrets will automatically be synced from the source location when changes occur. Disable to enforce manual syncing only.
+ - **Disable Secret Deletion**: If enabled, Infisical will not remove secrets from the sync destination. Enable this option if you intend to manage some secrets manually outside of Infisical.
+
+ 6. Configure the **Details** of your Cloud 66 Sync, then click **Next**.
+
+ - **Name**: The name of your sync. Must be slug-friendly.
+ - **Description**: An optional description for your sync.
+
+ 7. Review your Cloud 66 Sync configuration, then click **Create Sync**.
+
+ 8. If enabled, your Cloud 66 Sync will begin syncing your secrets to the destination endpoint.
+
+ </Tab>
+ <Tab title="API">
+ To create a **Cloud 66 Sync**, make an API request to the [Create Cloud 66 Sync](/api-reference/endpoints/secret-syncs/cloud-66/create) API endpoint.
+
+ ### Sample request
+
+ ```bash Request
+ curl --request POST \
+ --url https://app.infisical.com/api/v1/secret-syncs/cloud-66 \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "name": "my-cloud-66-sync",
+ "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
+ "description": "an example sync",
+ "connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
+ "environment": "dev",
+ "secretPath": "/my-secrets",
+ "isEnabled": true,
+ "syncOptions": {
+ "initialSyncBehavior": "overwrite-destination",
+ "disableSecretDeletion": true
+ },
+ "destinationConfig": {
+ "stackId": "stack-550e8400-e29b-41d4-a716",
+ "stackName": "my-stack"
+ }
+ }'
+ ```
+
+ ### Sample response
+
+ ```bash Response
+ {
+ "secretSync": {
+ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
+ "name": "my-cloud-66-sync",
+ "description": "an example sync",
+ "isEnabled": true,
+ "version": 1,
+ "folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
+ "connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
+ "createdAt": "2023-11-07T05:31:56Z",
+ "updatedAt": "2023-11-07T05:31:56Z",
+ "syncStatus": "succeeded",
+ "lastSyncJobId": "123",
+ "lastSyncMessage": null,
+ "lastSyncedAt": "2023-11-07T05:31:56Z",
+ "importStatus": null,
+ "lastImportJobId": null,
+ "lastImportMessage": null,
+ "lastImportedAt": null,
+ "removeStatus": null,
+ "lastRemoveJobId": null,
+ "lastRemoveMessage": null,
+ "lastRemovedAt": null,
+ "syncOptions": {
+ "initialSyncBehavior": "overwrite-destination",
+ "disableSecretDeletion": true
+ },
+ "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
+ "connection": {
+ "app": "cloud-66",
+ "name": "my-cloud-66-connection",
+ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
+ },
+ "environment": {
+ "slug": "dev",
+ "name": "Development",
+ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
+ },
+ "folder": {
+ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
+ "path": "/my-secrets"
+ },
+ "destination": "cloud-66",
+ "destinationConfig": {
+ "stackId": "stack-550e8400-e29b-41d4-a716",
+ "stackName": "my-stack"
+ }
+ }
+ }
+ ```
+ </Tab>
+</Tabs>
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/Cloud66SyncFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/Cloud66SyncFields.tsx
new file mode 100644
index 0000000000..5e5768dde8
--- /dev/null
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/Cloud66SyncFields.tsx
@@ -0,0 +1,70 @@
+import { Controller, useFormContext, useWatch } from "react-hook-form";
+import { SingleValue } from "react-select";
+
+import { SecretSyncConnectionField } from "@app/components/secret-syncs/forms/SecretSyncConnectionField";
+import {
+ Field,
+ FieldContent,
+ FieldError,
+ FieldGroup,
+ FieldLabel,
+ FilterableSelect
+} from "@app/components/v3";
+import { TCloud66Stack } from "@app/hooks/api/appConnections/cloud-66";
+import { useCloud66ConnectionListStacks } from "@app/hooks/api/appConnections/cloud-66/queries";
+import { SecretSync } from "@app/hooks/api/secretSyncs";
+
+import { TSecretSyncForm } from "../schemas";
+
+export const Cloud66SyncFields = () => {
+ const { control, setValue } = useFormContext<
+ TSecretSyncForm & { destination: SecretSync.Cloud66 }
+ >();
+
+ const connectionId = useWatch({ name: "connection.id", control });
+
+ const { data: stacks, isLoading: isStacksLoading } = useCloud66ConnectionListStacks(
+ connectionId,
+ {
+ enabled: Boolean(connectionId)
+ }
+ );
+
+ return (
+ <FieldGroup>
+ <SecretSyncConnectionField
+ onChange={() => {
+ setValue("destinationConfig.stackId", "");
+ setValue("destinationConfig.stackName", "");
+ }}
+ />
+
+ <Controller
+ name="destinationConfig.stackId"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>Stack</FieldLabel>
+ <FieldContent>
+ <FilterableSelect
+ isLoading={isStacksLoading && Boolean(connectionId)}
+ isDisabled={!connectionId}
+ value={stacks?.find((stack) => stack.id === value) ?? null}
+ onChange={(option) => {
+ const selectedStack = option as SingleValue<TCloud66Stack>;
+ onChange(selectedStack?.id ?? "");
+ setValue("destinationConfig.stackName", selectedStack?.name ?? "");
+ }}
+ options={stacks}
+ placeholder="Select a stack..."
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.id}
+ />
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ )}
+ />
+ </FieldGroup>
+ );
+};
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/SecretSyncDestinationFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/SecretSyncDestinationFields.tsx
index 24811b6e0e..b87e775f37 100644
--- a/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/SecretSyncDestinationFields.tsx
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/SecretSyncDestinationFields.tsx
@@ -15,6 +15,7 @@ import { CamundaSyncFields } from "./CamundaSyncFields";
import { ChecklySyncFields } from "./ChecklySyncFields";
import { ChefSyncFields } from "./ChefSyncFields";
import { CircleCISyncFields } from "./CircleCISyncFields";
+import { Cloud66SyncFields } from "./Cloud66SyncFields";
import { CloudflarePagesSyncFields } from "./CloudflarePagesSyncFields";
import { CloudflareWorkersSyncFields } from "./CloudflareWorkersSyncFields";
import { DatabricksSyncFields } from "./DatabricksSyncFields";
@@ -139,6 +140,8 @@ export const SecretSyncDestinationFields = () => {
return <SnowflakeSyncFields />;
case SecretSync.TriggerDev:
return <TriggerDevSyncFields />;
+ case SecretSync.Cloud66:
+ return <Cloud66SyncFields />;
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 3c340cb1e4..9ace6ad6f3 100644
--- a/frontend/src/components/secret-syncs/forms/SecretSyncOptionsFields/SecretSyncOptionsFields.tsx
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncOptionsFields/SecretSyncOptionsFields.tsx
@@ -132,6 +132,7 @@ export const SecretSyncOptionsFields = ({ hideInitialSync, children }: Props) =>
case SecretSync.Ona:
case SecretSync.TravisCI:
case SecretSync.Snowflake:
+ case SecretSync.Cloud66:
AdditionalSyncOptionsFieldsComponent = null;
break;
default:
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/Cloud66SyncReviewFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/Cloud66SyncReviewFields.tsx
new file mode 100644
index 0000000000..e01b0f94f7
--- /dev/null
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/Cloud66SyncReviewFields.tsx
@@ -0,0 +1,24 @@
+import { useFormContext } from "react-hook-form";
+
+import { TSecretSyncForm } from "@app/components/secret-syncs/forms/schemas";
+import { Detail, DetailLabel, DetailValue } from "@app/components/v3";
+import { SecretSync } from "@app/hooks/api/secretSyncs";
+
+export const Cloud66SyncReviewFields = () => {
+ const { watch } = useFormContext<TSecretSyncForm & { destination: SecretSync.Cloud66 }>();
+ const stackName = watch("destinationConfig.stackName");
+ const stackId = watch("destinationConfig.stackId");
+
+ return (
+ <>
+ <Detail>
+ <DetailLabel>Stack</DetailLabel>
+ <DetailValue>{stackName}</DetailValue>
+ </Detail>
+ <Detail>
+ <DetailLabel>Stack ID</DetailLabel>
+ <DetailValue>{stackId}</DetailValue>
+ </Detail>
+ </>
+ );
+};
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx
index 228f0b5c1a..96e41dd3a8 100644
--- a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx
@@ -35,6 +35,7 @@ import { CamundaSyncReviewFields } from "./CamundaSyncReviewFields";
import { ChecklySyncReviewFields } from "./ChecklySyncReviewFields";
import { ChefSyncReviewFields } from "./ChefSyncReviewFields";
import { CircleCISyncReviewFields } from "./CircleCISyncReviewFields";
+import { Cloud66SyncReviewFields } from "./Cloud66SyncReviewFields";
import { CloudflarePagesSyncReviewFields } from "./CloudflarePagesReviewFields";
import { CloudflareWorkersSyncReviewFields } from "./CloudflareWorkersReviewFields";
import { DatabricksSyncReviewFields } from "./DatabricksSyncReviewFields";
@@ -234,6 +235,9 @@ export const SecretSyncReviewFields = () => {
DestinationFieldsComponent = <TriggerDevSyncReviewFields />;
AdditionalSyncOptionsFieldsComponent = <TriggerDevSyncOptionsReviewFields />;
break;
+ case SecretSync.Cloud66:
+ DestinationFieldsComponent = <Cloud66SyncReviewFields />;
+ break;
default:
throw new Error(`Unhandled Destination Review Fields: ${destination}`);
}
diff --git a/frontend/src/components/secret-syncs/forms/schemas/cloud-66-sync-destination-schema.ts b/frontend/src/components/secret-syncs/forms/schemas/cloud-66-sync-destination-schema.ts
new file mode 100644
index 0000000000..459e02e7aa
--- /dev/null
+++ b/frontend/src/components/secret-syncs/forms/schemas/cloud-66-sync-destination-schema.ts
@@ -0,0 +1,14 @@
+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 Cloud66SyncDestinationSchema = BaseSecretSyncSchema().merge(
+ z.object({
+ destination: z.literal(SecretSync.Cloud66),
+ destinationConfig: z.object({
+ stackId: z.string().trim().min(1, "Stack ID required"),
+ stackName: z.string().trim().min(1, "Stack name required")
+ })
+ })
+);
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 c2e1a6a228..f6dadcec30 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
@@ -12,6 +12,7 @@ import { CamundaSyncDestinationSchema } from "./camunda-sync-destination-schema"
import { ChecklySyncDestinationSchema } from "./checkly-sync-destination-schema";
import { ChefSyncDestinationSchema } from "./chef-sync-destination-schema";
import { CircleCISyncDestinationSchema } from "./circleci-sync-destination-schema";
+import { Cloud66SyncDestinationSchema } from "./cloud-66-sync-destination-schema";
import { CloudflarePagesSyncDestinationSchema } from "./cloudflare-pages-sync-destination-schema";
import { CloudflareWorkersSyncDestinationSchema } from "./cloudflare-workers-sync-destination-schema";
import { DatabricksSyncDestinationSchema } from "./databricks-sync-destination-schema";
@@ -87,7 +88,8 @@ const SecretSyncUnionSchema = z.discriminatedUnion("destination", [
OnaSyncDestinationSchema,
TravisCISyncDestinationSchema,
SnowflakeSyncDestinationSchema,
- TriggerDevSyncDestinationSchema
+ TriggerDevSyncDestinationSchema,
+ Cloud66SyncDestinationSchema
]);
export const SecretSyncFormSchema = SecretSyncUnionSchema;
diff --git a/frontend/src/helpers/secretSyncs.ts b/frontend/src/helpers/secretSyncs.ts
index 4e99658d9a..1259cb0174 100644
--- a/frontend/src/helpers/secretSyncs.ts
+++ b/frontend/src/helpers/secretSyncs.ts
@@ -276,6 +276,12 @@ export const SECRET_SYNC_MAP: Record<
image: "TriggerDev.png",
category: "HOSTING",
description: "Environment variables for Trigger.dev projects."
+ },
+ [SecretSync.Cloud66]: {
+ name: "Cloud 66",
+ image: "Cloud 66.png",
+ category: "HOSTING",
+ description: "Environment variables for Cloud 66 stacks."
}
};
@@ -329,7 +335,8 @@ export const SECRET_SYNC_CONNECTION_MAP: Record<SecretSync, AppConnection> = {
[SecretSync.Ona]: AppConnection.Ona,
[SecretSync.TravisCI]: AppConnection.TravisCI,
[SecretSync.Snowflake]: AppConnection.Snowflake,
- [SecretSync.TriggerDev]: AppConnection.TriggerDev
+ [SecretSync.TriggerDev]: AppConnection.TriggerDev,
+ [SecretSync.Cloud66]: AppConnection.Cloud66
};
export const SECRET_SYNC_INITIAL_SYNC_BEHAVIOR_MAP: Record<
diff --git a/frontend/src/hooks/api/appConnections/cloud-66/index.ts b/frontend/src/hooks/api/appConnections/cloud-66/index.ts
new file mode 100644
index 0000000000..2c1906d369
--- /dev/null
+++ b/frontend/src/hooks/api/appConnections/cloud-66/index.ts
@@ -0,0 +1,2 @@
+export * from "./queries";
+export * from "./types";
diff --git a/frontend/src/hooks/api/appConnections/cloud-66/queries.tsx b/frontend/src/hooks/api/appConnections/cloud-66/queries.tsx
new file mode 100644
index 0000000000..1e4535af43
--- /dev/null
+++ b/frontend/src/hooks/api/appConnections/cloud-66/queries.tsx
@@ -0,0 +1,37 @@
+import { useQuery, UseQueryOptions } from "@tanstack/react-query";
+
+import { apiRequest } from "@app/config/request";
+
+import { appConnectionKeys } from "../queries";
+import { TCloud66Stack } from "./types";
+
+const cloud66ConnectionKeys = {
+ all: [...appConnectionKeys.all, "cloud-66"] as const,
+ listStacks: (connectionId: string) =>
+ [...cloud66ConnectionKeys.all, "stacks", connectionId] as const
+};
+
+export const useCloud66ConnectionListStacks = (
+ connectionId: string,
+ options?: Omit<
+ UseQueryOptions<
+ TCloud66Stack[],
+ unknown,
+ TCloud66Stack[],
+ ReturnType<typeof cloud66ConnectionKeys.listStacks>
+ >,
+ "queryKey" | "queryFn"
+ >
+) => {
+ return useQuery({
+ queryKey: cloud66ConnectionKeys.listStacks(connectionId),
+ queryFn: async () => {
+ const { data } = await apiRequest.get<TCloud66Stack[]>(
+ `/api/v1/app-connections/cloud-66/${connectionId}/stacks`
+ );
+
+ return data;
+ },
+ ...options
+ });
+};
diff --git a/frontend/src/hooks/api/appConnections/cloud-66/types.ts b/frontend/src/hooks/api/appConnections/cloud-66/types.ts
new file mode 100644
index 0000000000..1e2164348c
--- /dev/null
+++ b/frontend/src/hooks/api/appConnections/cloud-66/types.ts
@@ -0,0 +1,4 @@
+export type TCloud66Stack = {
+ id: string;
+ name: string;
+};
diff --git a/frontend/src/hooks/api/secretSyncs/enums.ts b/frontend/src/hooks/api/secretSyncs/enums.ts
index 75fdbaa4ba..459346b1a2 100644
--- a/frontend/src/hooks/api/secretSyncs/enums.ts
+++ b/frontend/src/hooks/api/secretSyncs/enums.ts
@@ -41,7 +41,8 @@ export enum SecretSync {
Ona = "ona",
TravisCI = "travis-ci",
Snowflake = "snowflake",
- TriggerDev = "trigger-dev"
+ TriggerDev = "trigger-dev",
+ Cloud66 = "cloud-66"
}
export enum SecretSyncStatus {
diff --git a/frontend/src/hooks/api/secretSyncs/types/cloud-66-sync.ts b/frontend/src/hooks/api/secretSyncs/types/cloud-66-sync.ts
new file mode 100644
index 0000000000..9bbcb7e2e8
--- /dev/null
+++ b/frontend/src/hooks/api/secretSyncs/types/cloud-66-sync.ts
@@ -0,0 +1,16 @@
+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 TCloud66Sync = TRootSecretSync & {
+ destination: SecretSync.Cloud66;
+ destinationConfig: {
+ stackId: string;
+ stackName: string;
+ };
+ connection: {
+ app: AppConnection.Cloud66;
+ name: string;
+ id: string;
+ };
+};
diff --git a/frontend/src/hooks/api/secretSyncs/types/index.ts b/frontend/src/hooks/api/secretSyncs/types/index.ts
index 8c436fb0d7..c6ec5007de 100644
--- a/frontend/src/hooks/api/secretSyncs/types/index.ts
+++ b/frontend/src/hooks/api/secretSyncs/types/index.ts
@@ -13,6 +13,7 @@ import { TCamundaSync } from "./camunda-sync";
import { TChecklySync } from "./checkly-sync";
import { TChefSync } from "./chef-sync";
import { TCircleCISync } from "./circleci-sync";
+import { TCloud66Sync } from "./cloud-66-sync";
import { TCloudflarePagesSync } from "./cloudflare-pages-sync";
import { TCloudflareWorkersSync } from "./cloudflare-workers-sync";
import { TDatabricksSync } from "./databricks-sync";
@@ -98,7 +99,8 @@ export type TSecretSync =
| TOnaSync
| TTravisCISync
| TSnowflakeSync
- | TTriggerDevSync;
+ | TTriggerDevSync
+ | TCloud66Sync;
export type TListSecretSyncs = { secretSyncs: TSecretSync[] };
diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/Cloud66SyncDestinationCol.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/Cloud66SyncDestinationCol.tsx
new file mode 100644
index 0000000000..025a57c358
--- /dev/null
+++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/Cloud66SyncDestinationCol.tsx
@@ -0,0 +1,14 @@
+import { TCloud66Sync } from "@app/hooks/api/secretSyncs/types/cloud-66-sync";
+
+import { getSecretSyncDestinationColValues } from "../helpers";
+import { SecretSyncTableCell } from "../SecretSyncTableCell";
+
+type Props = {
+ secretSync: TCloud66Sync;
+};
+
+export const Cloud66SyncDestinationCol = ({ 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 c3bdc94149..aea76be631 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
@@ -12,6 +12,7 @@ import { CamundaSyncDestinationCol } from "./CamundaSyncDestinationCol";
import { ChecklySyncDestinationCol } from "./ChecklySyncDestinationCol";
import { ChefSyncDestinationCol } from "./ChefSyncDestinationCol";
import { CircleCISyncDestinationCol } from "./CircleCISyncDestinationCol";
+import { Cloud66SyncDestinationCol } from "./Cloud66SyncDestinationCol";
import { CloudflarePagesSyncDestinationCol } from "./CloudflarePagesSyncDestinationCol";
import { CloudflareWorkersSyncDestinationCol } from "./CloudflareWorkersSyncDestinationCol";
import { DatabricksSyncDestinationCol } from "./DatabricksSyncDestinationCol";
@@ -136,6 +137,8 @@ export const SecretSyncDestinationCol = ({ secretSync }: Props) => {
return <SnowflakeSyncDestinationCol secretSync={secretSync} />;
case SecretSync.TriggerDev:
return <TriggerDevSyncDestinationCol secretSync={secretSync} />;
+ case SecretSync.Cloud66:
+ return <Cloud66SyncDestinationCol 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 faea905f45..9bc936a2e1 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
@@ -265,6 +265,10 @@ export const getSecretSyncDestinationColValues = (secretSync: TSecretSync) => {
primaryText = destinationConfig.projectRef;
secondaryText = `Environment - ${destinationConfig.environment}`;
break;
+ case SecretSync.Cloud66:
+ primaryText = destinationConfig.stackName;
+ secondaryText = "Stack";
+ break;
default:
throw new Error(`Unhandled Destination Col Values ${destination}`);
}
diff --git a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/Cloud66SyncDestinationSection.tsx b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/Cloud66SyncDestinationSection.tsx
new file mode 100644
index 0000000000..d74db474aa
--- /dev/null
+++ b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/Cloud66SyncDestinationSection.tsx
@@ -0,0 +1,25 @@
+import { Detail, DetailLabel, DetailValue } from "@app/components/v3";
+import { TCloud66Sync } from "@app/hooks/api/secretSyncs/types/cloud-66-sync";
+
+type Props = {
+ secretSync: TCloud66Sync;
+};
+
+export const Cloud66SyncDestinationSection = ({ secretSync }: Props) => {
+ const {
+ destinationConfig: { stackId, stackName }
+ } = secretSync;
+
+ return (
+ <>
+ <Detail>
+ <DetailLabel>Stack</DetailLabel>
+ <DetailValue>{stackName}</DetailValue>
+ </Detail>
+ <Detail>
+ <DetailLabel>Stack ID</DetailLabel>
+ <DetailValue>{stackId}</DetailValue>
+ </Detail>
+ </>
+ );
+};
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 0e7bb59d90..3bb5aec2fa 100644
--- a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/SecretSyncDestinatonSection.tsx
+++ b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/SecretSyncDestinatonSection.tsx
@@ -16,6 +16,7 @@ import { CamundaSyncDestinationSection } from "./CamundaSyncDestinationSection";
import { ChecklySyncDestinationSection } from "./ChecklySyncDestinationSection";
import { ChefSyncDestinationSection } from "./ChefSyncDestinationSection";
import { CircleCISyncDestinationSection } from "./CircleCISyncDestinationSection";
+import { Cloud66SyncDestinationSection } from "./Cloud66SyncDestinationSection";
import { CloudflarePagesSyncDestinationSection } from "./CloudflarePagesSyncDestinationSection";
import { CloudflareWorkersSyncDestinationSection } from "./CloudflareWorkersSyncDestinationSection";
import { DatabricksSyncDestinationSection } from "./DatabricksSyncDestinationSection";
@@ -192,6 +193,9 @@ export const SecretSyncDestinationSection = ({ secretSync }: Props) => {
case SecretSync.TriggerDev:
DestinationComponents = <TriggerDevSyncDestinationSection secretSync={secretSync} />;
break;
+ case SecretSync.Cloud66:
+ DestinationComponents = <Cloud66SyncDestinationSection 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 1775c4b977..6bfbfc2394 100644
--- a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncOptionsSection/SecretSyncOptionsSection.tsx
+++ b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncOptionsSection/SecretSyncOptionsSection.tsx
@@ -91,6 +91,7 @@ export const SecretSyncOptionsSection = ({ secretSync }: Props) => {
case SecretSync.Ona:
case SecretSync.TravisCI:
case SecretSync.Snowflake:
+ case SecretSync.Cloud66:
AdditionalSyncOptionsComponent = null;
break;
default: