Skip to content

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

feat(secret-sync): address third round of Daytona review feedback

InfisiCalvinb9fbe7afa8dc
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index f7708f6ace..63e08fb251 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -3287,10 +3287,6 @@ export const SecretSyncs = {
DEVIN: {
orgId: "The Devin organization ID to sync secrets to."
},
- DAYTONA: {
- organizationName:
- "A display name for the Daytona organization secrets are synced to. The connection's API key determines the organization; this label is shown in Infisical only."
- },
GITLAB: {
projectId: "The GitLab Project ID to sync secrets to.",
projectName: "The GitLab Project Name to sync secrets to.",
diff --git a/backend/src/lib/retry/index.ts b/backend/src/lib/retry/index.ts
index 2bd5af3443..de71153995 100644
--- a/backend/src/lib/retry/index.ts
+++ b/backend/src/lib/retry/index.ts
@@ -1,6 +1,4 @@
/* eslint-disable no-await-in-loop */
-import { HttpStatusCode, isAxiosError } from "axios";
-
interface GitHubApiError extends Error {
status?: number;
response?: {
@@ -43,25 +41,3 @@ export const retryWithBackoff = async <T>(fn: () => Promise<T>, maxRetries = 3,
throw lastError!;
};
-
-/**
- * Retries `fn` while the upstream answers 429, backing off exponentially.
- *
- * Deliberately narrower than `retryWithBackoff` above, which retries on any thrown error. Callers
- * that turn 4xx responses into actionable messages (a rejected credential, a name collision) need
- * those to surface on the first attempt rather than after several pointless round trips.
- */
-export const retryOnRateLimit = async <T>(
- fn: () => Promise<T>,
- { maxRetries = 3, baseDelay = 500 }: { maxRetries?: number; baseDelay?: number } = {}
-): Promise<T> => {
- for (let attempt = 0; ; attempt += 1) {
- try {
- return await fn();
- } catch (error) {
- const isRateLimited = isAxiosError(error) && error.response?.status === HttpStatusCode.TooManyRequests;
- if (!isRateLimited || attempt >= maxRetries) throw error;
- await delay(baseDelay * 2 ** attempt);
- }
- }
-};
diff --git a/backend/src/services/app-connection/daytona/daytona-connection-fns.ts b/backend/src/services/app-connection/daytona/daytona-connection-fns.ts
index cd597605e4..de18151f6b 100644
--- a/backend/src/services/app-connection/daytona/daytona-connection-fns.ts
+++ b/backend/src/services/app-connection/daytona/daytona-connection-fns.ts
@@ -1,7 +1,7 @@
import { HttpStatusCode, isAxiosError } from "axios";
-import { request } from "@app/lib/config/request";
import { BadRequestError } from "@app/lib/errors";
+import { safeRequest } from "@app/lib/validator/safe-request";
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
import { IntegrationUrls } from "@app/services/integration-auth/integration-list";
@@ -30,7 +30,7 @@ export const validateDaytonaConnectionCredentials = async (config: TDaytonaConne
// Listing secrets is the capability every Daytona sync needs, so validating against it proves both
// that the key works and that it carries manage:secrets. Reading the key's own details would not.
try {
- await request.get(`${IntegrationUrls.DAYTONA_API_URL}/secret/paginated`, {
+ await safeRequest.get(`${IntegrationUrls.DAYTONA_API_URL}/secret/paginated`, {
params: { limit: 1 },
headers: getDaytonaAuthHeaders(apiKey)
});
diff --git a/backend/src/services/secret-sync/daytona/daytona-sync-fns.ts b/backend/src/services/secret-sync/daytona/daytona-sync-fns.ts
index 2a89575b56..ba81d82133 100644
--- a/backend/src/services/secret-sync/daytona/daytona-sync-fns.ts
+++ b/backend/src/services/secret-sync/daytona/daytona-sync-fns.ts
@@ -1,8 +1,7 @@
/* eslint-disable no-await-in-loop */
import { HttpStatusCode, isAxiosError } from "axios";
-import { request } from "@app/lib/config/request";
-import { retryOnRateLimit } from "@app/lib/retry";
+import { safeRequest } from "@app/lib/validator/safe-request";
import { getDaytonaAuthHeaders } from "@app/services/app-connection/daytona";
import { IntegrationUrls } from "@app/services/integration-auth/integration-list";
import { SecretSyncError } from "@app/services/secret-sync/secret-sync-errors";
@@ -12,7 +11,7 @@ import { TSecretMap } from "@app/services/secret-sync/secret-sync-types";
import { DAYTONA_SECRET_NAME_PATTERN, DAYTONA_SECRET_NAME_RULE } from "./daytona-sync-schemas";
import { TDaytonaListSecretsResponse, TDaytonaSecret, TDaytonaSyncWithCredentials } from "./daytona-sync-types";
-const DAYTONA_PAGE_SIZE = 100;
+const DAYTONA_PAGE_SIZE = 200;
const DAYTONA_MAX_PAGES = 10;
const listDaytonaSecrets = async (apiKey: string): Promise<TDaytonaSecret[]> => {
@@ -22,11 +21,12 @@ const listDaytonaSecrets = async (apiKey: string): Promise<TDaytonaSecret[]> =>
for (let page = 0; page < DAYTONA_MAX_PAGES; page += 1) {
const currentCursor = cursor;
- const { data } = await retryOnRateLimit(() =>
- request.get<TDaytonaListSecretsResponse>(`${IntegrationUrls.DAYTONA_API_URL}/secret/paginated`, {
+ const { data } = await safeRequest.get<TDaytonaListSecretsResponse>(
+ `${IntegrationUrls.DAYTONA_API_URL}/secret/paginated`,
+ {
params: { limit: DAYTONA_PAGE_SIZE, ...(currentCursor ? { cursor: currentCursor } : {}) },
headers: getDaytonaAuthHeaders(apiKey)
- })
+ }
);
secrets.push(...(data.items ?? []));
@@ -43,29 +43,23 @@ const listDaytonaSecrets = async (apiKey: string): Promise<TDaytonaSecret[]> =>
};
const createDaytonaSecret = (apiKey: string, name: string, value: string) =>
- retryOnRateLimit(() =>
- request.post(
- `${IntegrationUrls.DAYTONA_API_URL}/secret`,
- { name, value },
- { headers: getDaytonaAuthHeaders(apiKey) }
- )
+ safeRequest.post(
+ `${IntegrationUrls.DAYTONA_API_URL}/secret`,
+ { name, value },
+ { headers: getDaytonaAuthHeaders(apiKey) }
);
const updateDaytonaSecretValue = (apiKey: string, secretId: string, value: string) =>
- retryOnRateLimit(() =>
- request.patch(
- `${IntegrationUrls.DAYTONA_API_URL}/secret/${encodeURIComponent(secretId)}`,
- { value },
- { headers: getDaytonaAuthHeaders(apiKey) }
- )
+ safeRequest.patch(
+ `${IntegrationUrls.DAYTONA_API_URL}/secret/${encodeURIComponent(secretId)}`,
+ { value },
+ { headers: getDaytonaAuthHeaders(apiKey) }
);
const deleteDaytonaSecret = (apiKey: string, secretId: string) =>
- retryOnRateLimit(() =>
- request.delete(`${IntegrationUrls.DAYTONA_API_URL}/secret/${encodeURIComponent(secretId)}`, {
- headers: getDaytonaAuthHeaders(apiKey)
- })
- );
+ safeRequest.delete(`${IntegrationUrls.DAYTONA_API_URL}/secret/${encodeURIComponent(secretId)}`, {
+ headers: getDaytonaAuthHeaders(apiKey)
+ });
export const DaytonaSyncFns = {
async syncSecrets(secretSync: TDaytonaSyncWithCredentials, secretMap: TSecretMap) {
diff --git a/backend/src/services/secret-sync/daytona/daytona-sync-schemas.ts b/backend/src/services/secret-sync/daytona/daytona-sync-schemas.ts
index 32dfb9d0e3..96c5b56d92 100644
--- a/backend/src/services/secret-sync/daytona/daytona-sync-schemas.ts
+++ b/backend/src/services/secret-sync/daytona/daytona-sync-schemas.ts
@@ -1,6 +1,5 @@
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";
@@ -30,14 +29,9 @@ const DAYTONA_KEY_SCHEMA_ERROR = {
path: ["syncOptions", "keySchema"]
};
-const DaytonaSyncDestinationConfigSchema = z.object({
- organizationName: z
- .string()
- .trim()
- .min(1, "Organization name is required")
- .max(255)
- .describe(SecretSyncs.DESTINATION_CONFIG.DAYTONA.organizationName)
-});
+// A Daytona API key is bound to one organization and nothing scopes below it, so the connection is
+// the whole destination and there is nothing left to configure.
+const DaytonaSyncDestinationConfigSchema = z.object({});
const DaytonaSyncOptionsConfig: TSyncOptionsConfig = { canImportSecrets: false };
diff --git a/backend/src/services/secret-sync/secret-sync-maps.ts b/backend/src/services/secret-sync/secret-sync-maps.ts
index 04b54bbddb..2b7a645e3e 100644
--- a/backend/src/services/secret-sync/secret-sync-maps.ts
+++ b/backend/src/services/secret-sync/secret-sync-maps.ts
@@ -219,8 +219,7 @@ export const SECRET_SYNC_SKIP_FIELDS_MAP: Record<SecretSync, string[]> = {
[SecretSync.Qovery]: ["organizationName", "projectName", "environmentName"],
[SecretSync.Cloud66]: ["stackName"],
[SecretSync.Spacelift]: ["contextName"],
- // Display-only label; excluded from duplicate matching so the connection check below decides.
- [SecretSync.Daytona]: ["organizationName"]
+ [SecretSync.Daytona]: []
};
const defaultDuplicateCheck: DestinationDuplicateCheckFn = async () => true;
@@ -340,8 +339,9 @@ export const DESTINATION_DUPLICATE_CHECK_MAP: Record<SecretSync, DestinationDupl
[SecretSync.Qovery]: defaultDuplicateCheck,
[SecretSync.Cloud66]: defaultDuplicateCheck,
[SecretSync.Spacelift]: defaultDuplicateCheck,
- // A Daytona API key is bound to one organization and nothing scopes below it, so two syncs sharing a
- // connection write the same secrets. The stored organization name is a label and cannot be trusted here.
+ // Daytona has an empty destination config, so checkDuplicateDestination returns early and never
+ // reaches this. Kept accurate rather than defaulted: a Daytona API key is bound to one organization
+ // and nothing scopes below it, so two syncs sharing a connection do write the same secrets.
[SecretSync.Daytona]: async ({ existingSync, newSync }) =>
Boolean(newSync.connectionId) && existingSync.connectionId === newSync.connectionId
};
diff --git a/docs/api-reference/endpoints/app-connections/daytona/available.mdx b/docs/api-reference/endpoints/app-connections/daytona/available.mdx
new file mode 100644
index 0000000000..1ef778b283
--- /dev/null
+++ b/docs/api-reference/endpoints/app-connections/daytona/available.mdx
@@ -0,0 +1,4 @@
+---
+title: "Available"
+openapi: "GET /api/v1/app-connections/daytona/available"
+---
diff --git a/docs/api-reference/endpoints/app-connections/daytona/create.mdx b/docs/api-reference/endpoints/app-connections/daytona/create.mdx
new file mode 100644
index 0000000000..462ddae894
--- /dev/null
+++ b/docs/api-reference/endpoints/app-connections/daytona/create.mdx
@@ -0,0 +1,8 @@
+---
+title: "Create"
+openapi: "POST /api/v1/app-connections/daytona"
+---
+
+<Note>
+ Check out the configuration docs for [Daytona Connections](/integrations/app-connections/daytona) to learn how to obtain the required credentials.
+</Note>
diff --git a/docs/api-reference/endpoints/app-connections/daytona/delete.mdx b/docs/api-reference/endpoints/app-connections/daytona/delete.mdx
new file mode 100644
index 0000000000..191175a87f
--- /dev/null
+++ b/docs/api-reference/endpoints/app-connections/daytona/delete.mdx
@@ -0,0 +1,4 @@
+---
+title: "Delete"
+openapi: "DELETE /api/v1/app-connections/daytona/{connectionId}"
+---
diff --git a/docs/api-reference/endpoints/app-connections/daytona/get-by-id.mdx b/docs/api-reference/endpoints/app-connections/daytona/get-by-id.mdx
new file mode 100644
index 0000000000..bd28b80bed
--- /dev/null
+++ b/docs/api-reference/endpoints/app-connections/daytona/get-by-id.mdx
@@ -0,0 +1,4 @@
+---
+title: "Get by ID"
+openapi: "GET /api/v1/app-connections/daytona/{connectionId}"
+---
diff --git a/docs/api-reference/endpoints/app-connections/daytona/get-by-name.mdx b/docs/api-reference/endpoints/app-connections/daytona/get-by-name.mdx
new file mode 100644
index 0000000000..2bd68eb736
--- /dev/null
+++ b/docs/api-reference/endpoints/app-connections/daytona/get-by-name.mdx
@@ -0,0 +1,4 @@
+---
+title: "Get by name"
+openapi: "GET /api/v1/app-connections/daytona/connection-name/{connectionName}"
+---
diff --git a/docs/api-reference/endpoints/app-connections/daytona/list.mdx b/docs/api-reference/endpoints/app-connections/daytona/list.mdx
new file mode 100644
index 0000000000..6205e8c83c
--- /dev/null
+++ b/docs/api-reference/endpoints/app-connections/daytona/list.mdx
@@ -0,0 +1,4 @@
+---
+title: "List"
+openapi: "GET /api/v1/app-connections/daytona"
+---
diff --git a/docs/api-reference/endpoints/app-connections/daytona/update.mdx b/docs/api-reference/endpoints/app-connections/daytona/update.mdx
new file mode 100644
index 0000000000..053219fc42
--- /dev/null
+++ b/docs/api-reference/endpoints/app-connections/daytona/update.mdx
@@ -0,0 +1,8 @@
+---
+title: "Update"
+openapi: "PATCH /api/v1/app-connections/daytona/{connectionId}"
+---
+
+<Note>
+ Check out the configuration docs for [Daytona Connections](/integrations/app-connections/daytona) to learn how to obtain the required credentials.
+</Note>
diff --git a/docs/api-reference/endpoints/secret-syncs/daytona/create.mdx b/docs/api-reference/endpoints/secret-syncs/daytona/create.mdx
new file mode 100644
index 0000000000..d3e578113e
--- /dev/null
+++ b/docs/api-reference/endpoints/secret-syncs/daytona/create.mdx
@@ -0,0 +1,4 @@
+---
+title: "Create"
+openapi: "POST /api/v1/secret-syncs/daytona"
+---
diff --git a/docs/api-reference/endpoints/secret-syncs/daytona/delete.mdx b/docs/api-reference/endpoints/secret-syncs/daytona/delete.mdx
new file mode 100644
index 0000000000..7a2a50a112
--- /dev/null
+++ b/docs/api-reference/endpoints/secret-syncs/daytona/delete.mdx
@@ -0,0 +1,4 @@
+---
+title: "Delete"
+openapi: "DELETE /api/v1/secret-syncs/daytona/{syncId}"
+---
diff --git a/docs/api-reference/endpoints/secret-syncs/daytona/get-by-id.mdx b/docs/api-reference/endpoints/secret-syncs/daytona/get-by-id.mdx
new file mode 100644
index 0000000000..8b993d2995
--- /dev/null
+++ b/docs/api-reference/endpoints/secret-syncs/daytona/get-by-id.mdx
@@ -0,0 +1,4 @@
+---
+title: "Get by ID"
+openapi: "GET /api/v1/secret-syncs/daytona/{syncId}"
+---
diff --git a/docs/api-reference/endpoints/secret-syncs/daytona/get-by-name.mdx b/docs/api-reference/endpoints/secret-syncs/daytona/get-by-name.mdx
new file mode 100644
index 0000000000..2b0a767389
--- /dev/null
+++ b/docs/api-reference/endpoints/secret-syncs/daytona/get-by-name.mdx
@@ -0,0 +1,4 @@
+---
+title: "Get by name"
+openapi: "GET /api/v1/secret-syncs/daytona/sync-name/{syncName}"
+---
diff --git a/docs/api-reference/endpoints/secret-syncs/daytona/list.mdx b/docs/api-reference/endpoints/secret-syncs/daytona/list.mdx
new file mode 100644
index 0000000000..fe43693f26
--- /dev/null
+++ b/docs/api-reference/endpoints/secret-syncs/daytona/list.mdx
@@ -0,0 +1,4 @@
+---
+title: "List"
+openapi: "GET /api/v1/secret-syncs/daytona"
+---
diff --git a/docs/api-reference/endpoints/secret-syncs/daytona/remove-secrets.mdx b/docs/api-reference/endpoints/secret-syncs/daytona/remove-secrets.mdx
new file mode 100644
index 0000000000..6a30561005
--- /dev/null
+++ b/docs/api-reference/endpoints/secret-syncs/daytona/remove-secrets.mdx
@@ -0,0 +1,4 @@
+---
+title: "Remove secrets"
+openapi: "POST /api/v1/secret-syncs/daytona/{syncId}/remove-secrets"
+---
diff --git a/docs/api-reference/endpoints/secret-syncs/daytona/sync-secrets.mdx b/docs/api-reference/endpoints/secret-syncs/daytona/sync-secrets.mdx
new file mode 100644
index 0000000000..8a342fa4b9
--- /dev/null
+++ b/docs/api-reference/endpoints/secret-syncs/daytona/sync-secrets.mdx
@@ -0,0 +1,4 @@
+---
+title: "Sync secrets"
+openapi: "POST /api/v1/secret-syncs/daytona/{syncId}/sync-secrets"
+---
diff --git a/docs/api-reference/endpoints/secret-syncs/daytona/update.mdx b/docs/api-reference/endpoints/secret-syncs/daytona/update.mdx
new file mode 100644
index 0000000000..f3c726ae9e
--- /dev/null
+++ b/docs/api-reference/endpoints/secret-syncs/daytona/update.mdx
@@ -0,0 +1,4 @@
+---
+title: "Update"
+openapi: "PATCH /api/v1/secret-syncs/daytona/{syncId}"
+---
diff --git a/docs/docs.json b/docs/docs.json
index 043ffbb95a..f94579aec2 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -1841,6 +1841,18 @@
"api-reference/endpoints/app-connections/datadog/create"
]
},
+ {
+ "group": "Daytona",
+ "pages": [
+ "api-reference/endpoints/app-connections/daytona/list",
+ "api-reference/endpoints/app-connections/daytona/available",
+ "api-reference/endpoints/app-connections/daytona/get-by-id",
+ "api-reference/endpoints/app-connections/daytona/get-by-name",
+ "api-reference/endpoints/app-connections/daytona/create",
+ "api-reference/endpoints/app-connections/daytona/update",
+ "api-reference/endpoints/app-connections/daytona/delete"
+ ]
+ },
{
"group": "DBT",
"pages": [
@@ -3348,6 +3360,19 @@
"api-reference/endpoints/secret-syncs/databricks/remove-secrets"
]
},
+ {
+ "group": "Daytona",
+ "pages": [
+ "api-reference/endpoints/secret-syncs/daytona/list",
+ "api-reference/endpoints/secret-syncs/daytona/get-by-id",
+ "api-reference/endpoints/secret-syncs/daytona/get-by-name",
+ "api-reference/endpoints/secret-syncs/daytona/create",
+ "api-reference/endpoints/secret-syncs/daytona/update",
+ "api-reference/endpoints/secret-syncs/daytona/delete",
+ "api-reference/endpoints/secret-syncs/daytona/sync-secrets",
+ "api-reference/endpoints/secret-syncs/daytona/remove-secrets"
+ ]
+ },
{
"group": "Devin",
"pages": [
diff --git a/docs/images/app-connections/daytona/create-api-key.png b/docs/images/app-connections/daytona/create-api-key.png
new file mode 100644
index 0000000000..99505a3597
Binary files /dev/null and b/docs/images/app-connections/daytona/create-api-key.png differ
diff --git a/docs/images/app-connections/daytona/daytona-app-connection-form.png b/docs/images/app-connections/daytona/daytona-app-connection-form.png
new file mode 100644
index 0000000000..1d744a4017
Binary files /dev/null and b/docs/images/app-connections/daytona/daytona-app-connection-form.png differ
diff --git a/docs/images/app-connections/daytona/daytona-app-connection-option.png b/docs/images/app-connections/daytona/daytona-app-connection-option.png
new file mode 100644
index 0000000000..e5220e7ff3
Binary files /dev/null and b/docs/images/app-connections/daytona/daytona-app-connection-option.png differ
diff --git a/docs/images/secret-syncs/daytona/allowed-hosts.png b/docs/images/secret-syncs/daytona/allowed-hosts.png
new file mode 100644
index 0000000000..f5d600a2d5
Binary files /dev/null and b/docs/images/secret-syncs/daytona/allowed-hosts.png differ
diff --git a/docs/images/secret-syncs/daytona/configure-destination.png b/docs/images/secret-syncs/daytona/configure-destination.png
new file mode 100644
index 0000000000..666ed17bff
Binary files /dev/null and b/docs/images/secret-syncs/daytona/configure-destination.png differ
diff --git a/docs/images/secret-syncs/daytona/configure-details.png b/docs/images/secret-syncs/daytona/configure-details.png
new file mode 100644
index 0000000000..ec0e140235
Binary files /dev/null and b/docs/images/secret-syncs/daytona/configure-details.png differ
diff --git a/docs/images/secret-syncs/daytona/configure-sync-options.png b/docs/images/secret-syncs/daytona/configure-sync-options.png
new file mode 100644
index 0000000000..97600f563d
Binary files /dev/null and b/docs/images/secret-syncs/daytona/configure-sync-options.png differ
diff --git a/docs/images/secret-syncs/daytona/initial-sync-behavior.png b/docs/images/secret-syncs/daytona/initial-sync-behavior.png
new file mode 100644
index 0000000000..027ba8bebf
Binary files /dev/null and b/docs/images/secret-syncs/daytona/initial-sync-behavior.png differ
diff --git a/docs/images/secret-syncs/daytona/review-configuration.png b/docs/images/secret-syncs/daytona/review-configuration.png
new file mode 100644
index 0000000000..5410bb23b4
Binary files /dev/null and b/docs/images/secret-syncs/daytona/review-configuration.png differ
diff --git a/docs/images/secret-syncs/daytona/select-option.png b/docs/images/secret-syncs/daytona/select-option.png
new file mode 100644
index 0000000000..99f751b448
Binary files /dev/null and b/docs/images/secret-syncs/daytona/select-option.png differ
diff --git a/docs/integrations/app-connections/daytona.mdx b/docs/integrations/app-connections/daytona.mdx
index a4fd52b7e5..e717d4cae4 100644
--- a/docs/integrations/app-connections/daytona.mdx
+++ b/docs/integrations/app-connections/daytona.mdx
@@ -1,9 +1,10 @@
---
title: "Daytona connection"
+sidebarTitle: "Daytona"
description: "Learn how to configure a Daytona connection for Infisical."
---
-[Daytona](https://www.daytona.io/) runs sandboxes that read organization-scoped secrets at runtime. Infisical connects to Daytona with an **API key**, which is used to push secrets into a Daytona organization through the [Daytona secret sync](/integrations/secret-syncs/daytona).
+[Daytona](https://www.daytona.io/) runs sandboxes that read organization-scoped secrets at runtime. Infisical connects to Daytona with an API key, which is used to push secrets into a Daytona organization through the [Daytona secret sync](/integrations/secret-syncs/daytona).
A Daytona API key belongs to exactly one organization. The key you choose therefore decides which organization your secrets are written to.
@@ -15,13 +16,17 @@ A Daytona API key belongs to exactly one organization. The key you choose theref
<Steps>
<Step title="Open API key settings">
- In the Daytona dashboard, go to **Settings** → **API Keys** and select **Create Key**.
+ In the Daytona dashboard, select **API Keys** in the sidebar, then select **Create Key**.
</Step>
- <Step title="Grant the manage:secrets permission">
- Give the key a name, then grant it the `manage:secrets` permission. Infisical needs this permission to create, update, and delete secrets. A key without it is rejected when you create the connection.
+ <Step title="Grant the key permission to manage secrets">
+ Give the key a name. Under **Permissions**, select **Restricted**, then set **Secrets** to **Manage**. **Full Access** also works.
+
+ Infisical needs this permission to create, update, and delete secrets. A key without it is rejected when you create the connection.
+
+ ![Create API Key](/images/app-connections/daytona/create-api-key.png)
</Step>
<Step title="Copy the key">
- Daytona shows the key once, immediately after creation. Copy it and store it securely. You need it in the next section.
+ Select **Create**. Daytona shows the key once, immediately after creation. Copy it and store it securely. You need it in the next section.
</Step>
</Steps>
@@ -37,20 +42,24 @@ A Daytona API key belongs to exactly one organization. The key you choose theref
</Step>
<Step title="Select Daytona Connection">
Select **Add Connection** and choose **Daytona** from the list of available connections.
+
+ ![Select Daytona Connection](/images/app-connections/daytona/daytona-app-connection-option.png)
</Step>
<Step title="Fill out the connection form">
Complete the form with:
- A **name** for the connection (for example `daytona-prod`)
- An optional **description**
- Your **Daytona API key**
+
+ ![Daytona Connection Form](/images/app-connections/daytona/daytona-app-connection-form.png)
</Step>
<Step title="Connection created">
- Infisical validates the key against Daytona and confirms it carries `manage:secrets`. Once it passes, the connection is ready to use in your project.
+ Infisical validates the key against Daytona. Once it passes, the connection is ready to use in your project.
</Step>
</Steps>
</Tab>
<Tab title="API">
- Create a Daytona connection through the API.
+ To create a Daytona connection, make an API request to the [Create Daytona Connection](/api-reference/endpoints/app-connections/daytona/create) API endpoint.
### Sample request
diff --git a/docs/integrations/secret-syncs/daytona.mdx b/docs/integrations/secret-syncs/daytona.mdx
index 79e5c91491..e265037165 100644
--- a/docs/integrations/secret-syncs/daytona.mdx
+++ b/docs/integrations/secret-syncs/daytona.mdx
@@ -13,11 +13,15 @@ description: "Learn how to configure a Daytona sync for Infisical."
The key schema itself is checked against the same rule when you create or update the sync, so a schema containing a slash is rejected up front rather than failing on every run.
</Note>
-<Note>
- Infisical does not set the **allowed hosts** list on the secrets it creates, so they are unrestricted in the same way as a secret created in Daytona without one. Daytona substitutes the real value for its placeholder on requests to any host.
+## Allowed hosts stay under your control in Daytona
- To restrict a secret, set its allowed hosts in Daytona. This sync only ever writes the value, so a list you set there is preserved on later syncs.
-</Note>
+Daytona never places a secret's value in a sandbox. It sets the environment variable to an opaque placeholder and substitutes the real value in its egress proxy, but only for requests to hosts on that secret's allowed hosts list. A secret with no allowed hosts is unrestricted: Daytona substitutes the value for a request to any host.
+
+Infisical never sets or changes allowed hosts. Creating a secret sends its name and value, and updating one sends only the value, so the allowed hosts you set in Daytona are preserved by every later sync. Nothing you configure here can widen or narrow them.
+
+Set allowed hosts on a secret in Daytona after the first sync creates it. The list is per secret, so each one can be restricted to the destinations it is actually used with, and it survives from then on.
+
+![Allowed hosts on a Daytona secret](/images/secret-syncs/daytona/allowed-hosts.png)
<Tabs>
<Tab title="Infisical UI">
@@ -29,9 +33,11 @@ description: "Learn how to configure a Daytona sync for Infisical."
</Step>
<Step title="Select 'Daytona'">
Select the **Daytona** option from the list of available secret syncs.
+
+ ![Select Daytona](/images/secret-syncs/daytona/select-option.png)
</Step>
<Step title="Configure source">
- Configure the **Source** from where secrets should be retrieved, then select **Next**.
+ Configure the **Source** from where secrets should be retrieved, then select **Continue**.
- **Environment**: The project environment to retrieve secrets from.
- **Secret Path**: The folder path to retrieve secrets from.
@@ -41,38 +47,42 @@ description: "Learn how to configure a Daytona sync for Infisical."
</Tip>
</Step>
<Step title="Configure destination">
- Configure the **Destination** to where secrets should be deployed, then select **Next**.
+ Select the **Daytona Connection** to authenticate with, then select **Continue**. The connection's API key determines which Daytona organization receives the secrets, so there is nothing further to configure.
- - **Daytona Connection**: The Daytona connection to authenticate with. Its API key determines which Daytona organization receives the secrets.
- - **Organization Name**: A label for that organization. It is shown in Infisical only and does not affect where secrets are written.
+ ![Configure Destination](/images/secret-syncs/daytona/configure-destination.png)
+ </Step>
+ <Step title="Choose initial sync behavior">
+ Choose how Infisical reconciles the secrets already in Daytona on the first run, then select **Continue**.
+
+ Daytona never returns a secret's value through its API, so this sync cannot import existing secrets into Infisical. **Overwrite Daytona** is the only behavior available.
+
+ ![Initial Sync Behavior](/images/secret-syncs/daytona/initial-sync-behavior.png)
</Step>
<Step title="Configure sync options">
- Configure the **Sync Options** to specify how secrets should be synced, then select **Next**.
+ Configure the **Sync Options** to specify how secrets should be synced, then select **Continue**.
- - **Initial Sync Behavior**: Determines how Infisical should resolve the initial sync.
- - **Overwrite Destination Secrets**: Removes any secrets in the Daytona organization not present in Infisical.
+ - **Disable secret deletion**: When enabled, Infisical does not remove secrets from the Daytona organization. Enable this if you intend to manage some secrets manually outside of Infisical.
+ - **Auto-sync on changes**: When enabled, secrets sync to Daytona automatically as the source changes. Turn it off to sync manually only.
+ - **Customize key names**: Adds a prefix or suffix to every synced name, using `{{secretKey}}` as a placeholder for the original name and `{{environment}}` for the environment.
- <Note>
- Daytona never returns a secret's value through its API, so this sync cannot import existing secrets from Daytona into Infisical. Only **Overwrite Destination Secrets** is available as an initial sync behavior.
- </Note>
- - **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.
+ We highly recommend customizing key names so Infisical only manages the specific keys you intend, keeping everything else untouched.
</Note>
- - **Auto-Sync Enabled**: If enabled, secrets are automatically synced from the source location when changes occur. Disable to enforce manual syncing only.
- - **Disable Secret Deletion**: If enabled, Infisical does not remove secrets from the Daytona organization. Enable this option if you intend to manage some secrets manually outside of Infisical.
+
+ ![Configure Sync Options](/images/secret-syncs/daytona/configure-sync-options.png)
</Step>
<Step title="Configure details">
- Configure the **Details** of your Daytona sync, then select **Next**.
+ Give the sync a **Name** and an optional **Description**, then select **Continue**. The name must be slug-friendly.
- - **Name**: The name of your sync. Must be slug-friendly.
- - **Description**: An optional description for your sync.
+ ![Sync Details](/images/secret-syncs/daytona/configure-details.png)
</Step>
- <Step title="Review configuration">
+ <Step title="Review and create">
Review your Daytona sync configuration, then select **Create Sync**.
+
+ ![Review and Create](/images/secret-syncs/daytona/review-configuration.png)
</Step>
<Step title="Sync created">
- If enabled, your Daytona sync begins syncing your secrets to the destination organization.
+ If auto-sync is enabled, your Daytona sync begins syncing your secrets to the destination organization.
</Step>
</Steps>
</Tab>
@@ -97,9 +107,7 @@ description: "Learn how to configure a Daytona sync for Infisical."
"initialSyncBehavior": "overwrite-destination",
"disableSecretDeletion": false
},
- "destinationConfig": {
- "organizationName": "My Daytona Organization"
- }
+ "destinationConfig": {}
}'
```
@@ -149,9 +157,7 @@ description: "Learn how to configure a Daytona sync for Infisical."
"path": "/my-secrets"
},
"destination": "daytona",
- "destinationConfig": {
- "organizationName": "My Daytona Organization"
- }
+ "destinationConfig": {}
}
}
```
diff --git a/docs/snippets/AppConnectionsBrowser.jsx b/docs/snippets/AppConnectionsBrowser.jsx
index afaf18ede2..7d41a18ca5 100644
--- a/docs/snippets/AppConnectionsBrowser.jsx
+++ b/docs/snippets/AppConnectionsBrowser.jsx
@@ -511,6 +511,14 @@ export const AppConnectionsBrowser = () => {
"Learn how to connect Convex to manage and rotate access keys with Infisical.",
category: "SaaS",
},
+ {
+ name: "Daytona",
+ slug: "daytona",
+ path: "/integrations/app-connections/daytona",
+ description:
+ "Learn how to connect Daytona to push secrets from Infisical into a Daytona organization.",
+ category: "SaaS",
+ },
{
name: "Trigger.dev",
slug: "trigger-dev",
diff --git a/docs/snippets/SecretSyncsBrowser.jsx b/docs/snippets/SecretSyncsBrowser.jsx
index 034f603c7c..b14951d17f 100644
--- a/docs/snippets/SecretSyncsBrowser.jsx
+++ b/docs/snippets/SecretSyncsBrowser.jsx
@@ -4,7 +4,7 @@ export const SecretSyncsBrowser = () => {
const [searchTerm, setSearchTerm] = useState('');
const [selectedCategory, setSelectedCategory] = useState('All');
- const categories = ['All', 'Cloud Providers', 'Databases', 'CI/CD', 'Monitoring', 'Identity & Auth', 'Data Analytics', 'Hosting', 'DevOps Tools', 'Security'];
+ const categories = ['All', 'Cloud Providers', 'Databases', 'CI/CD', 'Monitoring', 'Identity & Auth', 'Data Analytics', 'Hosting', 'DevOps Tools', 'Security', 'SaaS'];
const syncs = [
{"name": "AWS Parameter Store", "slug": "aws-parameter-store", "path": "/integrations/secret-syncs/aws-parameter-store", "description": "Learn how to sync secrets from Infisical to AWS Parameter Store.", "category": "Cloud Providers"},
@@ -54,6 +54,7 @@ export const SecretSyncsBrowser = () => {
{"name": "Qovery", "slug": "qovery", "path": "/integrations/secret-syncs/qovery", "description": "Learn how to sync secrets from Infisical to Qovery.", "category": "DevOps Tools"},
{"name": "Cloud 66", "slug": "cloud-66", "path": "/integrations/secret-syncs/cloud-66", "description": "Learn how to sync secrets from Infisical to Cloud66.", "category": "DevOps Tools"},
{"name": "Hasura Cloud", "slug": "hasura-cloud", "path": "/integrations/secret-syncs/hasura-cloud", "description": "Learn how to sync secrets from Infisical to Hasura Cloud.", "category": "Platform"},
+ {"name": "Daytona", "slug": "daytona", "path": "/integrations/secret-syncs/daytona", "description": "Learn how to sync secrets from Infisical to a Daytona organization.", "category": "SaaS"},
].sort(function(a, b) {
return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
});
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/DaytonaSyncFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/DaytonaSyncFields.tsx
index ce6f63ee8d..b28de3021b 100644
--- a/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/DaytonaSyncFields.tsx
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/DaytonaSyncFields.tsx
@@ -1,53 +1,10 @@
-import { Controller, useFormContext } from "react-hook-form";
-import { Info } from "lucide-react";
-
import { SecretSyncConnectionField } from "@app/components/secret-syncs/forms/SecretSyncConnectionField";
-import {
- Field,
- FieldContent,
- FieldError,
- FieldGroup,
- FieldLabel,
- Input,
- Tooltip,
- TooltipContent,
- TooltipTrigger
-} from "@app/components/v3";
-import { SecretSync } from "@app/hooks/api/secretSyncs";
-
-import { TSecretSyncForm } from "../schemas";
+import { FieldGroup } from "@app/components/v3";
export const DaytonaSyncFields = () => {
- const { control } = useFormContext<TSecretSyncForm & { destination: SecretSync.Daytona }>();
-
return (
<FieldGroup>
<SecretSyncConnectionField />
- <Controller
- name="destinationConfig.organizationName"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <Field>
- <FieldLabel>
- Organization Name
- <Tooltip>
- <TooltipTrigger asChild>
- <Info />
- </TooltipTrigger>
- <TooltipContent className="max-w-sm">
- A label for the Daytona organization these secrets are synced to. The API key on
- the connection above decides where secrets actually land, so this name is shown in
- Infisical only.
- </TooltipContent>
- </Tooltip>
- </FieldLabel>
- <FieldContent>
- <Input {...field} placeholder="My Daytona Organization" isError={Boolean(error)} />
- <FieldError errors={[error]} />
- </FieldContent>
- </Field>
- )}
- />
</FieldGroup>
);
};
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/DaytonaSyncReviewFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/DaytonaSyncReviewFields.tsx
deleted file mode 100644
index f9bdcc0175..0000000000
--- a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/DaytonaSyncReviewFields.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-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 DaytonaSyncReviewFields = () => {
- const { watch } = useFormContext<TSecretSyncForm & { destination: SecretSync.Daytona }>();
- const organizationName = watch("destinationConfig.organizationName");
-
- return (
- <Detail>
- <DetailLabel>Organization</DetailLabel>
- <DetailValue>{organizationName}</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 50fcaf58e7..df939a07f5 100644
--- a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/SecretSyncReviewFields.tsx
@@ -42,7 +42,6 @@ import {
CloudflareWorkersSyncReviewFields
} from "./CloudflareWorkersReviewFields";
import { DatabricksSyncReviewFields } from "./DatabricksSyncReviewFields";
-import { DaytonaSyncReviewFields } from "./DaytonaSyncReviewFields";
import { DevinSyncReviewFields } from "./DevinSyncReviewFields";
import { DigitalOceanAppPlatformSyncReviewFields } from "./DigitalOceanAppPlatformSyncReviewFields";
import { ExternalInfisicalSyncReviewFields } from "./ExternalInfisicalSyncReviewFields";
@@ -261,7 +260,7 @@ export const SecretSyncReviewFields = () => {
DestinationFieldsComponent = <Cloud66SyncReviewFields />;
break;
case SecretSync.Daytona:
- DestinationFieldsComponent = <DaytonaSyncReviewFields />;
+ // The connection is the whole destination; it is already shown above.
break;
case SecretSync.Spacelift:
DestinationFieldsComponent = <SpaceliftSyncReviewFields />;
diff --git a/frontend/src/components/secret-syncs/forms/schemas/daytona-sync-destination-schema.ts b/frontend/src/components/secret-syncs/forms/schemas/daytona-sync-destination-schema.ts
index d100bd7cfa..e181108793 100644
--- a/frontend/src/components/secret-syncs/forms/schemas/daytona-sync-destination-schema.ts
+++ b/frontend/src/components/secret-syncs/forms/schemas/daytona-sync-destination-schema.ts
@@ -6,12 +6,8 @@ import { SecretSync } from "@app/hooks/api/secretSyncs";
export const DaytonaSyncDestinationSchema = BaseSecretSyncSchema().merge(
z.object({
destination: z.literal(SecretSync.Daytona),
- destinationConfig: z.object({
- organizationName: z
- .string()
- .trim()
- .min(1, "Daytona organization name required")
- .max(255, "Daytona organization name cannot exceed 255 characters")
- })
+ // Daytona has no destination fields, so nothing seeds this object. Without a default it stays
+ // undefined and the destination step fails validation with no field to surface the error on.
+ destinationConfig: z.object({}).default({})
})
);
diff --git a/frontend/src/hooks/api/secretSyncs/types/daytona-sync.ts b/frontend/src/hooks/api/secretSyncs/types/daytona-sync.ts
index c28c4d370c..23f13419fe 100644
--- a/frontend/src/hooks/api/secretSyncs/types/daytona-sync.ts
+++ b/frontend/src/hooks/api/secretSyncs/types/daytona-sync.ts
@@ -4,7 +4,7 @@ import { TRootSecretSync } from "@app/hooks/api/secretSyncs/types/root-sync";
export type TDaytonaSync = TRootSecretSync & {
destination: SecretSync.Daytona;
- destinationConfig: { organizationName: string };
+ destinationConfig: Record<string, never>;
connection: {
app: AppConnection.Daytona;
name: string;
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 017209e0e8..cf5cbb9cd2 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
@@ -290,7 +290,7 @@ export const getSecretSyncDestinationColValues = (secretSync: TSecretSync) => {
secondaryText = "Stack";
break;
case SecretSync.Daytona:
- primaryText = destinationConfig.organizationName;
+ primaryText = secretSync.connection.name;
secondaryText = "Daytona Organization";
break;
case SecretSync.Spacelift:
diff --git a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/DaytonaSyncDestinationSection.tsx b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/DaytonaSyncDestinationSection.tsx
deleted file mode 100644
index f1906f236e..0000000000
--- a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/DaytonaSyncDestinationSection.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Detail, DetailLabel, DetailValue } from "@app/components/v3";
-import { TDaytonaSync } from "@app/hooks/api/secretSyncs/types/daytona-sync";
-
-type Props = {
- secretSync: TDaytonaSync;
-};
-
-export const DaytonaSyncDestinationSection = ({ secretSync }: Props) => {
- const { destinationConfig } = secretSync;
-
- return (
- <Detail>
- <DetailLabel>Organization</DetailLabel>
- <DetailValue>{destinationConfig.organizationName}</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 85bd201cfe..e58f3a7290 100644
--- a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/SecretSyncDestinatonSection.tsx
+++ b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/SecretSyncDestinatonSection.tsx
@@ -20,7 +20,6 @@ import { Cloud66SyncDestinationSection } from "./Cloud66SyncDestinationSection";
import { CloudflarePagesSyncDestinationSection } from "./CloudflarePagesSyncDestinationSection";
import { CloudflareWorkersSyncDestinationSection } from "./CloudflareWorkersSyncDestinationSection";
import { DatabricksSyncDestinationSection } from "./DatabricksSyncDestinationSection";
-import { DaytonaSyncDestinationSection } from "./DaytonaSyncDestinationSection";
import { DevinSyncDestinationSection } from "./DevinSyncDestinationSection";
import { DigitalOceanAppPlatformSyncDestinationSection } from "./DigitalOceanAppPlatformSyncDestinationSection";
import { ExternalInfisicalSyncDestinationSection } from "./ExternalInfisicalSyncDestinationSection";
@@ -208,7 +207,7 @@ export const SecretSyncDestinationSection = ({ secretSync }: Props) => {
DestinationComponents = <QoverySyncDestinationSection secretSync={secretSync} />;
break;
case SecretSync.Daytona:
- DestinationComponents = <DaytonaSyncDestinationSection secretSync={secretSync} />;
+ // The connection is the whole destination; it is already shown above.
break;
case SecretSync.Cloud66:
DestinationComponents = <Cloud66SyncDestinationSection secretSync={secretSync} />;