feat: implement Firebase ID token authentication for passenger telemetry and update related configurations

This commit is contained in:
2026-09-18 04:04:43 +03:00
parent 863ac603bc
commit b5c6b1973e
8 changed files with 206 additions and 14 deletions

View File

@@ -77,9 +77,15 @@ try {
logger.warn('Upload routes disabled - multer not installed. Run: npm install multer');
}
// API routes with API key authentication and rate limiting
// Passenger telemetry has its own Firebase ID-token authentication inside apiRoutes.
// All other API routes keep the existing API-key/custom-JWT contract.
app.use('/api/v1',
authenticateApiKey,
(req, res, next) => {
if (req.path === '/passenger-telemetry/ingest') {
return next();
}
return authenticateApiKey(req, res, next);
},
createRateLimiter(1000, 3600000), // 1000 requests per hour
apiRoutes
);