fix(api): wire research credentials into server security (RP20)
This commit is contained in:
parent
fd90d17214
commit
7de497e9b0
5 changed files with 274 additions and 26 deletions
|
|
@ -6,14 +6,17 @@ import { createRoutes, WEB_API_MAX_REQUEST_BODY_SIZE } from './routes/create-rou
|
|||
import { createWebSocketRoute, handleWebSocketConnection } from './routes/websocket.routes';
|
||||
import { BacktestDispatcher } from './services/BacktestDispatcher';
|
||||
import { getWebSocketHandler, type RunSocketData } from './websocket/run-updates';
|
||||
import { createWebApiSecurity } from './http-security';
|
||||
|
||||
// Initialize configuration with service-specific overrides
|
||||
const config = initializeStockConfig('webApi');
|
||||
const security = createHttpSecurity({
|
||||
const securityOptions = {
|
||||
...httpSecurityOptions(),
|
||||
environment: config.environment,
|
||||
browserSessions: true,
|
||||
});
|
||||
};
|
||||
// Reject invalid authentication settings before opening stores or running migrations.
|
||||
createHttpSecurity(securityOptions);
|
||||
|
||||
// Override queue settings for web-api (no workers needed)
|
||||
if (config.queue) {
|
||||
|
|
@ -65,6 +68,7 @@ export async function startServerWithWebSocket() {
|
|||
// Create container
|
||||
const diContainer = await createContainer(config);
|
||||
container = diContainer.resolve('serviceContainer');
|
||||
const security = createWebApiSecurity(container, securityOptions);
|
||||
|
||||
if (!container.postgres || !container.queueManager) {
|
||||
throw new Error('Durable backtest dispatch requires PostgreSQL and Redis queues');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue