diff --git a/kilimo-gateway-localhost.yml b/kilimo-gateway-localhost.yml index 55ac446..d6e446c 100644 --- a/kilimo-gateway-localhost.yml +++ b/kilimo-gateway-localhost.yml @@ -15,52 +15,49 @@ spring: # 3. Gateway Routing (Modern WebFlux Namespace) cloud: gateway: - globalcors: - cors-configurations: - '[/**]': - allowedOrigins: - - "http://localhost:3000" - - "https://kilimo.farm" - - "https://vm-qpse3mho5qps7fj2kw0hzy.vusercontent.net" - allowedMethods: - - GET - - POST - - PUT - - DELETE - - OPTIONS - allowedHeaders: - - "*" - allowCredentials: true - maxAge: 3600 # cache preflight response for 1 hour + server: + webflux: + globalcors: + cors-configurations: + '[/**]': # URL pattern to apply the configuration to + allowedOrigins: # Allows requests from a specific origin + - "*" + allowedMethods: + - "*" + allowedHeaders: + - "*" # Allows all headers + allowCredentials: false # Allows the browser to send cookies/auth headers + maxAge: 3600 # Cache the preflight response for 1 hour + routes: + - id: kilimo_core_service + uri: http://localhost:9081 + predicates: + - Path=/core/** + - Method=GET,POST,PUT,DELETE,OPTIONS + filters: + - RewritePath=/core/(?.*), /$\{path} + - name: AuthFilter + - name: RequestRateLimiter + args: + redis-rate-limiter.replenishRate: 10 + redis-rate-limiter.burstCapacity: 20 + key-resolver: "#{@userKeyResolver}" - routes: - - id: kilimo_core_service - uri: http://localhost:9081 - predicates: - - Path=/core/** - - Method=GET,POST,PUT,DELETE,OPTIONS - filters: - - RewritePath=/core/(?.*), /$\{path} - - name: AuthFilter - - name: RequestRateLimiter - args: - redis-rate-limiter.replenishRate: 10 - redis-rate-limiter.burstCapacity: 20 - key-resolver: "#{@userKeyResolver}" - - - id: kilimo_assistant_service - uri: http://localhost:9082 - predicates: - - Path=/assistant/** - - Method=GET,POST,PUT,DELETE,OPTIONS - filters: - - RewritePath=/assistant/(?.*), /${segment} - - name: AuthFilter - - name: RequestRateLimiter - args: - redis-rate-limiter.replenishRate: 10 - redis-rate-limiter.burstCapacity: 20 - key-resolver: "#{@userKeyResolver}" + - id: kilimo_assistant_service + uri: http://localhost:9082 + predicates: + - Path=/assistant/** + - Method=GET,POST,PUT,DELETE,OPTIONS + filters: + - RewritePath=/assistant/(?.*), /${segment} + - name: AuthFilter + - name: RequestRateLimiter + args: + redis-rate-limiter.replenishRate: 10 + redis-rate-limiter.burstCapacity: 20 + key-resolver: "#{@userKeyResolver}" + config: + enabled: false # 4. Actuator for Troubleshooting management: diff --git a/kilimo-gateway-production.yml b/kilimo-gateway-production.yml index 959fe31..d6e446c 100644 --- a/kilimo-gateway-production.yml +++ b/kilimo-gateway-production.yml @@ -15,52 +15,49 @@ spring: # 3. Gateway Routing (Modern WebFlux Namespace) cloud: gateway: - globalcors: - cors-configurations: - '[/**]': - allowedOrigins: - - "http://localhost:3000" - - "https://kilimo.farm" - - "https://vm-qpse3mho5qps7fj2kw0hzy.vusercontent.net" - allowedMethods: - - GET - - POST - - PUT - - DELETE - - OPTIONS - allowedHeaders: - - "*" - allowCredentials: true - maxAge: 3600 # cache preflight response for 1 hour + server: + webflux: + globalcors: + cors-configurations: + '[/**]': # URL pattern to apply the configuration to + allowedOrigins: # Allows requests from a specific origin + - "*" + allowedMethods: + - "*" + allowedHeaders: + - "*" # Allows all headers + allowCredentials: false # Allows the browser to send cookies/auth headers + maxAge: 3600 # Cache the preflight response for 1 hour + routes: + - id: kilimo_core_service + uri: http://localhost:9081 + predicates: + - Path=/core/** + - Method=GET,POST,PUT,DELETE,OPTIONS + filters: + - RewritePath=/core/(?.*), /$\{path} + - name: AuthFilter + - name: RequestRateLimiter + args: + redis-rate-limiter.replenishRate: 10 + redis-rate-limiter.burstCapacity: 20 + key-resolver: "#{@userKeyResolver}" - routes: - - id: kilimo_core_service - uri: http://localhost:9081 - predicates: - - Path=/core/** - - Method=GET,POST,PUT,DELETE,OPTIONS - filters: - - RewritePath=/core/(?.*), /${segment} - - name: AuthFilter - - name: RequestRateLimiter - args: - redis-rate-limiter.replenishRate: 10 - redis-rate-limiter.burstCapacity: 20 - key-resolver: "#{@userKeyResolver}" - - - id: kilimo_assistant_service - uri: http://localhost:9082 - predicates: - - Path=/assistant/** - - Method=GET,POST,PUT,DELETE,OPTIONS - filters: - - RewritePath=/assistant/(?.*), /${segment} - - name: AuthFilter - - name: RequestRateLimiter - args: - redis-rate-limiter.replenishRate: 10 - redis-rate-limiter.burstCapacity: 20 - key-resolver: "#{@userKeyResolver}" + - id: kilimo_assistant_service + uri: http://localhost:9082 + predicates: + - Path=/assistant/** + - Method=GET,POST,PUT,DELETE,OPTIONS + filters: + - RewritePath=/assistant/(?.*), /${segment} + - name: AuthFilter + - name: RequestRateLimiter + args: + redis-rate-limiter.replenishRate: 10 + redis-rate-limiter.burstCapacity: 20 + key-resolver: "#{@userKeyResolver}" + config: + enabled: false # 4. Actuator for Troubleshooting management: