JAVA-11240 Moved spring-cloud to spring-cloud-modules
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
spring:
|
||||
cloud:
|
||||
gateway:
|
||||
routes:
|
||||
- id: golden_route
|
||||
uri: https://httpbin.org
|
||||
predicates:
|
||||
- Path=/api/**
|
||||
- GoldenCustomer=true
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- AddRequestHeader=GoldenCustomer,true
|
||||
- id: common_route
|
||||
uri: https://httpbin.org
|
||||
predicates:
|
||||
- Path=/api/**
|
||||
- name: GoldenCustomer
|
||||
args:
|
||||
golden: false
|
||||
customerIdCookie: customerId
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- AddRequestHeader=GoldenCustomer,false
|
||||
|
||||
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
# Enable this profile to disable security
|
||||
spring:
|
||||
autoconfigure:
|
||||
exclude:
|
||||
- org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
|
||||
- org.springframework.boot.actuate.autoconfigure.ManagementSecurityAutoConfiguration
|
||||
- org.springframework.boot.autoconfigure.security.reactive.ReactiveSecurityAutoConfiguration
|
||||
- org.springframework.boot.actuate.autoconfigure.security.reactive.ReactiveManagementWebSecurityAutoConfiguration
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
server:
|
||||
port: 8087
|
||||
spring:
|
||||
cloud:
|
||||
gateway:
|
||||
redis:
|
||||
enabled: false
|
||||
routes:
|
||||
- id: quotes
|
||||
uri: http://localhost:8085
|
||||
predicates:
|
||||
- Path=/quotes/**
|
||||
filters:
|
||||
- TokenRelay=
|
||||
security:
|
||||
oauth2:
|
||||
client:
|
||||
provider:
|
||||
keycloak:
|
||||
issuer-uri: http://localhost:8083/auth/realms/baeldung
|
||||
registration:
|
||||
quotes-client:
|
||||
provider: keycloak
|
||||
client-id: quotes-client
|
||||
client-secret: 0e082231-a70d-48e8-b8a5-fbfb743041b6
|
||||
scope:
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
server:
|
||||
port: 8086
|
||||
spring:
|
||||
security:
|
||||
oauth2:
|
||||
resourceserver:
|
||||
opaquetoken:
|
||||
introspection-uri: http://localhost:8083/auth/realms/baeldung/protocol/openid-connect/token/introspect
|
||||
client-id: quotes-client
|
||||
client-secret: 0e082231-a70d-48e8-b8a5-fbfb743041b6
|
||||
cloud:
|
||||
gateway:
|
||||
redis:
|
||||
enabled: false
|
||||
routes:
|
||||
- id: quotes
|
||||
uri: http://localhost:8085
|
||||
predicates:
|
||||
- Path=/quotes/**
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
spring:
|
||||
cloud:
|
||||
gateway:
|
||||
routes:
|
||||
- id: rewrite_v1
|
||||
uri: ${rewrite.backend.uri:http://example.com}
|
||||
predicates:
|
||||
- Path=/v1/customer/**
|
||||
filters:
|
||||
- RewritePath=/v1/customer/(?<segment>.*),/api/$\{segment}
|
||||
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
logging:
|
||||
level:
|
||||
org.springframework.cloud.gateway: INFO
|
||||
reactor.netty.http.client: INFO
|
||||
|
||||
spring:
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
cloud:
|
||||
gateway:
|
||||
routes:
|
||||
- id: request_header_route
|
||||
uri: https://httpbin.org
|
||||
predicates:
|
||||
- Path=/get/**
|
||||
filters:
|
||||
- AddRequestHeader=My-Header-Good,Good
|
||||
- AddRequestHeader=My-Header-Remove,Remove
|
||||
- AddRequestParameter=var, good
|
||||
- AddRequestParameter=var2, remove
|
||||
- MapRequestHeader=My-Header-Good, My-Header-Bad
|
||||
- MapRequestHeader=My-Header-Set, My-Header-Bad
|
||||
- SetRequestHeader=My-Header-Set, Set
|
||||
- RemoveRequestHeader=My-Header-Remove
|
||||
- RemoveRequestParameter=var2
|
||||
- PreserveHostHeader
|
||||
|
||||
- id: response_header_route
|
||||
uri: https://httpbin.org
|
||||
predicates:
|
||||
- Path=/header/post/**
|
||||
filters:
|
||||
- AddResponseHeader=My-Header-Good,Good
|
||||
- AddResponseHeader=My-Header-Set,Good
|
||||
- AddResponseHeader=My-Header-Rewrite, password=12345678
|
||||
- DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin
|
||||
- AddResponseHeader=My-Header-Remove,Remove
|
||||
- SetResponseHeader=My-Header-Set, Set
|
||||
- RemoveResponseHeader=My-Header-Remove
|
||||
- RewriteResponseHeader=My-Header-Rewrite, password=[^&]+, password=***
|
||||
- RewriteLocationResponseHeader=AS_IN_REQUEST, Location, ,
|
||||
- StripPrefix=1
|
||||
|
||||
- id: path_route
|
||||
uri: https://httpbin.org
|
||||
predicates:
|
||||
- Path=/new/post/**
|
||||
filters:
|
||||
- RewritePath=/new(?<segment>/?.*), $\{segment}
|
||||
- SetPath=/post
|
||||
|
||||
- id: redirect_route
|
||||
uri: https://httpbin.org
|
||||
predicates:
|
||||
- Path=/fake/post/**
|
||||
filters:
|
||||
- RedirectTo=302, https://httpbin.org
|
||||
|
||||
- id: status_route
|
||||
uri: https://httpbin.org
|
||||
predicates:
|
||||
- Path=/delete/**
|
||||
filters:
|
||||
- SetStatus=401
|
||||
|
||||
- id: size_route
|
||||
uri: https://httpbin.org
|
||||
predicates:
|
||||
- Path=/anything
|
||||
filters:
|
||||
- name: RequestSize
|
||||
args:
|
||||
maxSize: 5000000
|
||||
|
||||
- id: retry_test
|
||||
uri: https://httpbin.org
|
||||
predicates:
|
||||
- Path=/status/502
|
||||
filters:
|
||||
- name: Retry
|
||||
args:
|
||||
retries: 3
|
||||
statuses: BAD_GATEWAY
|
||||
methods: GET,POST
|
||||
backoff:
|
||||
firstBackoff: 10ms
|
||||
maxBackoff: 50ms
|
||||
factor: 2
|
||||
basedOnPreviousValue: false
|
||||
|
||||
- id: request_rate_limiter
|
||||
uri: https://httpbin.org
|
||||
predicates:
|
||||
- Path=/redis/get/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- name: RequestRateLimiter
|
||||
args:
|
||||
redis-rate-limiter.replenishRate: 10
|
||||
redis-rate-limiter.burstCapacity: 5
|
||||
key-resolver: "#{@userKeyResolver}"
|
||||
@@ -0,0 +1,4 @@
|
||||
logging:
|
||||
level:
|
||||
org.springframework.cloud.gateway: DEBUG
|
||||
reactor.netty.http.client: DEBUG
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
spring.cloud.gateway.routes[0].id=service_route
|
||||
spring.cloud.gateway.routes[0].uri=http://localhost:8081
|
||||
spring.cloud.gateway.routes[0].predicates[0]=Path=/service/**
|
||||
spring.cloud.gateway.routes[0].filters[0]=RewritePath=/service(?<segment>/?.*), $\{segment}
|
||||
spring.cloud.gateway.routes[0].filters[1]=Logging=My Custom Message, true, true
|
||||
# Or, as an alternative:
|
||||
#spring.cloud.gateway.routes[0].filters[1].name=Logging
|
||||
#spring.cloud.gateway.routes[0].filters[1].args[baseMessage]=My Custom Message
|
||||
#spring.cloud.gateway.routes[0].filters[1].args[preLogger]=true
|
||||
#spring.cloud.gateway.routes[0].filters[1].args[postLogger]=true
|
||||
|
||||
spring.cloud.gateway.routes[0].filters[2]=ModifyResponse
|
||||
spring.cloud.gateway.routes[0].filters[3]=ModifyRequest=en
|
||||
spring.cloud.gateway.routes[0].filters[4]=ChainRequest=http://localhost:8082/resource/language, fr
|
||||
|
||||
management.endpoints.web.exposure.include=*
|
||||
|
||||
server.port=80
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
spring.cloud.gateway.routes[0].id=baeldung_route
|
||||
spring.cloud.gateway.routes[0].uri=http://www.baeldung.com
|
||||
spring.cloud.gateway.routes[0].predicates[0]=Path=/baeldung
|
||||
|
||||
management.endpoints.web.exposure.include=*
|
||||
|
||||
server.port=80
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
server.port=8085
|
||||
# Disable gateway & redis as we don't need them in this application
|
||||
spring.cloud.gateway.enabled=false
|
||||
spring.cloud.gateway.redis.enabled=false
|
||||
|
||||
# Resource server settings
|
||||
spring.security.oauth2.resourceserver.opaquetoken.introspection-uri=http://localhost:8083/auth/realms/baeldung/protocol/openid-connect/token/introspect
|
||||
spring.security.oauth2.resourceserver.opaquetoken.client-id=quotes-client
|
||||
spring.security.oauth2.resourceserver.opaquetoken.client-secret=0e082231-a70d-48e8-b8a5-fbfb743041b6
|
||||
|
||||
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
server.port=8082
|
||||
+1
@@ -0,0 +1 @@
|
||||
server.port=8081
|
||||
Reference in New Issue
Block a user