Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(host-context-controller): widen McpServerOAuth.provider to full adapter set (R1-M1)

Diego Zacariasb7f2fbaf60e9
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index 971556d02..94317002b 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.469",
+ "version": "0.1.470",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.469",
+ "version": "0.1.470",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/image-policy": "file:../packages/image-policy",
diff --git a/control-api/package.json b/control-api/package.json
index 4d711e8cd..32f95cd2f 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.469",
+ "version": "0.1.470",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/src/oauth/providers.ts b/control-api/src/oauth/providers.ts
index 14f16d401..c7da71e62 100644
--- a/control-api/src/oauth/providers.ts
+++ b/control-api/src/oauth/providers.ts
@@ -1,10 +1,20 @@
/**
- * Known-shape OAuth provider adapters supported by control-api. The string
- * union mirrors the CRD enum (charts/clerum-crds/crds/mcpserver.yaml +
- * workflowrecipe.yaml, provider enums) and the workflow-recipes types.ts
- * `OAuthProvider`. Adding a provider requires updating the CRD enum(s) and the
- * workflow-recipes union. Within control-api, `KNOWN_OAUTH_PROVIDERS` is derived
- * from `ADAPTERS` (single source of truth) — no per-call-site provider lists.
+ * Known-shape OAuth provider adapters supported by control-api. This is the
+ * full control-api ADAPTER SET — NOT the recipe-admissible set. The mcpserver
+ * CRD (`charts/clerum-crds/crds/mcpserver.yaml` `oauth.provider` enum) admits all
+ * of these; the WorkflowRecipe CRD (`workflowrecipe.yaml` `provider` enum)
+ * deliberately admits only the five legacy ones, so monday/clickup/vercel are
+ * mcpserver-only and are rejected at recipe admission — consumers that gate
+ * recipe providers must trust the recipe CRD enum, not this union.
+ *
+ * Adding a provider requires updating, in lockstep, ALL of:
+ * 1. this union + `ADAPTERS` below,
+ * 2. `charts/clerum-crds/crds/mcpserver.yaml` `oauth.provider` enum,
+ * 3. `workflow-recipes/src/types.ts` `OAuthProvider` (+ `workflowrecipe.yaml`
+ * enum, only if the provider is also recipe-valid),
+ * 4. `host-context-controller/src/types.ts` `McpServerOAuth.provider`.
+ * Within control-api, `KNOWN_OAUTH_PROVIDERS` is derived from `ADAPTERS` (single
+ * source of truth) — no per-call-site provider lists.
*
* U2 (spec 06 §U2) adds monday, clickup, vercel. monday + vercel require PKCE
* (see `usesPkce` / pkce.ts).
diff --git a/host-context-controller/package-lock.json b/host-context-controller/package-lock.json
index e9b28c157..6b6a904d8 100644
--- a/host-context-controller/package-lock.json
+++ b/host-context-controller/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-host-context-controller",
- "version": "0.1.170",
+ "version": "0.1.171",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-host-context-controller",
- "version": "0.1.170",
+ "version": "0.1.171",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@clerum/image-policy": "file:../packages/image-policy",
diff --git a/host-context-controller/package.json b/host-context-controller/package.json
index 17c98b81a..bf06f1a88 100644
--- a/host-context-controller/package.json
+++ b/host-context-controller/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-host-context-controller",
- "version": "0.1.170",
+ "version": "0.1.171",
"description": "Host Context Controller - provides McpServer CRDs to mcp-host via REST API",
"main": "dist/main.js",
"engines": {
diff --git a/host-context-controller/src/types.ts b/host-context-controller/src/types.ts
index ce5b8a603..565dd495b 100644
--- a/host-context-controller/src/types.ts
+++ b/host-context-controller/src/types.ts
@@ -30,7 +30,18 @@ export interface McpServerSecretRef {
*/
export interface McpServerOAuth {
id: string
- provider: 'salesforce' | 'slack' | 'notion' | 'microsoft-graph' | 'google'
+ // Full control-api adapter set — must mirror the mcpserver.yaml `oauth.provider`
+ // enum, control-api `providers.ts` `OAuthProvider`, and workflow-recipes
+ // `OAuthProvider`. U2 (spec 06) added monday/clickup/vercel.
+ provider:
+ | 'salesforce'
+ | 'slack'
+ | 'notion'
+ | 'microsoft-graph'
+ | 'google'
+ | 'monday'
+ | 'clickup'
+ | 'vercel'
clientIdRef: McpServerSecretRef
clientSecretRef: McpServerSecretRef
scopes?: string[]
diff --git a/host-context-controller/test/types.mcpServerOauth.test.ts b/host-context-controller/test/types.mcpServerOauth.test.ts
new file mode 100644
index 000000000..ce32e0659
--- /dev/null
+++ b/host-context-controller/test/types.mcpServerOauth.test.ts
@@ -0,0 +1,33 @@
+import { describe, expect, it } from 'vitest'
+import type { McpServerOAuth } from '../src/types'
+
+// R1-M1: the HCC `McpServerOAuth.provider` union must mirror the full control-api
+// adapter set (mcpserver.yaml `oauth.provider` enum). It previously omitted the
+// U2 providers (monday/clickup/vercel), so it misrepresented the CRD. These are
+// COMPILE-TIME assertions: the const declarations below fail `tsc`/`npm run build`
+// against the narrow (5-value) union, which is the regression this locks.
+describe('McpServerOAuth.provider union', () => {
+ it('admits every provider the mcpserver CRD enum admits (8)', () => {
+ const providers: McpServerOAuth['provider'][] = [
+ 'salesforce',
+ 'slack',
+ 'notion',
+ 'microsoft-graph',
+ 'google',
+ 'monday',
+ 'clickup',
+ 'vercel',
+ ]
+ expect(providers).toHaveLength(8)
+ })
+
+ it('types a monday OAuth server (U2 provider) without error', () => {
+ const oauth: McpServerOAuth = {
+ id: 'monday-personal',
+ provider: 'monday',
+ clientIdRef: { name: 'monday-oauth', key: 'client_id' },
+ clientSecretRef: { name: 'monday-oauth', key: 'client_secret' },
+ }
+ expect(oauth.provider).toBe('monday')
+ })
+})