From 9c73f1262736e39aa68b07b8ef79dd6e49057289 Mon Sep 17 00:00:00 2001 From: bkellam Date: Sat, 1 Nov 2025 16:45:09 -0700 Subject: [PATCH] wip --- docs/snippets/schemas/v3/app.schema.mdx | 30 +- .../schemas/v3/azuredevops.schema.mdx | 15 +- docs/snippets/schemas/v3/bitbucket.schema.mdx | 15 +- .../snippets/schemas/v3/connection.schema.mdx | 75 +- docs/snippets/schemas/v3/gitea.schema.mdx | 15 +- docs/snippets/schemas/v3/github.schema.mdx | 15 +- docs/snippets/schemas/v3/gitlab.schema.mdx | 15 +- docs/snippets/schemas/v3/index.schema.mdx | 915 ++++++++++++++++-- .../schemas/v3/languageModel.schema.mdx | 810 ++++++++++++++-- docs/snippets/schemas/v3/shared.schema.mdx | 45 +- packages/crypto/package.json | 1 + packages/crypto/src/tokenUtils.ts | 18 + packages/schemas/src/v3/app.schema.ts | 30 +- packages/schemas/src/v3/app.type.ts | 19 +- packages/schemas/src/v3/azuredevops.schema.ts | 15 +- packages/schemas/src/v3/azuredevops.type.ts | 19 +- packages/schemas/src/v3/bitbucket.schema.ts | 15 +- packages/schemas/src/v3/bitbucket.type.ts | 19 +- packages/schemas/src/v3/connection.schema.ts | 75 +- packages/schemas/src/v3/connection.type.ts | 95 +- packages/schemas/src/v3/gitea.schema.ts | 15 +- packages/schemas/src/v3/gitea.type.ts | 19 +- packages/schemas/src/v3/github.schema.ts | 15 +- packages/schemas/src/v3/github.type.ts | 19 +- packages/schemas/src/v3/gitlab.schema.ts | 15 +- packages/schemas/src/v3/gitlab.type.ts | 19 +- packages/schemas/src/v3/index.schema.ts | 915 ++++++++++++++++-- packages/schemas/src/v3/index.type.ts | 420 +++++--- .../schemas/src/v3/languageModel.schema.ts | 810 ++++++++++++++-- packages/schemas/src/v3/languageModel.type.ts | 306 ++++-- packages/schemas/src/v3/shared.schema.ts | 45 +- packages/schemas/src/v3/shared.type.ts | 19 +- packages/web/src/actions.ts | 4 +- schemas/v3/shared.json | 15 +- 34 files changed, 4329 insertions(+), 563 deletions(-) diff --git a/docs/snippets/schemas/v3/app.schema.mdx b/docs/snippets/schemas/v3/app.schema.mdx index 1e95a482..bf505d46 100644 --- a/docs/snippets/schemas/v3/app.schema.mdx +++ b/docs/snippets/schemas/v3/app.schema.mdx @@ -33,13 +33,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -82,13 +95,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } diff --git a/docs/snippets/schemas/v3/azuredevops.schema.mdx b/docs/snippets/schemas/v3/azuredevops.schema.mdx index e187f276..c3f98df3 100644 --- a/docs/snippets/schemas/v3/azuredevops.schema.mdx +++ b/docs/snippets/schemas/v3/azuredevops.schema.mdx @@ -17,13 +17,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, diff --git a/docs/snippets/schemas/v3/bitbucket.schema.mdx b/docs/snippets/schemas/v3/bitbucket.schema.mdx index 85202242..2a58071c 100644 --- a/docs/snippets/schemas/v3/bitbucket.schema.mdx +++ b/docs/snippets/schemas/v3/bitbucket.schema.mdx @@ -21,13 +21,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, diff --git a/docs/snippets/schemas/v3/connection.schema.mdx b/docs/snippets/schemas/v3/connection.schema.mdx index 10311eba..ea834571 100644 --- a/docs/snippets/schemas/v3/connection.schema.mdx +++ b/docs/snippets/schemas/v3/connection.schema.mdx @@ -21,13 +21,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -216,13 +229,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -405,13 +431,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -659,13 +698,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -814,13 +866,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, diff --git a/docs/snippets/schemas/v3/gitea.schema.mdx b/docs/snippets/schemas/v3/gitea.schema.mdx index f663ba47..fc3f515b 100644 --- a/docs/snippets/schemas/v3/gitea.schema.mdx +++ b/docs/snippets/schemas/v3/gitea.schema.mdx @@ -17,13 +17,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, diff --git a/docs/snippets/schemas/v3/github.schema.mdx b/docs/snippets/schemas/v3/github.schema.mdx index 49ea2ce6..9ba412d6 100644 --- a/docs/snippets/schemas/v3/github.schema.mdx +++ b/docs/snippets/schemas/v3/github.schema.mdx @@ -17,13 +17,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, diff --git a/docs/snippets/schemas/v3/gitlab.schema.mdx b/docs/snippets/schemas/v3/gitlab.schema.mdx index 4783aee6..0ecb4c50 100644 --- a/docs/snippets/schemas/v3/gitlab.schema.mdx +++ b/docs/snippets/schemas/v3/gitlab.schema.mdx @@ -17,13 +17,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, diff --git a/docs/snippets/schemas/v3/index.schema.mdx b/docs/snippets/schemas/v3/index.schema.mdx index 38351682..6f74483f 100644 --- a/docs/snippets/schemas/v3/index.schema.mdx +++ b/docs/snippets/schemas/v3/index.schema.mdx @@ -304,13 +304,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -499,13 +512,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -688,13 +714,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -942,13 +981,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1097,13 +1149,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1368,13 +1433,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1386,13 +1464,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1404,13 +1495,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1445,13 +1549,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1489,13 +1606,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `ANTHROPIC_API_KEY` environment variable." @@ -1522,13 +1652,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1570,13 +1713,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `AZURE_API_KEY` environment variable." @@ -1607,13 +1763,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1651,13 +1820,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `DEEPSEEK_API_KEY` environment variable." @@ -1684,13 +1866,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1728,13 +1923,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable." @@ -1761,13 +1969,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1821,13 +2042,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -1854,13 +2088,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1916,13 +2163,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -1949,13 +2209,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1993,13 +2266,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `MISTRAL_API_KEY` environment variable." @@ -2026,13 +2312,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2076,13 +2375,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENAI_API_KEY` environment variable." @@ -2119,13 +2431,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2163,13 +2488,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer ." @@ -2199,13 +2537,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2230,13 +2581,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2285,13 +2649,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENROUTER_API_KEY` environment variable." @@ -2318,13 +2695,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2366,13 +2756,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `XAI_API_KEY` environment variable." @@ -2399,13 +2802,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2446,13 +2862,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -2464,13 +2893,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -2482,13 +2924,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -2523,13 +2978,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2567,13 +3035,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `ANTHROPIC_API_KEY` environment variable." @@ -2600,13 +3081,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2648,13 +3142,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `AZURE_API_KEY` environment variable." @@ -2685,13 +3192,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2729,13 +3249,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `DEEPSEEK_API_KEY` environment variable." @@ -2762,13 +3295,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2806,13 +3352,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable." @@ -2839,13 +3398,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2899,13 +3471,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -2932,13 +3517,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2994,13 +3592,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -3027,13 +3638,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3071,13 +3695,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `MISTRAL_API_KEY` environment variable." @@ -3104,13 +3741,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3154,13 +3804,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENAI_API_KEY` environment variable." @@ -3197,13 +3860,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3241,13 +3917,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer ." @@ -3277,13 +3966,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3308,13 +4010,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3363,13 +4078,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENROUTER_API_KEY` environment variable." @@ -3396,13 +4124,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3444,13 +4185,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `XAI_API_KEY` environment variable." @@ -3477,13 +4231,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3537,13 +4304,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "The private key of the GitHub App." @@ -3586,13 +4366,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "The private key of the GitHub App." diff --git a/docs/snippets/schemas/v3/languageModel.schema.mdx b/docs/snippets/schemas/v3/languageModel.schema.mdx index ebc1bc92..c505d895 100644 --- a/docs/snippets/schemas/v3/languageModel.schema.mdx +++ b/docs/snippets/schemas/v3/languageModel.schema.mdx @@ -27,13 +27,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -45,13 +58,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -63,13 +89,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -104,13 +143,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -148,13 +200,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `ANTHROPIC_API_KEY` environment variable." @@ -181,13 +246,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -229,13 +307,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `AZURE_API_KEY` environment variable." @@ -266,13 +357,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -310,13 +414,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `DEEPSEEK_API_KEY` environment variable." @@ -343,13 +460,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -387,13 +517,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable." @@ -420,13 +563,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -480,13 +636,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -513,13 +682,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -575,13 +757,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -608,13 +803,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -652,13 +860,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `MISTRAL_API_KEY` environment variable." @@ -685,13 +906,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -735,13 +969,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENAI_API_KEY` environment variable." @@ -778,13 +1025,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -822,13 +1082,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer ." @@ -858,13 +1131,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -889,13 +1175,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -944,13 +1243,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENROUTER_API_KEY` environment variable." @@ -977,13 +1289,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1025,13 +1350,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `XAI_API_KEY` environment variable." @@ -1058,13 +1396,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1105,13 +1456,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1123,13 +1487,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1141,13 +1518,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1182,13 +1572,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1226,13 +1629,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `ANTHROPIC_API_KEY` environment variable." @@ -1259,13 +1675,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1307,13 +1736,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `AZURE_API_KEY` environment variable." @@ -1344,13 +1786,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1388,13 +1843,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `DEEPSEEK_API_KEY` environment variable." @@ -1421,13 +1889,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1465,13 +1946,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable." @@ -1498,13 +1992,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1558,13 +2065,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -1591,13 +2111,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1653,13 +2186,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -1686,13 +2232,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1730,13 +2289,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `MISTRAL_API_KEY` environment variable." @@ -1763,13 +2335,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1813,13 +2398,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENAI_API_KEY` environment variable." @@ -1856,13 +2454,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1900,13 +2511,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer ." @@ -1936,13 +2560,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1967,13 +2604,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2022,13 +2672,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENROUTER_API_KEY` environment variable." @@ -2055,13 +2718,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2103,13 +2779,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `XAI_API_KEY` environment variable." @@ -2136,13 +2825,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } diff --git a/docs/snippets/schemas/v3/shared.schema.mdx b/docs/snippets/schemas/v3/shared.schema.mdx index 4087a944..beb21fc3 100644 --- a/docs/snippets/schemas/v3/shared.schema.mdx +++ b/docs/snippets/schemas/v3/shared.schema.mdx @@ -11,13 +11,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -78,13 +91,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -109,13 +135,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } diff --git a/packages/crypto/package.json b/packages/crypto/package.json index abccd406..d25e412f 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -8,6 +8,7 @@ "postinstall": "yarn build" }, "dependencies": { + "@google-cloud/secret-manager": "^6.1.1", "@sourcebot/db": "*", "@sourcebot/schemas": "*", "dotenv": "^16.4.5" diff --git a/packages/crypto/src/tokenUtils.ts b/packages/crypto/src/tokenUtils.ts index b474c0e0..4ac62c5d 100644 --- a/packages/crypto/src/tokenUtils.ts +++ b/packages/crypto/src/tokenUtils.ts @@ -1,4 +1,5 @@ import { Token } from "@sourcebot/schemas/v3/shared.type"; +import { SecretManagerServiceClient } from "@google-cloud/secret-manager"; export const getTokenFromConfig = async (token: Token) => { if ('env' in token) { @@ -8,6 +9,23 @@ export const getTokenFromConfig = async (token: Token) => { } return envToken; + } else if ('gcpSecretName' in token) { + try { + + const client = new SecretManagerServiceClient(); + const [ response ] = await client.accessSecretVersion({ + name: token.gcpSecretName, + }); + + if (!response.payload?.data) { + throw new Error(`Secret ${token.gcpSecretName} not found.`); + } + + return response.payload.data.toString(); + } catch (error) { + console.log("HERE IN THE EXCEPTION HANDLER"); + throw error; + } } else { throw new Error('Invalid token configuration'); } diff --git a/packages/schemas/src/v3/app.schema.ts b/packages/schemas/src/v3/app.schema.ts index a6d1280c..291e3544 100644 --- a/packages/schemas/src/v3/app.schema.ts +++ b/packages/schemas/src/v3/app.schema.ts @@ -32,13 +32,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -81,13 +94,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } diff --git a/packages/schemas/src/v3/app.type.ts b/packages/schemas/src/v3/app.type.ts index d0a4e34e..318883e8 100644 --- a/packages/schemas/src/v3/app.type.ts +++ b/packages/schemas/src/v3/app.type.ts @@ -18,10 +18,17 @@ export interface GitHubAppConfig { /** * The private key of the GitHub App. */ - privateKey: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + privateKey: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; } diff --git a/packages/schemas/src/v3/azuredevops.schema.ts b/packages/schemas/src/v3/azuredevops.schema.ts index f0d56085..8fe5d166 100644 --- a/packages/schemas/src/v3/azuredevops.schema.ts +++ b/packages/schemas/src/v3/azuredevops.schema.ts @@ -16,13 +16,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, diff --git a/packages/schemas/src/v3/azuredevops.type.ts b/packages/schemas/src/v3/azuredevops.type.ts index 9c6c96f1..e6dc053d 100644 --- a/packages/schemas/src/v3/azuredevops.type.ts +++ b/packages/schemas/src/v3/azuredevops.type.ts @@ -8,12 +8,19 @@ export interface AzureDevOpsConnectionConfig { /** * A Personal Access Token (PAT). */ - token: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The URL of the Azure DevOps host. For Azure DevOps Cloud, use https://dev.azure.com. For Azure DevOps Server, use your server URL. */ diff --git a/packages/schemas/src/v3/bitbucket.schema.ts b/packages/schemas/src/v3/bitbucket.schema.ts index a5de1b91..37447886 100644 --- a/packages/schemas/src/v3/bitbucket.schema.ts +++ b/packages/schemas/src/v3/bitbucket.schema.ts @@ -20,13 +20,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, diff --git a/packages/schemas/src/v3/bitbucket.type.ts b/packages/schemas/src/v3/bitbucket.type.ts index cbd8d9d8..afbd626e 100644 --- a/packages/schemas/src/v3/bitbucket.type.ts +++ b/packages/schemas/src/v3/bitbucket.type.ts @@ -12,12 +12,19 @@ export interface BitbucketConnectionConfig { /** * An authentication token. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Bitbucket URL */ diff --git a/packages/schemas/src/v3/connection.schema.ts b/packages/schemas/src/v3/connection.schema.ts index 64872ab1..7cd17154 100644 --- a/packages/schemas/src/v3/connection.schema.ts +++ b/packages/schemas/src/v3/connection.schema.ts @@ -20,13 +20,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -215,13 +228,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -404,13 +430,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -658,13 +697,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -813,13 +865,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, diff --git a/packages/schemas/src/v3/connection.type.ts b/packages/schemas/src/v3/connection.type.ts index 0f62c980..6f0d6b47 100644 --- a/packages/schemas/src/v3/connection.type.ts +++ b/packages/schemas/src/v3/connection.type.ts @@ -17,12 +17,19 @@ export interface GithubConnectionConfig { /** * A Personal Access Token (PAT). */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The URL of the GitHub host. Defaults to https://github.com */ @@ -99,12 +106,19 @@ export interface GitlabConnectionConfig { /** * An authentication token. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The URL of the GitLab host. Defaults to https://gitlab.com */ @@ -163,12 +177,19 @@ export interface GiteaConnectionConfig { /** * A Personal Access Token (PAT). */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The URL of the Gitea host. Defaults to https://gitea.com */ @@ -242,12 +263,19 @@ export interface BitbucketConnectionConfig { /** * An authentication token. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Bitbucket URL */ @@ -292,12 +320,19 @@ export interface AzureDevOpsConnectionConfig { /** * A Personal Access Token (PAT). */ - token: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The URL of the Azure DevOps host. For Azure DevOps Cloud, use https://dev.azure.com. For Azure DevOps Server, use your server URL. */ diff --git a/packages/schemas/src/v3/gitea.schema.ts b/packages/schemas/src/v3/gitea.schema.ts index 2e15067e..878d04eb 100644 --- a/packages/schemas/src/v3/gitea.schema.ts +++ b/packages/schemas/src/v3/gitea.schema.ts @@ -16,13 +16,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, diff --git a/packages/schemas/src/v3/gitea.type.ts b/packages/schemas/src/v3/gitea.type.ts index afbedaf3..4dfc1371 100644 --- a/packages/schemas/src/v3/gitea.type.ts +++ b/packages/schemas/src/v3/gitea.type.ts @@ -8,12 +8,19 @@ export interface GiteaConnectionConfig { /** * A Personal Access Token (PAT). */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The URL of the Gitea host. Defaults to https://gitea.com */ diff --git a/packages/schemas/src/v3/github.schema.ts b/packages/schemas/src/v3/github.schema.ts index d32ff6fe..5bb70bcf 100644 --- a/packages/schemas/src/v3/github.schema.ts +++ b/packages/schemas/src/v3/github.schema.ts @@ -16,13 +16,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, diff --git a/packages/schemas/src/v3/github.type.ts b/packages/schemas/src/v3/github.type.ts index 980f2f9f..6dcfc445 100644 --- a/packages/schemas/src/v3/github.type.ts +++ b/packages/schemas/src/v3/github.type.ts @@ -8,12 +8,19 @@ export interface GithubConnectionConfig { /** * A Personal Access Token (PAT). */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The URL of the GitHub host. Defaults to https://github.com */ diff --git a/packages/schemas/src/v3/gitlab.schema.ts b/packages/schemas/src/v3/gitlab.schema.ts index ee0cfd56..a1809f82 100644 --- a/packages/schemas/src/v3/gitlab.schema.ts +++ b/packages/schemas/src/v3/gitlab.schema.ts @@ -16,13 +16,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, diff --git a/packages/schemas/src/v3/gitlab.type.ts b/packages/schemas/src/v3/gitlab.type.ts index 98a8d960..4e2edcaf 100644 --- a/packages/schemas/src/v3/gitlab.type.ts +++ b/packages/schemas/src/v3/gitlab.type.ts @@ -8,12 +8,19 @@ export interface GitlabConnectionConfig { /** * An authentication token. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The URL of the GitLab host. Defaults to https://gitlab.com */ diff --git a/packages/schemas/src/v3/index.schema.ts b/packages/schemas/src/v3/index.schema.ts index 90e7c0ae..64d1ed60 100644 --- a/packages/schemas/src/v3/index.schema.ts +++ b/packages/schemas/src/v3/index.schema.ts @@ -303,13 +303,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -498,13 +511,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -687,13 +713,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -941,13 +980,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1096,13 +1148,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1367,13 +1432,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1385,13 +1463,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1403,13 +1494,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1444,13 +1548,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1488,13 +1605,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `ANTHROPIC_API_KEY` environment variable." @@ -1521,13 +1651,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1569,13 +1712,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `AZURE_API_KEY` environment variable." @@ -1606,13 +1762,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1650,13 +1819,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `DEEPSEEK_API_KEY` environment variable." @@ -1683,13 +1865,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1727,13 +1922,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable." @@ -1760,13 +1968,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1820,13 +2041,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -1853,13 +2087,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1915,13 +2162,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -1948,13 +2208,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1992,13 +2265,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `MISTRAL_API_KEY` environment variable." @@ -2025,13 +2311,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2075,13 +2374,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENAI_API_KEY` environment variable." @@ -2118,13 +2430,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2162,13 +2487,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer ." @@ -2198,13 +2536,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2229,13 +2580,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2284,13 +2648,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENROUTER_API_KEY` environment variable." @@ -2317,13 +2694,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2365,13 +2755,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `XAI_API_KEY` environment variable." @@ -2398,13 +2801,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2445,13 +2861,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -2463,13 +2892,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -2481,13 +2923,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -2522,13 +2977,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2566,13 +3034,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `ANTHROPIC_API_KEY` environment variable." @@ -2599,13 +3080,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2647,13 +3141,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `AZURE_API_KEY` environment variable." @@ -2684,13 +3191,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2728,13 +3248,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `DEEPSEEK_API_KEY` environment variable." @@ -2761,13 +3294,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2805,13 +3351,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable." @@ -2838,13 +3397,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2898,13 +3470,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -2931,13 +3516,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2993,13 +3591,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -3026,13 +3637,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3070,13 +3694,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `MISTRAL_API_KEY` environment variable." @@ -3103,13 +3740,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3153,13 +3803,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENAI_API_KEY` environment variable." @@ -3196,13 +3859,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3240,13 +3916,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer ." @@ -3276,13 +3965,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3307,13 +4009,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3362,13 +4077,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENROUTER_API_KEY` environment variable." @@ -3395,13 +4123,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3443,13 +4184,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `XAI_API_KEY` environment variable." @@ -3476,13 +4230,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -3536,13 +4303,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "The private key of the GitHub App." @@ -3585,13 +4365,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "The private key of the GitHub App." diff --git a/packages/schemas/src/v3/index.type.ts b/packages/schemas/src/v3/index.type.ts index 75acc3d8..b0ad6409 100644 --- a/packages/schemas/src/v3/index.type.ts +++ b/packages/schemas/src/v3/index.type.ts @@ -155,12 +155,19 @@ export interface GithubConnectionConfig { /** * A Personal Access Token (PAT). */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The URL of the GitHub host. Defaults to https://github.com */ @@ -237,12 +244,19 @@ export interface GitlabConnectionConfig { /** * An authentication token. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The URL of the GitLab host. Defaults to https://gitlab.com */ @@ -301,12 +315,19 @@ export interface GiteaConnectionConfig { /** * A Personal Access Token (PAT). */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The URL of the Gitea host. Defaults to https://gitea.com */ @@ -380,12 +401,19 @@ export interface BitbucketConnectionConfig { /** * An authentication token. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Bitbucket URL */ @@ -430,12 +458,19 @@ export interface AzureDevOpsConnectionConfig { /** * A Personal Access Token (PAT). */ - token: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The URL of the Azure DevOps host. For Azure DevOps Cloud, use https://dev.azure.com. For Azure DevOps Server, use your server URL. */ @@ -516,30 +551,51 @@ export interface AmazonBedrockLanguageModel { /** * Optional access key ID to use with the model. Defaults to the `AWS_ACCESS_KEY_ID` environment variable. */ - accessKeyId?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + accessKeyId?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional secret access key to use with the model. Defaults to the `AWS_SECRET_ACCESS_KEY` environment variable. */ - accessKeySecret?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + accessKeySecret?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional session token to use with the model. Defaults to the `AWS_SESSION_TOKEN` environment variable. */ - sessionToken?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + sessionToken?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The AWS region. Defaults to the `AWS_REGION` environment variable. */ @@ -560,12 +616,20 @@ export interface LanguageModelHeaders { */ [k: string]: | string - | { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + | ( + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + } + ); } export interface AnthropicLanguageModel { /** @@ -583,12 +647,19 @@ export interface AnthropicLanguageModel { /** * Optional API key to use with the model. Defaults to the `ANTHROPIC_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -615,12 +686,19 @@ export interface AzureLanguageModel { /** * Optional API key to use with the model. Defaults to the `AZURE_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Sets a custom api version. Defaults to `preview`. */ @@ -647,12 +725,19 @@ export interface DeepSeekLanguageModel { /** * Optional API key to use with the model. Defaults to the `DEEPSEEK_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -675,12 +760,19 @@ export interface GoogleGenerativeAILanguageModel { /** * Optional API key to use with the model. Defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -711,12 +803,19 @@ export interface GoogleVertexAnthropicLanguageModel { /** * Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials. */ - credentials?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + credentials?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -747,12 +846,19 @@ export interface GoogleVertexLanguageModel { /** * Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials. */ - credentials?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + credentials?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -775,12 +881,19 @@ export interface MistralLanguageModel { /** * Optional API key to use with the model. Defaults to the `MISTRAL_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -803,12 +916,19 @@ export interface OpenAILanguageModel { /** * Optional API key to use with the model. Defaults to the `OPENAI_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -835,12 +955,19 @@ export interface OpenAICompatibleLanguageModel { /** * Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer . */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Base URL of the OpenAI-compatible chat completions API endpoint. */ @@ -862,12 +989,20 @@ export interface LanguageModelQueryParams { */ [k: string]: | string - | { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + | ( + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + } + ); } export interface OpenRouterLanguageModel { /** @@ -885,12 +1020,19 @@ export interface OpenRouterLanguageModel { /** * Optional API key to use with the model. Defaults to the `OPENROUTER_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -913,12 +1055,19 @@ export interface XaiLanguageModel { /** * Optional API key to use with the model. Defaults to the `XAI_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -941,10 +1090,17 @@ export interface GitHubAppConfig { /** * The private key of the GitHub App. */ - privateKey: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + privateKey: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; } diff --git a/packages/schemas/src/v3/languageModel.schema.ts b/packages/schemas/src/v3/languageModel.schema.ts index e3f72781..007f4329 100644 --- a/packages/schemas/src/v3/languageModel.schema.ts +++ b/packages/schemas/src/v3/languageModel.schema.ts @@ -26,13 +26,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -44,13 +57,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -62,13 +88,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -103,13 +142,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -147,13 +199,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `ANTHROPIC_API_KEY` environment variable." @@ -180,13 +245,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -228,13 +306,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `AZURE_API_KEY` environment variable." @@ -265,13 +356,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -309,13 +413,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `DEEPSEEK_API_KEY` environment variable." @@ -342,13 +459,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -386,13 +516,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable." @@ -419,13 +562,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -479,13 +635,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -512,13 +681,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -574,13 +756,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -607,13 +802,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -651,13 +859,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `MISTRAL_API_KEY` environment variable." @@ -684,13 +905,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -734,13 +968,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENAI_API_KEY` environment variable." @@ -777,13 +1024,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -821,13 +1081,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer ." @@ -857,13 +1130,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -888,13 +1174,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -943,13 +1242,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENROUTER_API_KEY` environment variable." @@ -976,13 +1288,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1024,13 +1349,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `XAI_API_KEY` environment variable." @@ -1057,13 +1395,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1104,13 +1455,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1122,13 +1486,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1140,13 +1517,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -1181,13 +1571,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1225,13 +1628,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `ANTHROPIC_API_KEY` environment variable." @@ -1258,13 +1674,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1306,13 +1735,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `AZURE_API_KEY` environment variable." @@ -1343,13 +1785,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1387,13 +1842,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `DEEPSEEK_API_KEY` environment variable." @@ -1420,13 +1888,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1464,13 +1945,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable." @@ -1497,13 +1991,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1557,13 +2064,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -1590,13 +2110,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1652,13 +2185,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials." @@ -1685,13 +2231,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1729,13 +2288,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `MISTRAL_API_KEY` environment variable." @@ -1762,13 +2334,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1812,13 +2397,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENAI_API_KEY` environment variable." @@ -1855,13 +2453,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1899,13 +2510,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer ." @@ -1935,13 +2559,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -1966,13 +2603,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2021,13 +2671,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `OPENROUTER_API_KEY` environment variable." @@ -2054,13 +2717,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -2102,13 +2778,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ], "description": "Optional API key to use with the model. Defaults to the `XAI_API_KEY` environment variable." @@ -2135,13 +2824,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } diff --git a/packages/schemas/src/v3/languageModel.type.ts b/packages/schemas/src/v3/languageModel.type.ts index 48f5b83e..b46028fb 100644 --- a/packages/schemas/src/v3/languageModel.type.ts +++ b/packages/schemas/src/v3/languageModel.type.ts @@ -30,30 +30,51 @@ export interface AmazonBedrockLanguageModel { /** * Optional access key ID to use with the model. Defaults to the `AWS_ACCESS_KEY_ID` environment variable. */ - accessKeyId?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + accessKeyId?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional secret access key to use with the model. Defaults to the `AWS_SECRET_ACCESS_KEY` environment variable. */ - accessKeySecret?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + accessKeySecret?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional session token to use with the model. Defaults to the `AWS_SESSION_TOKEN` environment variable. */ - sessionToken?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + sessionToken?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * The AWS region. Defaults to the `AWS_REGION` environment variable. */ @@ -74,12 +95,20 @@ export interface LanguageModelHeaders { */ [k: string]: | string - | { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + | ( + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + } + ); } export interface AnthropicLanguageModel { /** @@ -97,12 +126,19 @@ export interface AnthropicLanguageModel { /** * Optional API key to use with the model. Defaults to the `ANTHROPIC_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -129,12 +165,19 @@ export interface AzureLanguageModel { /** * Optional API key to use with the model. Defaults to the `AZURE_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Sets a custom api version. Defaults to `preview`. */ @@ -161,12 +204,19 @@ export interface DeepSeekLanguageModel { /** * Optional API key to use with the model. Defaults to the `DEEPSEEK_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -189,12 +239,19 @@ export interface GoogleGenerativeAILanguageModel { /** * Optional API key to use with the model. Defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -225,12 +282,19 @@ export interface GoogleVertexAnthropicLanguageModel { /** * Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials. */ - credentials?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + credentials?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -261,12 +325,19 @@ export interface GoogleVertexLanguageModel { /** * Optional file path to service account credentials JSON. Defaults to the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or application default credentials. */ - credentials?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + credentials?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -289,12 +360,19 @@ export interface MistralLanguageModel { /** * Optional API key to use with the model. Defaults to the `MISTRAL_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -317,12 +395,19 @@ export interface OpenAILanguageModel { /** * Optional API key to use with the model. Defaults to the `OPENAI_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -349,12 +434,19 @@ export interface OpenAICompatibleLanguageModel { /** * Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer . */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Base URL of the OpenAI-compatible chat completions API endpoint. */ @@ -376,12 +468,20 @@ export interface LanguageModelQueryParams { */ [k: string]: | string - | { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + | ( + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + } + ); } export interface OpenRouterLanguageModel { /** @@ -399,12 +499,19 @@ export interface OpenRouterLanguageModel { /** * Optional API key to use with the model. Defaults to the `OPENROUTER_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ @@ -427,12 +534,19 @@ export interface XaiLanguageModel { /** * Optional API key to use with the model. Defaults to the `XAI_API_KEY` environment variable. */ - token?: { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; - }; + token?: + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; /** * Optional base URL. */ diff --git a/packages/schemas/src/v3/shared.schema.ts b/packages/schemas/src/v3/shared.schema.ts index 44238cad..6c850520 100644 --- a/packages/schemas/src/v3/shared.schema.ts +++ b/packages/schemas/src/v3/shared.schema.ts @@ -10,13 +10,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] }, @@ -77,13 +90,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } @@ -108,13 +134,26 @@ const schema = { "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] } diff --git a/packages/schemas/src/v3/shared.type.ts b/packages/schemas/src/v3/shared.type.ts index 23113f50..cf81b51d 100644 --- a/packages/schemas/src/v3/shared.type.ts +++ b/packages/schemas/src/v3/shared.type.ts @@ -4,12 +4,19 @@ * This interface was referenced by `Shared`'s JSON-Schema * via the `definition` "Token". */ -export type Token = { - /** - * The name of the environment variable that contains the token. Only supported in declarative connection configs. - */ - env: string; -}; +export type Token = + | { + /** + * The name of the environment variable that contains the token. + */ + env: string; + } + | { + /** + * The name of the GCP secret that contains the token. + */ + gcpSecretName: string; + }; export interface Shared { [k: string]: unknown; diff --git a/packages/web/src/actions.ts b/packages/web/src/actions.ts index 895084e0..4ebfd552 100644 --- a/packages/web/src/actions.ts +++ b/packages/web/src/actions.ts @@ -4,12 +4,12 @@ import { getAuditService } from "@/ee/features/audit/factory"; import { env } from "@/env.mjs"; import { addUserToOrganization, orgHasAvailability } from "@/lib/authUtils"; import { ErrorCode } from "@/lib/errorCodes"; -import { notAuthenticated, notFound, orgNotFound, secretAlreadyExists, ServiceError, ServiceErrorException, unexpectedError } from "@/lib/serviceError"; +import { notAuthenticated, notFound, orgNotFound, ServiceError, ServiceErrorException, unexpectedError } from "@/lib/serviceError"; import { getOrgMetadata, isHttpError, isServiceError } from "@/lib/utils"; import { prisma } from "@/prisma"; import { render } from "@react-email/components"; import * as Sentry from '@sentry/nextjs'; -import { encrypt, generateApiKey, getTokenFromConfig, hashSecret } from "@sourcebot/crypto"; +import { generateApiKey, getTokenFromConfig, hashSecret } from "@sourcebot/crypto"; import { ApiKey, ConnectionSyncJobStatus, Org, OrgRole, Prisma, RepoIndexingJobStatus, RepoIndexingJobType, StripeSubscriptionStatus } from "@sourcebot/db"; import { createLogger } from "@sourcebot/logger"; import { GiteaConnectionConfig } from "@sourcebot/schemas/v3/gitea.type"; diff --git a/schemas/v3/shared.json b/schemas/v3/shared.json index a290edd1..c559a386 100644 --- a/schemas/v3/shared.json +++ b/schemas/v3/shared.json @@ -9,13 +9,26 @@ "properties": { "env": { "type": "string", - "description": "The name of the environment variable that contains the token. Only supported in declarative connection configs." + "description": "The name of the environment variable that contains the token." } }, "required": [ "env" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gcpSecretName": { + "type": "string", + "description": "The name of the GCP secret that contains the token." + } + }, + "required": [ + "gcpSecretName" + ], + "additionalProperties": false } ] },