diff --git a/apps/api/src/common/guards/api-key.guard.ts b/apps/api/src/common/guards/api-key.guard.ts index 0845247..55ea7e3 100644 --- a/apps/api/src/common/guards/api-key.guard.ts +++ b/apps/api/src/common/guards/api-key.guard.ts @@ -13,29 +13,17 @@ export class ApiKeyGuard implements CanActivate { async canActivate(context: ExecutionContext): Promise { const request = context.switchToHttp().getRequest(); - // Extract Origin and Referer for domain-level security - const origin = request.headers['origin'] || ''; - const referer = request.headers['referer'] || ''; - - // Extract API key from custom header or query params, with public demo fallback - let apiKeyHeader = request.headers['x-api-key'] || request.query['api_key'] || request.query['key']; + // Extract API key from custom header or query parameters + const apiKeyHeader = request.headers['x-api-key'] || request.query['api_key'] || request.query['key']; if (!apiKeyHeader) { - const isInternalDomain = - origin.includes('intaleqapp.com') || - referer.includes('intaleqapp.com') || - origin.includes('localhost') || - referer.includes('localhost') || - origin.includes('188.68.36.205') || - referer.includes('188.68.36.205'); - - if (isInternalDomain) { - apiKeyHeader = process.env.MAP_API_KEY || 'zP9vL5mK2nQ8xR7jT4wS1yB6hG3fV0cX'; - } else { - throw new UnauthorizedException('API Key (x-api-key) is missing'); - } + throw new UnauthorizedException('API Key (x-api-key) is missing'); } + // Extract Origin and Referer for domain-level security + const origin = request.headers['origin']; + const referer = request.headers['referer']; + try { // Validate key via AuthService (includes Redis caching and domain checks) const { tenant, apiKey, rateLimit } = await this.authService.validateApiKey( diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index 6c9c21d..5129d2c 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; import MapComponent from './components/MapComponent'; -import { Navigation, Compass, Activity, BarChart3, MapPin, Eye, Shield } from 'lucide-react'; +import { Navigation, Compass, Activity, BarChart3, MapPin, Eye, Shield, Gauge, Clock } from 'lucide-react'; import { decodePolyline } from './utils/polyline'; import WeatherPanel from './components/WeatherPanel'; import { LineOfSightTool } from './components/LineOfSightTool';