Phase 1-2 of server consolidation + security hardening

This commit is contained in:
2026-05-23 17:27:22 -04:00
parent 36f23b527e
commit 1ab14ba45f
46 changed files with 1103 additions and 6826 deletions
+27
View File
@@ -0,0 +1,27 @@
import { pino } from 'pino';
const REDACTED_PATHS = [
'req.headers.authorization',
'req.headers.cookie',
'headers.authorization',
'headers.cookie',
'*.password',
'*.token',
'*.jwt',
];
export function createLogger(options = {}) {
return pino({
level: process.env.LOG_LEVEL ?? 'info',
redact: {
paths: REDACTED_PATHS,
censor: '[REDACTED]',
},
base: {
service: options.service ?? process.env.SERVICE_NAME ?? 'inventory',
},
...options,
});
}
export const logger = createLogger();