mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 14:57:42 +00:00
fix(langfuse): validate public key independently
This commit is contained in:
parent
5dd47ae62a
commit
2df92580bc
2 changed files with 4 additions and 4 deletions
|
|
@ -514,9 +514,8 @@ describe('createAdminLangfuseHandlers', () => {
|
|||
const [publicUrl, publicInit] = (global.fetch as unknown as jest.Mock).mock.calls[1];
|
||||
expect(publicUrl).toBe('https://cloud.langfuse.com/api/public/ingestion');
|
||||
expect(publicInit.method).toBe('POST');
|
||||
expect(
|
||||
Buffer.from(publicInit.headers.Authorization.replace('Basic ', ''), 'base64').toString(),
|
||||
).toBe('pk:sk');
|
||||
expect(publicInit.headers.Authorization).toBe('Bearer pk');
|
||||
expect(publicInit.headers['X-Langfuse-Public-Key']).toBe('pk');
|
||||
expect(publicInit.headers['Content-Type']).toBe('application/json');
|
||||
expect(JSON.parse(publicInit.body)).toEqual({ batch: [] });
|
||||
expect(publicInit.signal).toBe(init.signal);
|
||||
|
|
|
|||
|
|
@ -118,7 +118,8 @@ async function verifyLangfuseCredentials(
|
|||
const publicResponse = await fetch(`${destination.baseUrl}/api/public/ingestion`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: `Basic ${auth}`,
|
||||
Authorization: `Bearer ${publicKey}`,
|
||||
'X-Langfuse-Public-Key': publicKey,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ batch: [] }),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue