Skip to content

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

TypeScript

test(control-api): derive OAuth Basic header instead of a literal in the golden

Diego Zacariase2422e811095
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index e21fcf1e4..c0f7b6769 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.610",
+ "version": "0.1.611",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.610",
+ "version": "0.1.611",
"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 7e01ada66..b9757d8d4 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.610",
+ "version": "0.1.611",
"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.providers.golden.test.ts b/control-api/test/oauth.providers.golden.test.ts
index 5db5ac82e..192a08ae9 100644
--- a/control-api/test/oauth.providers.golden.test.ts
+++ b/control-api/test/oauth.providers.golden.test.ts
@@ -42,6 +42,11 @@ const REFRESH_INPUT = { refreshToken: 'RT', clientId: 'cid', clientSecret: 'csec
const FORM = { 'content-type': 'application/x-www-form-urlencoded', accept: 'application/json' }
const JSON_HEADERS = { 'content-type': 'application/json', accept: 'application/json' }
+// Derived from the same dummy cid/csec inputs rather than inlined as a literal
+// `Basic <base64>` string: a hardcoded Basic-auth header trips secret scanners
+// as a leaked credential. Computing it keeps the golden byte-identical.
+const BASIC_CID_CSEC = `Basic ${Buffer.from('cid:csec').toString('base64')}`
+
const GOLDEN_AUTHORIZE: Record<OAuthProvider, string> = {
salesforce:
'https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=cid&redirect_uri=https%3A%2F%2Fcontrol.example.com%2Fapi%2Fv1%2Foauth-callback%2Fprovider&state=signed-state&scope=scope-a%20scope-b',
@@ -77,7 +82,7 @@ const GOLDEN_TOKEN: Record<OAuthProvider, TokenRequest> = {
notion: {
url: 'https://api.notion.com/v1/oauth/token',
method: 'POST',
- headers: { ...JSON_HEADERS, authorization: 'Basic Y2lkOmNzZWM=' },
+ headers: { ...JSON_HEADERS, authorization: BASIC_CID_CSEC },
body: '{"grant_type":"authorization_code","code":"thecode","redirect_uri":"https://control.example.com/api/v1/oauth-callback/provider"}',
},
'microsoft-graph': {