From afdae9341252e02cf597fac0c5e63bd30f2b1589 Mon Sep 17 00:00:00 2001 From: Ravi Kumar L Date: Wed, 29 Jul 2026 20:52:38 +0200 Subject: [PATCH] fix(langfuse): align secret preview field --- .../Integrations/LangfuseConnection.tsx | 2 +- .../__tests__/LangfuseConnection.spec.tsx | 22 +++++++++---------- .../api/src/admin/langfuse.handler.spec.ts | 6 ++--- packages/api/src/admin/langfuse.ts | 2 +- packages/data-provider/src/types.ts | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx b/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx index aa48a409eb..0a4209d0cb 100644 --- a/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx +++ b/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx @@ -509,7 +509,7 @@ export default function LangfuseConnection() { onClick={() => setIsEditingSecretKey(true)} > - {connectionStatus?.displaySecretKey} + {connectionStatus?.secretKeyPreview} )} diff --git a/client/src/components/Nav/SettingsTabs/Integrations/__tests__/LangfuseConnection.spec.tsx b/client/src/components/Nav/SettingsTabs/Integrations/__tests__/LangfuseConnection.spec.tsx index 85d4592a50..3a88fc1871 100644 --- a/client/src/components/Nav/SettingsTabs/Integrations/__tests__/LangfuseConnection.spec.tsx +++ b/client/src/components/Nav/SettingsTabs/Integrations/__tests__/LangfuseConnection.spec.tsx @@ -120,7 +120,7 @@ describe('LangfuseConnection', () => { ], destination: 'us', publicKey: 'pk-lf-12345678-515f', - displaySecretKey: 'sk-lf-...515f', + secretKeyPreview: 'sk-lf-...515f', }, }); render(); @@ -152,7 +152,7 @@ describe('LangfuseConnection', () => { destinations: [{ key: 'eu', baseUrl: 'https://cloud.langfuse.com' }], destination: 'eu', publicKey: 'pk-lf-1', - displaySecretKey: 'sk-lf-...515f', + secretKeyPreview: 'sk-lf-...515f', }, }); @@ -204,7 +204,7 @@ describe('LangfuseConnection', () => { ], destination: 'us', publicKey: 'pk-lf-1', - displaySecretKey: 'sk-lf-...cret', + secretKeyPreview: 'sk-lf-...cret', }); }); @@ -235,7 +235,7 @@ describe('LangfuseConnection', () => { ], destination: 'eu', publicKey: 'pk-lf-1', - displaySecretKey: 'sk-lf-...515f', + secretKeyPreview: 'sk-lf-...515f', }, }); render(); @@ -269,7 +269,7 @@ describe('LangfuseConnection', () => { destinations: [{ key: 'eu', baseUrl: 'https://cloud.langfuse.com' }], destination: 'eu', publicKey: 'pk-lf-1', - displaySecretKey: 'sk-lf-...515f', + secretKeyPreview: 'sk-lf-...515f', }, }); render(); @@ -335,7 +335,7 @@ describe('LangfuseConnection', () => { ], destination: 'eu', publicKey: 'pk-lf-original', - displaySecretKey: 'sk-lf-...515f', + secretKeyPreview: 'sk-lf-...515f', }, }); render(); @@ -407,7 +407,7 @@ describe('LangfuseConnection', () => { destinations: [{ key: 'eu', baseUrl: 'https://cloud.langfuse.com' }], destination: 'eu', publicKey: 'pk-lf-valid', - displaySecretKey: 'sk-lf-...515f', + secretKeyPreview: 'sk-lf-...515f', }, }); render(); @@ -447,7 +447,7 @@ describe('LangfuseConnection', () => { destinations: [{ key: 'eu', baseUrl: 'https://cloud.langfuse.com' }], destination: 'eu', publicKey: 'pk-lf-1', - displaySecretKey: 'sk-lf-...515f', + secretKeyPreview: 'sk-lf-...515f', }, }); render(); @@ -460,7 +460,7 @@ describe('LangfuseConnection', () => { destinations: [{ key: 'eu', baseUrl: 'https://cloud.langfuse.com' }], destination: 'eu', publicKey: 'pk-lf-1', - displaySecretKey: 'sk-lf-...515f', + secretKeyPreview: 'sk-lf-...515f', updatedAt: '2026-07-10T15:30:00.000Z', }); }); @@ -486,7 +486,7 @@ describe('LangfuseConnection', () => { destinations: [{ key: 'eu', baseUrl: 'https://cloud.langfuse.com' }], destination: 'eu', publicKey: 'pk-lf-1', - displaySecretKey: 'sk-lf-...515f', + secretKeyPreview: 'sk-lf-...515f', }, }); mockUpdate.mockImplementation((_payload, options) => { @@ -496,7 +496,7 @@ describe('LangfuseConnection', () => { destinations: [{ key: 'eu', baseUrl: 'https://cloud.langfuse.com' }], destination: 'eu', publicKey: 'pk-lf-1', - displaySecretKey: 'sk-lf-...515f', + secretKeyPreview: 'sk-lf-...515f', updatedAt: '2026-07-10T15:31:00.000Z', }); }); diff --git a/packages/api/src/admin/langfuse.handler.spec.ts b/packages/api/src/admin/langfuse.handler.spec.ts index 58f500e7f7..eb366c8c9e 100644 --- a/packages/api/src/admin/langfuse.handler.spec.ts +++ b/packages/api/src/admin/langfuse.handler.spec.ts @@ -225,7 +225,7 @@ describe('createAdminLangfuseHandlers', () => { destination: 'eu', publicKey: 'pk-lf-1', secretKey: encryptV3('sk-lf-secret'), - displaySecretKey: 'sk-lf...cret', + secretKeyPreview: 'sk-lf...cret', }), ), }); @@ -238,7 +238,7 @@ describe('createAdminLangfuseHandlers', () => { enabled: true, destination: 'eu', publicKey: 'pk-lf-1', - displaySecretKey: 'sk-lf...cret', + secretKeyPreview: 'sk-lf...cret', }); expect(res.body?.destinations).toEqual( expect.arrayContaining([{ key: 'eu', baseUrl: 'https://cloud.langfuse.com' }]), @@ -343,7 +343,7 @@ describe('createAdminLangfuseHandlers', () => { const fields = deps.patchConfigFields.mock.calls[0][3]; expect(fields['langfuse.secretKey']).toMatch(/^v3:/); expect(fields['langfuse.secretKey']).not.toContain('sk-lf-secret'); - expect(fields['langfuse.displaySecretKey']).toBe('sk-lf-...cret'); + expect(fields['langfuse.secretKeyPreview']).toBe('sk-lf-...cret'); expect(fields['langfuse.enabled']).toBe(true); expect(fields['langfuse.destination']).toBe('eu'); expect(fields['langfuse.publicKey']).toBe('pk-lf-1'); diff --git a/packages/api/src/admin/langfuse.ts b/packages/api/src/admin/langfuse.ts index ed780684a2..bf7773a4bd 100644 --- a/packages/api/src/admin/langfuse.ts +++ b/packages/api/src/admin/langfuse.ts @@ -67,7 +67,7 @@ function buildStatus(config: IConfig | null): TLangfuseConnectionStatus { destinations: getLangfuseTenantDestinations(), destination: stored?.destination, publicKey: stored?.publicKey, - displaySecretKey: stored?.displaySecretKey, + secretKeyPreview: stored?.secretKeyPreview, updatedAt: config?.updatedAt ? new Date(config.updatedAt).toISOString() : undefined, }; } diff --git a/packages/data-provider/src/types.ts b/packages/data-provider/src/types.ts index 66f19a9aed..9721d6425d 100644 --- a/packages/data-provider/src/types.ts +++ b/packages/data-provider/src/types.ts @@ -868,7 +868,7 @@ export type TLangfuseConnectionStatus = { destinations: TLangfuseDestinationOption[]; destination?: string; publicKey?: string; - displaySecretKey?: string; + secretKeyPreview?: string; updatedAt?: string; };