♻️(yprovider) support multiple API keys to separate responsibilities
Support for two API keys has been added to the YProvider microservice to decouple responsibilities between the collaboration server and other endpoints. This improves security by scoping keys to specific purposes and ensures a clearer separation of concerns for easier management and debugging.
This commit is contained in:
committed by
aleb_the_flash
parent
8a93122882
commit
3ca39ceb8a
@@ -14,6 +14,7 @@ jest.mock('../src/env', () => {
|
||||
PORT: port,
|
||||
COLLABORATION_SERVER_ORIGIN: origin,
|
||||
COLLABORATION_SERVER_SECRET: 'test-secret-api-key',
|
||||
Y_PROVIDER_API_KEY: 'yprovider-api-key',
|
||||
};
|
||||
});
|
||||
|
||||
@@ -115,7 +116,7 @@ describe('Server Tests', () => {
|
||||
const response = await request(app as any)
|
||||
.post('/api/convert-markdown')
|
||||
.set('Origin', origin)
|
||||
.set('Authorization', 'test-secret-api-key');
|
||||
.set('Authorization', 'yprovider-api-key');
|
||||
|
||||
expect(response.status).toBe(400);
|
||||
expect(response.body.error).toBe('Invalid request: missing content');
|
||||
@@ -125,7 +126,7 @@ describe('Server Tests', () => {
|
||||
const response = await request(app as any)
|
||||
.post('/api/convert-markdown')
|
||||
.set('Origin', origin)
|
||||
.set('Authorization', 'test-secret-api-key')
|
||||
.set('Authorization', 'yprovider-api-key')
|
||||
.send({
|
||||
content: '',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user