feat: implement Firebase ID token authentication for passenger telemetry and update related configurations
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user