fix(langfuse): align secret preview field

This commit is contained in:
Ravi Kumar L 2026-07-29 20:52:38 +02:00
parent 723f6194f3
commit afdae93412
5 changed files with 17 additions and 17 deletions

View file

@ -509,7 +509,7 @@ export default function LangfuseConnection() {
onClick={() => setIsEditingSecretKey(true)}
>
<code className="block min-w-0 truncate font-mono text-sm text-text-primary">
{connectionStatus?.displaySecretKey}
{connectionStatus?.secretKeyPreview}
</code>
</button>
)}

View file

@ -120,7 +120,7 @@ describe('LangfuseConnection', () => {
],
destination: 'us',
publicKey: 'pk-lf-12345678-515f',
displaySecretKey: 'sk-lf-...515f',
secretKeyPreview: 'sk-lf-...515f',
},
});
render(<LangfuseConnection />);
@ -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(<LangfuseConnection />);
@ -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(<LangfuseConnection />);
@ -335,7 +335,7 @@ describe('LangfuseConnection', () => {
],
destination: 'eu',
publicKey: 'pk-lf-original',
displaySecretKey: 'sk-lf-...515f',
secretKeyPreview: 'sk-lf-...515f',
},
});
render(<LangfuseConnection />);
@ -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(<LangfuseConnection />);
@ -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(<LangfuseConnection />);
@ -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',
});
});

View file

@ -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');

View file

@ -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,
};
}

View file

@ -868,7 +868,7 @@ export type TLangfuseConnectionStatus = {
destinations: TLangfuseDestinationOption[];
destination?: string;
publicKey?: string;
displaySecretKey?: string;
secretKeyPreview?: string;
updatedAt?: string;
};