Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
test(control-api): capture the unknown-tenant and scope-limit remote wire goldens
Diego Zacarias80fc4a2c28ae
diff --git a/control-api/package-lock.json b/control-api/package-lock.jsonindex 8a9c615ce..e15c3f454 100644--- a/control-api/package-lock.json+++ b/control-api/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-api",- "version": "0.1.804",+ "version": "0.1.805","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-api",- "version": "0.1.804",+ "version": "0.1.805","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 5959df73a..94f96c827 100644--- a/control-api/package.json+++ b/control-api/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-api",- "version": "0.1.804",+ "version": "0.1.805","description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets","main": "dist/main.js","engines": {diff --git a/control-api/test/fixtures/wire/remoteMcp.discover.entraUnknownTenant.json b/control-api/test/fixtures/wire/remoteMcp.discover.entraUnknownTenant.jsonnew file mode 100644index 000000000..5526a0b1e--- /dev/null+++ b/control-api/test/fixtures/wire/remoteMcp.discover.entraUnknownTenant.json@@ -0,0 +1,12 @@+{+ "status": 424,+ "body": {+ "error": "discovery_failed",+ "detail": {+ "kind": "fetch_failed",+ "url": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000001/v2.0/.well-known/openid-configuration",+ "status": 400,+ "detail": "HTTP 400"+ }+ }+}diff --git a/control-api/test/fixtures/wire/remoteMcp.install.scopeLimitExceeded.json b/control-api/test/fixtures/wire/remoteMcp.install.scopeLimitExceeded.jsonnew file mode 100644index 000000000..cbb55eeca--- /dev/null+++ b/control-api/test/fixtures/wire/remoteMcp.install.scopeLimitExceeded.json@@ -0,0 +1,7 @@+{+ "status": 400,+ "body": {+ "error": "invalid_request",+ "message": "at most 128 scopes, including those the authorization server requires"+ }+}diff --git a/control-api/test/routes.adminRemoteMcp.wireGoldens.test.ts b/control-api/test/routes.adminRemoteMcp.wireGoldens.test.tsindex 5d7d59f7b..f4c3249d5 100644--- a/control-api/test/routes.adminRemoteMcp.wireGoldens.test.ts+++ b/control-api/test/routes.adminRemoteMcp.wireGoldens.test.ts@@ -233,6 +233,15 @@ describe('remote MCP wire goldens — POST /discover', () => {expect(actual).toEqual(golden('discover.workiqTenantRequired', actual))})+ it('discover.entraUnknownTenant: a tenant Entra does not know → 424 fetch_failed', async () => {+ const actual = await discover(ENTRA_WORKIQ_PILOT, {+ authorizationServer:+ 'https://login.microsoftonline.com/00000000-0000-0000-0000-000000000001/v2.0',+ })+ expect(actual.status).toBe(424)+ expect(actual).toEqual(golden('discover.entraUnknownTenant', actual))+ })+it('discover.issuerPublicSuffix: issuer on a public suffix, no RFC 9207 → 400', async () => {const actual = await discover(ISSUER_ON_PUBLIC_SUFFIX_PILOT)expect(actual.status).toBe(400)@@ -311,6 +320,23 @@ describe('remote MCP wire goldens — POST / (install)', () => {})}+ it('install.scopeLimitExceeded: 128 scopes plus the profile offline_access → 400', async () => {+ const scopes = Array.from(+ { length: 128 },+ (_, i) => `api://workiq.svc.cloud.microsoft/Scope${i}`+ )+ const actual = await install(ENTRA_WORKIQ_PILOT, {+ serverName: 'workiq',+ mode: 'pre-registered',+ clientId: '11111111-2222-3333-4444-555555555555',+ clientSecret: 'test-secret',+ authorizationServer: ENTRA_TENANT_AUTHORITY,+ scopes,+ })+ expect(actual.status).toBe(400)+ expect(actual).toEqual(golden('install.scopeLimitExceeded', actual))+ })+it('install.linear: shared CIMD 201', async () => {const actual = await install(PILOTS.linear, { serverName: 'linear', mode: 'cimd' })expect(actual.status).toBe(201)