chore(gateway, ping-service, security): streamline configurations, remove redundancies, and improve resilience
- Removed `MdcCorrelationFilter` and simplified correlation ID management using Micrometer Tracing. - Updated `SecurityConfig` in `gateway` with enhanced role-based access and standardized JWT validation. - Added new `@Profile` annotations in `ping-service` to exclude certain components during testing. - Refactored and removed legacy `application-keycloak.yaml` and consolidated settings into the primary `application.yaml`. - Adjusted Gradle scripts to clean up dependency declarations and improve modularity. - Simplified CORS and Gateway route configurations for better maintainability.
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
# migrated from application-keycloak.yml (standardized to .yaml)
|
||||
spring:
|
||||
security:
|
||||
oauth2:
|
||||
resourceserver:
|
||||
jwt:
|
||||
issuer-uri: ${KEYCLOAK_ISSUER_URI:http://keycloak:8180/realms/meldestelle}
|
||||
jwk-set-uri: ${KEYCLOAK_JWK_SET_URI:http://keycloak:8180/realms/meldestelle/protocol/openid-connect/certs}
|
||||
|
||||
keycloak:
|
||||
server-url: ${KEYCLOAK_SERVER_URL:http://keycloak:8180}
|
||||
issuer-uri: ${KEYCLOAK_ISSUER_URI:http://keycloak:8180/realms/meldestelle}
|
||||
jwk-set-uri: ${KEYCLOAK_JWK_SET_URI:http://keycloak:8180/realms/meldestelle/protocol/openid-connect/certs}
|
||||
realm: ${KEYCLOAK_REALM:meldestelle}
|
||||
resource: ${KEYCLOAK_CLIENT_ID:api-gateway}
|
||||
client-id: ${KEYCLOAK_CLIENT_ID:api-gateway}
|
||||
public-client: false
|
||||
bearer-only: true
|
||||
@@ -1,58 +1,23 @@
|
||||
spring:
|
||||
application:
|
||||
name: gateway
|
||||
name: "gateway"
|
||||
autoconfigure:
|
||||
exclude:
|
||||
- org.springframework.boot.restclient.autoconfigure.RestClientAutoConfiguration
|
||||
- org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration
|
||||
- "org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration"
|
||||
cloud:
|
||||
gateway:
|
||||
globalcors:
|
||||
cors-configurations:
|
||||
'[/**]':
|
||||
allowed-origin-patterns: "http://localhost:*,http://127.0.0.1:*"
|
||||
allowed-methods:
|
||||
- GET
|
||||
- POST
|
||||
- PUT
|
||||
- DELETE
|
||||
- OPTIONS
|
||||
allowed-headers: "*"
|
||||
allow-credentials: true
|
||||
max-age: 3600
|
||||
httpclient:
|
||||
connect-timeout: 3000
|
||||
response-timeout: 5s
|
||||
routes:
|
||||
- id: ping-service
|
||||
# Nutze lb:// wenn Service Discovery aktiv ist, sonst http://hostname:port
|
||||
# Da wir Consul nutzen, ist lb://ping-service besser, aber für Tracer Bullet
|
||||
# und direkte Docker-Kommunikation ist http://ping-service:8082 sicherer,
|
||||
# falls Consul noch nicht 100% stabil ist.
|
||||
# Wir nutzen hier den Docker Alias und den konfigurierten Port.
|
||||
uri: http://ping-service:8082
|
||||
predicates:
|
||||
- Path=/api/ping/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- name: CircuitBreaker
|
||||
args:
|
||||
name: pingServiceCB
|
||||
fallbackUri: forward:/fallback/ping
|
||||
# Wir nutzen die Standard-HTTP-Client-Konfiguration (Reactor Netty Defaults).
|
||||
# Explizite Timeouts oder Pool-Settings können bei Bedarf über System-Properties
|
||||
# oder spezifische Beans gesetzt werden, um Deprecation-Warnungen in YAML zu vermeiden.
|
||||
httpclient: {}
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,prometheus
|
||||
include: "health,info,prometheus"
|
||||
tracing:
|
||||
sampling:
|
||||
probability: 1.0
|
||||
propagation:
|
||||
type: w3c
|
||||
|
||||
gateway:
|
||||
ratelimit:
|
||||
enabled: false
|
||||
replenish-rate: 10
|
||||
burst-capacity: 20
|
||||
type: "w3c"
|
||||
|
||||
Reference in New Issue
Block a user