Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(control-api): give the managed OAuth client Secret create its write capability
Diego Zacarias565874746a06
diff --git a/control-api/package-lock.json b/control-api/package-lock.jsonindex 5866a0ac6..b18e36f6c 100644--- a/control-api/package-lock.json+++ b/control-api/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-api",- "version": "0.1.638",+ "version": "0.1.639","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-api",- "version": "0.1.638",+ "version": "0.1.639","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 2783e9829..770c65c01 100644--- a/control-api/package.json+++ b/control-api/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-api",- "version": "0.1.638",+ "version": "0.1.639","description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets","main": "dist/main.js","engines": {diff --git a/control-api/src/routes/admin/registry.ts b/control-api/src/routes/admin/registry.tsindex fd1e40d6a..be080b3bf 100644--- a/control-api/src/routes/admin/registry.ts+++ b/control-api/src/routes/admin/registry.ts@@ -2570,11 +2570,19 @@ export function createAdminRegistryRouter(gateway?: K8sGateway): Router {namespace: targetNs,type: 'Opaque',labels: registryLabels,- annotations: registryAnnotations,+ // Same write-capability contract as the env Secret above: dev's+ // assertValidSecretConstraints rejects `clerum.io/*` annotation keys+ // unless the write declares the matching capability, so this must use+ // `credentialAnnotations` (the grant-scoped subset) + the capability,+ // not the broader `registryAnnotations` which carries keys outside+ // the `registryCredential` grant.+ annotations: credentialAnnotations,stringData: managedOAuthSecret.data,}try {- createdOAuthClientSecretSnapshot = await gateway.createSecret(oauthSecretReq)+ createdOAuthClientSecretSnapshot = await gateway.createSecret(oauthSecretReq, {+ capability: 'registryCredential',+ })} catch (err) {// The OAuth client Secret write failed. Roll back the envSecret created// in Step 3 (if any) with the same identity-fenced helper dev uses for