Skip to content

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

TypeScript

test: mark recovery credential fixtures as synthetic

Josuéa825efed6733
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index e202849e8..df3391491 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.739",
+ "version": "0.1.740",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.739",
+ "version": "0.1.740",
"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 38771b118..f03e556c0 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.739",
+ "version": "0.1.740",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/test/routes.externalInvitations.unavailable.test.ts b/control-api/test/routes.externalInvitations.unavailable.test.ts
index daff89712..484e3ce2c 100644
--- a/control-api/test/routes.externalInvitations.unavailable.test.ts
+++ b/control-api/test/routes.externalInvitations.unavailable.test.ts
@@ -92,11 +92,11 @@ describe('external invitation routes when the hub is unavailable', () => {
it('issues a normal session only after trusted password-reset validation and completion', async () => {
flow.validateInvitationFlowToken.mockResolvedValue({
- invitationUuid: 'producer-token-1',
+ invitationUuid: 'Synthetic-producer-token-1',
})
directory.getInvitationByToken.mockResolvedValue({
id: 'database-row-1',
- token: 'producer-token-1',
+ token: 'Synthetic-producer-token-1',
purpose: 'password_reset',
status: 'pending',
@@ -126,7 +126,7 @@ describe('external invitation routes when the hub is unavailable', () => {
const res = await request(app())
.post('/external/invitations/password-token')
.send({
- token: 'trusted-reset-proof',
+ token: 'Synthetic-trusted-reset-proof',
invitationId: 'database-row-1',
password: 'Synthetic-new-password',
@@ -134,7 +134,7 @@ describe('external invitation routes when the hub is unavailable', () => {
.expect(200)
expect(flow.validateInvitationFlowToken).toHaveBeenCalledWith(
- 'trusted-reset-proof',
+ 'Synthetic-trusted-reset-proof',
)
expect(directory.setInvitationPasswordForEmail).toHaveBeenCalledWith(
@@ -160,7 +160,7 @@ describe('external invitation routes when the hub is unavailable', () => {
const invalidProof = await request(app())
.post('/external/invitations/password-token')
.send({
- token: 'invalid-reset-proof',
+ token: 'Synthetic-invalid-reset-proof',
invitationId: 'reset-1',
password: 'Synthetic-new-password',
@@ -170,11 +170,11 @@ describe('external invitation routes when the hub is unavailable', () => {
flow.validateInvitationFlowToken.mockResolvedValue({
- invitationUuid: 'producer-token-1',
+ invitationUuid: 'Synthetic-producer-token-1',
})
directory.getInvitationByToken.mockResolvedValue({
id: 'database-row-1',
- token: 'producer-token-1',
+ token: 'Synthetic-producer-token-1',
purpose: 'password_reset',
status: 'accepted',
@@ -182,7 +182,7 @@ describe('external invitation routes when the hub is unavailable', () => {
await request(app())
.post('/external/invitations/password-token')
.send({
- token: 'redeemed-reset-proof',
+ token: 'Synthetic-redeemed-reset-proof',
invitationId: 'database-row-1',
password: 'Synthetic-new-password',
@@ -194,7 +194,7 @@ describe('external invitation routes when the hub is unavailable', () => {
directory.getInvitationByToken.mockReset().mockResolvedValue({
id: 'database-row-1',
- token: 'producer-token-1',
+ token: 'Synthetic-producer-token-1',
purpose: 'password_reset',
status: 'pending',
@@ -203,7 +203,7 @@ describe('external invitation routes when the hub is unavailable', () => {
await request(app())
.post('/external/invitations/password-token')
.send({
- token: 'raced-reset-proof',
+ token: 'Synthetic-raced-reset-proof',
invitationId: 'database-row-1',
password: 'Synthetic-new-password',
@@ -215,11 +215,11 @@ describe('external invitation routes when the hub is unavailable', () => {
it('rejects a database row ID that does not match the trusted flow token', async () => {
flow.validateInvitationFlowToken.mockResolvedValue({
- invitationUuid: 'producer-token-1',
+ invitationUuid: 'Synthetic-producer-token-1',
})
directory.getInvitationByToken.mockResolvedValue({
id: 'database-row-1',
- token: 'producer-token-1',
+ token: 'Synthetic-producer-token-1',
purpose: 'password_reset',
status: 'pending',
@@ -228,7 +228,7 @@ describe('external invitation routes when the hub is unavailable', () => {
const res = await request(app())
.post('/external/invitations/password-token')
.send({
- token: 'trusted-reset-proof',
+ token: 'Synthetic-trusted-reset-proof',
invitationId: 'another-row',
password: 'Synthetic-new-password',
diff --git a/external-rest-api/package-lock.json b/external-rest-api/package-lock.json
index 43870353b..d0a88c089 100644
--- a/external-rest-api/package-lock.json
+++ b/external-rest-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-external-rest-api",
- "version": "0.1.102",
+ "version": "0.1.103",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-external-rest-api",
- "version": "0.1.102",
+ "version": "0.1.103",
"dependencies": {
"@clerum/jwt-key-policy": "file:../packages/jwt-key-policy",
"cors": "^2.8.5",
diff --git a/external-rest-api/package.json b/external-rest-api/package.json
index 40131493f..0bfedb7a9 100644
--- a/external-rest-api/package.json
+++ b/external-rest-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-external-rest-api",
- "version": "0.1.102",
+ "version": "0.1.103",
"description": "External REST API for profile, team management, and RPC token brokerage",
"main": "dist/main.js",
"engines": {
diff --git a/external-rest-api/src/releaseManifest.ts b/external-rest-api/src/releaseManifest.ts
index 47ac0184b..1577f12ce 100644
--- a/external-rest-api/src/releaseManifest.ts
+++ b/external-rest-api/src/releaseManifest.ts
@@ -8,7 +8,7 @@ export type ReleaseManifest = {
export const releaseManifest: ReleaseManifest = {
releaseId: 'v0.10.0',
- externalRestApiVersion: '0.1.102',
+ externalRestApiVersion: '0.1.103',
rpcProxyVersion: '0.1.126',
desktopVersion: '0.10.0',
minimumDesktopVersion: '0.1.252',
diff --git a/external-rest-api/test/routes.invitations.test.ts b/external-rest-api/test/routes.invitations.test.ts
index 29cea2db0..51ced147d 100644
--- a/external-rest-api/test/routes.invitations.test.ts
+++ b/external-rest-api/test/routes.invitations.test.ts
@@ -88,7 +88,7 @@ describe('routes/invitations', () => {
teamId: null,
teamName: null,
role: 'member',
- token: 'pre-reset-session-token',
+ token: 'Synthetic-pre-reset-session-token',
},
})
invitationsServiceMock.setupInvitationPassword.mockResolvedValue({
@@ -107,17 +107,17 @@ describe('routes/invitations', () => {
purpose: 'password_reset',
status: 'accepted',
passwordUpdated: true,
- token: 'post-reset-session-token',
+ token: 'Synthetic-post-reset-session-token',
},
})
const res = await request(makeApp())
.post('/invitations/password')
.send({
- token: 'verified-password-reset-link',
+ token: 'Synthetic-verified-password-reset-link',
invitationId: 'inv-1',
- password: 'new-password-123',
+ password: 'Synthetic-new-password-123',
})
.expect(200)
@@ -128,16 +128,18 @@ describe('routes/invitations', () => {
status: 'accepted',
passwordUpdated: true,
})
- expect(JSON.stringify(res.body)).not.toContain('post-reset-session-token')
- expect(String(res.headers['set-cookie'])).toContain('profile_session=post-reset-session-token')
- expect(String(res.headers['set-cookie'])).not.toContain('pre-reset-session-token')
+ expect(JSON.stringify(res.body)).not.toContain('Synthetic-post-reset-session-token')
+ expect(String(res.headers['set-cookie'])).toContain(
+ 'profile_session=Synthetic-post-reset-session-token'
+ )
+ expect(String(res.headers['set-cookie'])).not.toContain('Synthetic-pre-reset-session-token')
expect(invitationsServiceMock.acceptInvitation).not.toHaveBeenCalled()
expect(invitationsServiceMock.setupInvitationPassword).not.toHaveBeenCalled()
expect(invitationsServiceMock.setupInvitationPasswordWithToken).toHaveBeenCalledWith(
- 'verified-password-reset-link',
+ 'Synthetic-verified-password-reset-link',
'inv-1',
- 'new-password-123'
+ 'Synthetic-new-password-123'
)
})
@@ -160,10 +162,10 @@ describe('routes/invitations', () => {
const res = await request(makeApp())
.post('/invitations/password')
.send({
- token: 'verified-password-reset-link',
+ token: 'Synthetic-verified-password-reset-link',
invitationId: 'inv-1',
- password: 'new-password-123',
+ password: 'Synthetic-new-password-123',
})
.expect(429)
@@ -188,10 +190,10 @@ describe('routes/invitations', () => {
const res = await request(makeApp())
.post('/invitations/password')
.send({
- token: 'invalid-recovery-proof',
+ token: 'Synthetic-invalid-recovery-proof',
invitationId: 'inv-1',
- password: 'new-password-123',
+ password: 'Synthetic-new-password-123',
})
.expect(400)
@@ -202,7 +204,7 @@ describe('routes/invitations', () => {
it('does not expose preview lookup paths or recovery proofs when the signed link is invalid', async () => {
invitationsServiceMock.getInvitationByToken.mockRejectedValue(
new ControlApiError(
- 'Control API GET /external/invitations/token/raw-proof failed (400)',
+ 'Control API GET /external/invitations/token/Synthetic-raw-proof failed (400)',
400,
{ error: 'invalid_invitation' }
)
@@ -211,15 +213,15 @@ describe('routes/invitations', () => {
const res = await request(makeApp())
.post('/invitations/password')
.send({
- token: 'raw-proof',
+ token: 'Synthetic-raw-proof',
invitationId: 'inv-1',
- password: 'new-password-123',
+ password: 'Synthetic-new-password-123',
})
.expect(400)
expect(res.body).toEqual({ error: 'invalid_invitation' })
- expect(JSON.stringify(res.body)).not.toContain('raw-proof')
+ expect(JSON.stringify(res.body)).not.toContain('Synthetic-raw-proof')
expect(JSON.stringify(res.body)).not.toContain('/external/invitations/token')
expect(res.headers['set-cookie']).toBeUndefined()
expect(invitationsServiceMock.setupInvitationPasswordWithToken).not.toHaveBeenCalled()
@@ -228,16 +230,16 @@ describe('routes/invitations', () => {
it('sanitizes rejected recovery proofs on the public invitation preview route', async () => {
invitationsServiceMock.getInvitationByToken.mockRejectedValue(
new ControlApiError(
- 'Control API GET /external/invitations/token/raw-proof failed (400)',
+ 'Control API GET /external/invitations/token/Synthetic-raw-proof failed (400)',
400,
{ error: 'invalid_invitation' }
)
)
- const res = await request(makeApp()).get('/invitations/token/raw-proof').expect(400)
+ const res = await request(makeApp()).get('/invitations/token/Synthetic-raw-proof').expect(400)
expect(res.body).toEqual({ error: 'invalid_invitation' })
- expect(JSON.stringify(res.body)).not.toContain('raw-proof')
+ expect(JSON.stringify(res.body)).not.toContain('Synthetic-raw-proof')
expect(JSON.stringify(res.body)).not.toContain('/external/invitations/token')
})