-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRouteConfig.java
More file actions
39 lines (33 loc) · 1.48 KB
/
RouteConfig.java
File metadata and controls
39 lines (33 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package gateway.config;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
//@Configuration
public class RouteConfig {
// protected ScorpionAuthenticationConfig authConfig;
// @Autowired
// public RouteConfig(ScorpionAuthenticationConfig authConfig) {
// this.authConfig = authConfig;
// }
/**
* Scorpion Routes
* @param builder
* @return
*/
// @Bean
public RouteLocator routes(RouteLocatorBuilder builder) {
return builder.routes()
// Code version of the Gateway filter in the application.yml file keeping this around for reference.
// .route("remote01",
// r -> r.path("/remote01/**").filters(
// f -> f
// // Apply the JWT Authentication
// .filter(new JwtAuthGatewayFilterFactory()
// .apply(c -> c.setHeaderKey(authConfig.getJwt().getHeaderKey()).setIsEnabled("true")))
// // Strip the service name because we don't need it on the other end.
// .filter(new StripPrefixGatewayFilterFactory()
// .apply(c -> c.setParts(1)))
// )
// .uri("lb://remote01"))
.build();
}
}