Skip to content

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

TypeScript

test(control-api): key proactive-refresh grants by oauth.id like production

Diego Zacariasf0e1f6ed09b7
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index c0f7b6769..7c2a1ed14 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.611",
+ "version": "0.1.612",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.611",
+ "version": "0.1.612",
"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.json
index b9757d8d4..7480cba97 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.611",
+ "version": "0.1.612",
"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.proactiveRefresh.realPostgres.integration.test.ts b/control-api/test/oauth.proactiveRefresh.realPostgres.integration.test.ts
index b7b0f84b2..1cb830dbc 100644
--- a/control-api/test/oauth.proactiveRefresh.realPostgres.integration.test.ts
+++ b/control-api/test/oauth.proactiveRefresh.realPostgres.integration.test.ts
@@ -49,6 +49,10 @@ const WINDOW = { proactiveBufferMs: 300_000, reactiveBufferMs: 60_000 }
const IN_WINDOW_SEC = 200 // 60s < 200s ≤ 300s → proactive window
const HEALTHY_SEC = 1_000 // > Bp
const REACTIVE_SEC = 30 // ≤ Br
+// The remote lane keys the grant by `oauth.id` (resolveServerOAuth), and the
+// refresh path matches the recipe decl by that same id. Seed grants and the
+// owner decl from ONE id so the pair stays consistent, as production is.
+const REMOTE_OAUTH_ID = 'https://control.example.com/.well-known/evenfire-mcp-client'
describeRealPostgres('oauth proactive refresh — enumeration + claim (real Postgres)', () => {
const database = `control_api_proactive_${randomUUID().replace(/-/g, '')}`
@@ -84,7 +88,7 @@ describeRealPostgres('oauth proactive refresh — enumeration + claim (real Post
recipeNamespace: NS,
recipeName: server,
contextId: ctx,
- oauthClientId: 'remote-cid',
+ oauthClientId: REMOTE_OAUTH_ID,
})
async function seedShared(
@@ -115,7 +119,7 @@ describeRealPostgres('oauth proactive refresh — enumeration + claim (real Post
recipeNamespace: NS,
recipeName: server,
userId,
- oauthClientId: 'remote-cid',
+ oauthClientId: REMOTE_OAUTH_ID,
provider: 'remote',
accessToken: 'AT',
refreshToken: 'RT',
@@ -143,7 +147,7 @@ describeRealPostgres('oauth proactive refresh — enumeration + claim (real Post
contextRef: 'ctx-1',
oauth: {
source: 'remote',
- id: 'https://control.example.com/.well-known/evenfire-mcp-client',
+ id: REMOTE_OAUTH_ID,
clientMode: 'public',
authorizationEndpoint: 'https://as.example.com/authorize',
tokenEndpoint: REMOTE_TOKEN_ENDPOINT,
@@ -230,7 +234,7 @@ describeRealPostgres('oauth proactive refresh — enumeration + claim (real Post
recipeNamespace: NS,
recipeName: 'e-recipe',
userId: 'u-recipe',
- oauthClientId: 'remote-cid',
+ oauthClientId: REMOTE_OAUTH_ID,
provider: 'remote',
accessToken: 'AT',
accessTokenExpiresInSec: IN_WINDOW_SEC,