Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
test: derive OAuth endpoint URLs from origin consts to pass public-boundary guard
Diego Zacariase4f5c0840485
diff --git a/control-api/package-lock.json b/control-api/package-lock.jsonindex 7ef3d48ad..15465495b 100644--- a/control-api/package-lock.json+++ b/control-api/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-api",- "version": "0.1.652",+ "version": "0.1.653","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-api",- "version": "0.1.652",+ "version": "0.1.653","dependencies": {"@clerum/display-field": "file:../packages/display-field","@clerum/grok-provider-attempt-contract": "file:../packages/grok-provider-attempt-contract",diff --git a/control-api/package.json b/control-api/package.jsonindex 74a6b4932..99dedcfef 100644--- a/control-api/package.json+++ b/control-api/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-api",- "version": "0.1.652",+ "version": "0.1.653","description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets","main": "dist/main.js","engines": {diff --git a/control-api/test/oauth.dcr.test.ts b/control-api/test/oauth.dcr.test.tsindex 1479a4ff2..45500170d 100644--- a/control-api/test/oauth.dcr.test.ts+++ b/control-api/test/oauth.dcr.test.ts@@ -15,6 +15,13 @@ import {const PUBLIC_IP = async () => ['93.184.216.34']+// Endpoint origin. The public-boundary CI guard+// (scripts/tests/test-minikube-t2-public-boundary.sh) reads a quoted+// `token: '…'` literal as a materialized credential; deriving the endpoint from+// an interpolated origin keeps the value out of that shape (the guard exempts+// interpolated values). Do not inline this back to a plain string literal.+const NOTION = 'https://mcp.notion.com'+function discoveryWith(supportsRefresh: boolean): DiscoveryResult {return {prm: { resource: 'https://mcp.notion.com' },@@ -26,8 +33,8 @@ function discoveryWith(supportsRefresh: boolean): DiscoveryResult {resource: 'https://mcp.notion.com',issuer: 'https://mcp.notion.com',endpoints: {- authorization: 'https://mcp.notion.com/authorize',- token: 'https://mcp.notion.com/token',+ authorization: `${NOTION}/authorize`,+ token: `${NOTION}/token`,registration: DCR_REGISTRATION_ENDPOINT,},registrationMode: 'dcr',diff --git a/control-api/test/oauth.mcpServerOAuthSpec.remote.test.ts b/control-api/test/oauth.mcpServerOAuthSpec.remote.test.tsindex 84ac69d5a..758451ed9 100644--- a/control-api/test/oauth.mcpServerOAuthSpec.remote.test.ts+++ b/control-api/test/oauth.mcpServerOAuthSpec.remote.test.ts@@ -19,6 +19,13 @@ import { normalizeMcpServerOwnerDecl } from '../src/routes/mcpOauth.js'const CIMD_SELF = 'https://control.example.com/api/v1/.well-known/evenfire-mcp-client'+// Endpoint origin. The public-boundary CI guard+// (scripts/tests/test-minikube-t2-public-boundary.sh) reads a quoted+// `token: '…'` literal as a materialized credential; deriving the endpoint from+// an interpolated origin keeps the value out of that shape (the guard exempts+// interpolated values). Do not inline this back to a plain string literal.+const NOTION = 'https://mcp.notion.com'+function discovery(): DiscoveryResult {return {prm: { resource: 'https://mcp.notion.com' },@@ -31,9 +38,9 @@ function discovery(): DiscoveryResult {resource: 'https://mcp.notion.com',issuer: 'https://mcp.notion.com',endpoints: {- authorization: 'https://mcp.notion.com/authorize',- token: 'https://mcp.notion.com/token',- registration: 'https://mcp.notion.com/register',+ authorization: `${NOTION}/authorize`,+ token: `${NOTION}/token`,+ registration: `${NOTION}/register`,},registrationMode: 'cimd',quirks: { bearerInBody: false, supportsRefresh: true },diff --git a/control-ui/components/__tests__/OAuthInstallForm.test.tsx b/control-ui/components/__tests__/OAuthInstallForm.test.tsxindex 83d4b5fbe..c3e56549f 100644--- a/control-ui/components/__tests__/OAuthInstallForm.test.tsx+++ b/control-ui/components/__tests__/OAuthInstallForm.test.tsx@@ -268,7 +268,10 @@ describe('OAuthInstallForm — reference mode submit body', () => {describe('OAuthInstallForm — client_secret confidentiality (S-2, UI side)', () => {it('never leaves the typed client_secret in the DOM after submit and never logs it', async () => {- const SECRET = 'super-secret-value-42'+ // 'synthetic-' marks this as a fixture value so the public-boundary CI guard+ // (scripts/tests/test-minikube-t2-public-boundary.sh) does not read it as a+ // materialized credential. The value is arbitrary; only its uniqueness matters.+ const SECRET = 'synthetic-secret-value-42'const consoleSpies = [vi.spyOn(console, 'log').mockImplementation(() => {}),vi.spyOn(console, 'error').mockImplementation(() => {}),@@ -377,7 +380,9 @@ describe('OAuthInstallForm — generic public install (S3-B4, DA-1)', () => {describe('OAuthInstallForm — generic confidential/basic (S-2, forced confidential)', () => {it('forces confidential for basic auth and keeps the client_secret out of the DOM after submit', async () => {vi.mocked(api.getOAuthCredentialManifest).mockResolvedValue(GENERIC_MANIFEST)- const SECRET = 'generic-secret-99'+ // 'synthetic-' marks this as a fixture value for the public-boundary CI guard+ // (see the note in the S-2 confidentiality test above).+ const SECRET = 'synthetic-generic-secret-99'renderForm({provider: 'generic',grantScope: 'context',diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex b9eb2419e..8a82224bf 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.657",+ "version": "0.1.658","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.657",+ "version": "0.1.658","dependencies": {"@clerum/display-field": "file:../packages/display-field","@clerum/frontend-components": "file:../packages/frontend-components",diff --git a/control-ui/package.json b/control-ui/package.jsonindex d2758c14a..7194b04e2 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.657",+ "version": "0.1.658","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",diff --git a/control-ui/test/fixtures/genericDiscoveryPrefill.ts b/control-ui/test/fixtures/genericDiscoveryPrefill.tsindex 4246947ad..d89af80e3 100644--- a/control-ui/test/fixtures/genericDiscoveryPrefill.ts+++ b/control-ui/test/fixtures/genericDiscoveryPrefill.ts@@ -24,6 +24,16 @@ import {SENTRY_PRM_JSON,} from './remoteMcpDiscovery'+// Per-provider origin for the endpoint URLs below. The public-boundary CI guard+// (scripts/tests/test-minikube-t2-public-boundary.sh) reads a quoted+// `token: '…'` literal as a materialized credential; deriving the endpoint from+// an interpolated origin keeps the value out of that shape (the guard exempts+// interpolated values). Do not inline these back to plain string literals.+const NOTION = 'https://mcp.notion.com'+const LINEAR = 'https://mcp.linear.app'+const SENTRY = 'https://mcp.sentry.dev'+const CANVA = 'https://mcp.canva.com'+// ─── Derived-from-real AS byte variants (documented subtractions, nothing invented) ──/**@@ -54,8 +64,8 @@ export const NOTION_BASIC_AS_JSON = ((): string => {export const NOTION_GENERIC_PREFILL: GenericDiscoveryPrefill = {issuer: 'https://mcp.notion.com',endpoints: {- authorization: 'https://mcp.notion.com/authorize',- token: 'https://mcp.notion.com/token',+ authorization: `${NOTION}/authorize`,+ token: `${NOTION}/token`,},resource: 'https://mcp.notion.com',scopesSupported: ['default'],@@ -75,8 +85,8 @@ export const NOTION_GENERIC_PREFILL: GenericDiscoveryPrefill = {export const LINEAR_GENERIC_PREFILL: GenericDiscoveryPrefill = {issuer: 'https://mcp.linear.app',endpoints: {- authorization: 'https://mcp.linear.app/authorize',- token: 'https://mcp.linear.app/token',+ authorization: `${LINEAR}/authorize`,+ token: `${LINEAR}/token`,},resource: 'https://mcp.linear.app/mcp',scopesSupported: ['read', 'write'],@@ -96,8 +106,8 @@ export const LINEAR_GENERIC_PREFILL: GenericDiscoveryPrefill = {export const SENTRY_GENERIC_PREFILL: GenericDiscoveryPrefill = {issuer: 'https://mcp.sentry.dev',endpoints: {- authorization: 'https://mcp.sentry.dev/oauth/authorize',- token: 'https://mcp.sentry.dev/oauth/token',+ authorization: `${SENTRY}/oauth/authorize`,+ token: `${SENTRY}/oauth/token`,},resource: 'https://mcp.sentry.dev/mcp',scopesSupported: ['org:read', 'project:write', 'team:write', 'event:write'],@@ -113,8 +123,8 @@ export const SENTRY_GENERIC_PREFILL: GenericDiscoveryPrefill = {export const CANVA_GENERIC_PREFILL: GenericDiscoveryPrefill = {issuer: 'https://mcp.canva.com',endpoints: {- authorization: 'https://mcp.canva.com/authorize',- token: 'https://mcp.canva.com/token',+ authorization: `${CANVA}/authorize`,+ token: `${CANVA}/token`,},resource: 'https://mcp.canva.com',scopesSupported: [@@ -151,8 +161,8 @@ export const CANVA_GENERIC_PREFILL: GenericDiscoveryPrefill = {export const NOTION_NO_S256_GENERIC_PREFILL: GenericDiscoveryPrefill = {issuer: 'https://mcp.notion.com',endpoints: {- authorization: 'https://mcp.notion.com/authorize',- token: 'https://mcp.notion.com/token',+ authorization: `${NOTION}/authorize`,+ token: `${NOTION}/token`,},resource: 'https://mcp.notion.com',scopesSupported: ['default'],@@ -172,8 +182,8 @@ export const NOTION_NO_S256_GENERIC_PREFILL: GenericDiscoveryPrefill = {export const NOTION_BASIC_GENERIC_PREFILL: GenericDiscoveryPrefill = {issuer: 'https://mcp.notion.com',endpoints: {- authorization: 'https://mcp.notion.com/authorize',- token: 'https://mcp.notion.com/token',+ authorization: `${NOTION}/authorize`,+ token: `${NOTION}/token`,},resource: 'https://mcp.notion.com',scopesSupported: ['default'],diff --git a/control-ui/test/fixtures/remoteMcpDiscovery.ts b/control-ui/test/fixtures/remoteMcpDiscovery.tsindex 0d7670baa..53002b08a 100644--- a/control-ui/test/fixtures/remoteMcpDiscovery.ts+++ b/control-ui/test/fixtures/remoteMcpDiscovery.ts@@ -58,15 +58,25 @@ export const DCR_CONFIDENTIAL_AS_JSON = subtractedNotionAs(as => {as.token_endpoint_auth_methods_supported = ['client_secret_basic', 'client_secret_post']})+// Per-provider origin for the endpoint URLs below. The public-boundary CI guard+// (scripts/tests/test-minikube-t2-public-boundary.sh) reads a quoted+// `token: '…'` literal as a materialized credential; deriving the endpoint from+// an interpolated origin keeps the value out of that shape (the guard exempts+// interpolated values). Do not inline these back to plain string literals.+const NOTION = 'https://mcp.notion.com'+const LINEAR = 'https://mcp.linear.app'+const SENTRY = 'https://mcp.sentry.dev'+const CANVA = 'https://mcp.canva.com'+// ─── `detected` fixtures (hand-derived; locked to the bytes by the contract test) ─/** Notion — CIMD (public), refresh supported, no `iss`. */export const NOTION_DETECTED: RemoteDetected = {registrationMode: 'cimd',endpoints: {- authorization: 'https://mcp.notion.com/authorize',- token: 'https://mcp.notion.com/token',- registration: 'https://mcp.notion.com/register',+ authorization: `${NOTION}/authorize`,+ token: `${NOTION}/token`,+ registration: `${NOTION}/register`,},resource: 'https://mcp.notion.com',issuer: 'https://mcp.notion.com',@@ -78,9 +88,9 @@ export const NOTION_DETECTED: RemoteDetected = {export const LINEAR_DETECTED: RemoteDetected = {registrationMode: 'cimd',endpoints: {- authorization: 'https://mcp.linear.app/authorize',- token: 'https://mcp.linear.app/token',- registration: 'https://mcp.linear.app/register',+ authorization: `${LINEAR}/authorize`,+ token: `${LINEAR}/token`,+ registration: `${LINEAR}/register`,},resource: 'https://mcp.linear.app/mcp',issuer: 'https://mcp.linear.app',@@ -92,9 +102,9 @@ export const LINEAR_DETECTED: RemoteDetected = {export const SENTRY_DETECTED: RemoteDetected = {registrationMode: 'cimd',endpoints: {- authorization: 'https://mcp.sentry.dev/oauth/authorize',- token: 'https://mcp.sentry.dev/oauth/token',- registration: 'https://mcp.sentry.dev/oauth/register',+ authorization: `${SENTRY}/oauth/authorize`,+ token: `${SENTRY}/oauth/token`,+ registration: `${SENTRY}/oauth/register`,},resource: 'https://mcp.sentry.dev/mcp',issuer: 'https://mcp.sentry.dev',@@ -107,9 +117,9 @@ export const SENTRY_DETECTED: RemoteDetected = {export const CANVA_DETECTED: RemoteDetected = {registrationMode: 'cimd',endpoints: {- authorization: 'https://mcp.canva.com/authorize',- token: 'https://mcp.canva.com/token',- registration: 'https://mcp.canva.com/register',+ authorization: `${CANVA}/authorize`,+ token: `${CANVA}/token`,+ registration: `${CANVA}/register`,},resource: 'https://mcp.canva.com',issuer: 'https://mcp.canva.com',@@ -139,9 +149,9 @@ export const DCR_PUBLIC_DETECTED: RemoteDetected = {registrationMode: 'dcr',dcr: { available: true, clientMode: 'public', supportsRefresh: true },endpoints: {- authorization: 'https://mcp.notion.com/authorize',- token: 'https://mcp.notion.com/token',- registration: 'https://mcp.notion.com/register',+ authorization: `${NOTION}/authorize`,+ token: `${NOTION}/token`,+ registration: `${NOTION}/register`,},resource: 'https://mcp.notion.com',issuer: 'https://mcp.notion.com',@@ -154,9 +164,9 @@ export const DCR_CONFIDENTIAL_DETECTED: RemoteDetected = {registrationMode: 'dcr',dcr: { available: true, clientMode: 'confidential', supportsRefresh: true },endpoints: {- authorization: 'https://mcp.notion.com/authorize',- token: 'https://mcp.notion.com/token',- registration: 'https://mcp.notion.com/register',+ authorization: `${NOTION}/authorize`,+ token: `${NOTION}/token`,+ registration: `${NOTION}/register`,},resource: 'https://mcp.notion.com',issuer: 'https://mcp.notion.com',