ISSUE-43: Attempting to fix Hithomelabs/HomeLabDocker#43 disbling server side csrf check
All checks were successful
sample gradle build and test / build (pull_request) Successful in 1m35s
All checks were successful
sample gradle build and test / build (pull_request) Successful in 1m35s
This commit is contained in:
parent
fb4ff60729
commit
c8e8817e25
@ -11,12 +11,12 @@ import java.util.ArrayList;
|
|||||||
@Configuration
|
@Configuration
|
||||||
public class OpenApiConfig {
|
public class OpenApiConfig {
|
||||||
|
|
||||||
@Value("${api.corsResolveUrl}")
|
@Value("${api.baseUrl}")
|
||||||
private String corsResolveUrl;
|
private String baseUrl;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public OpenAPI openAPI(){
|
public OpenAPI openAPI(){
|
||||||
Server httpsServer = new Server().url(corsResolveUrl);
|
Server httpsServer = new Server().url(baseUrl);
|
||||||
OpenAPI openApi = new OpenAPI();
|
OpenAPI openApi = new OpenAPI();
|
||||||
ArrayList<Server> servers = new ArrayList<>();
|
ArrayList<Server> servers = new ArrayList<>();
|
||||||
servers.add(httpsServer);
|
servers.add(httpsServer);
|
||||||
|
|||||||
@ -29,8 +29,9 @@ public class SecuirtyConfig {
|
|||||||
http
|
http
|
||||||
.authorizeHttpRequests(auth -> auth
|
.authorizeHttpRequests(auth -> auth
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
)
|
).csrf(csrf -> csrf.disable())
|
||||||
.with(new OAuth2LoginConfigurer<>(), oauth2 -> oauth2.userInfoEndpoint(u -> u.oidcUserService(customOidcUserConfiguration)));
|
.with(new OAuth2LoginConfigurer<>(),
|
||||||
|
oauth2 -> oauth2.userInfoEndpoint(u -> u.oidcUserService(customOidcUserConfiguration)));
|
||||||
|
|
||||||
|
|
||||||
return http.build();
|
return http.build();
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
api.corsResolveUrl=http://localhost:8080
|
api.baseUrl=http://localhost:8080
|
||||||
@ -1 +1 @@
|
|||||||
api.corsResolveUrl=https://cftunnels.hithomelabs.com
|
api.baseUrl=https://cftunnels.hithomelabs.com
|
||||||
@ -1 +1 @@
|
|||||||
api.corsResolveUrl=https://testcf.hithomelabs.com
|
api.baseUrl=https://testcf.hithomelabs.com
|
||||||
@ -4,6 +4,12 @@ cloudflare.apiKey=${CLOUDFLARE_API_KEY}
|
|||||||
cloudflare.email=${CLOUDFLARE_EMAIL}
|
cloudflare.email=${CLOUDFLARE_EMAIL}
|
||||||
spring.profiles.active=${ENV}
|
spring.profiles.active=${ENV}
|
||||||
|
|
||||||
|
# set root level
|
||||||
|
logging.level.root=INFO
|
||||||
|
# package-specific
|
||||||
|
logging.level.org.springframework=TRACE
|
||||||
|
logging.level.com.myapp=INFO
|
||||||
|
|
||||||
/ * * Masking sure app works behind a reverse proxy
|
/ * * Masking sure app works behind a reverse proxy
|
||||||
server.forward-headers-strategy=framework
|
server.forward-headers-strategy=framework
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user