Skip to content

Commit

Permalink
Issue #5078: Upgrade dependencies
Browse files Browse the repository at this point in the history
- Upgrade calls to deprecated API
  • Loading branch information
reckart committed Dec 7, 2024
1 parent e9e5312 commit ab99d8f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import static org.apache.tomcat.websocket.Constants.WS_AUTHENTICATION_PASSWORD;
import static org.apache.tomcat.websocket.Constants.WS_AUTHENTICATION_USER_NAME;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.security.config.Customizer.withDefaults;
import static org.springframework.security.config.http.SessionCreationPolicy.STATELESS;

import java.io.File;
Expand Down Expand Up @@ -381,12 +382,12 @@ public void render(VDocument aResponse, RenderRequest aRequest)
public SecurityFilterChain wsFilterChain(HttpSecurity aHttp) throws Exception
{
aHttp.securityMatcher(WebsocketConfig.WS_ENDPOINT);
aHttp.authorizeHttpRequests() //
aHttp.authorizeHttpRequests(rules -> rules //
.requestMatchers("/**").authenticated() //
.anyRequest().denyAll();
aHttp.sessionManagement() //
.sessionCreationPolicy(STATELESS);
aHttp.httpBasic();
.anyRequest().denyAll());
aHttp.sessionManagement(session -> session //
.sessionCreationPolicy(STATELESS));
aHttp.httpBasic(withDefaults());
return aHttp.build();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import static org.apache.tomcat.websocket.Constants.WS_AUTHENTICATION_PASSWORD;
import static org.apache.tomcat.websocket.Constants.WS_AUTHENTICATION_USER_NAME;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.security.config.Customizer.withDefaults;
import static org.springframework.security.config.http.SessionCreationPolicy.STATELESS;

import java.io.File;
Expand Down Expand Up @@ -309,12 +310,12 @@ public DaoAuthenticationProvider internalAuthenticationProvider(PasswordEncoder
public SecurityFilterChain wsFilterChain(HttpSecurity aHttp) throws Exception
{
aHttp.securityMatcher(WebsocketConfig.WS_ENDPOINT);
aHttp.authorizeHttpRequests() //
aHttp.authorizeHttpRequests(rules -> rules //
.requestMatchers("/**").authenticated() //
.anyRequest().denyAll();
aHttp.sessionManagement() //
.sessionCreationPolicy(STATELESS);
aHttp.httpBasic();
.anyRequest().denyAll());
aHttp.sessionManagement(session -> session //
.sessionCreationPolicy(STATELESS));
aHttp.httpBasic(withDefaults());
return aHttp.build();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import static org.apache.tomcat.websocket.Constants.WS_AUTHENTICATION_USER_NAME;
import static org.assertj.core.api.Assertions.assertThat;
import static org.slf4j.LoggerFactory.getLogger;
import static org.springframework.security.config.Customizer.withDefaults;
import static org.springframework.security.config.http.SessionCreationPolicy.STATELESS;

import java.io.File;
Expand Down Expand Up @@ -363,12 +364,12 @@ public DaoAuthenticationProvider internalAuthenticationProvider(PasswordEncoder
public SecurityFilterChain wsFilterChain(HttpSecurity aHttp) throws Exception
{
aHttp.securityMatcher(WebsocketConfig.WS_ENDPOINT);
aHttp.authorizeHttpRequests() //
aHttp.authorizeHttpRequests(rules -> rules //
.requestMatchers("/**").authenticated() //
.anyRequest().denyAll();
aHttp.sessionManagement() //
.sessionCreationPolicy(STATELESS);
aHttp.httpBasic();
.anyRequest().denyAll());
aHttp.sessionManagement(session -> session //
.sessionCreationPolicy(STATELESS));
aHttp.httpBasic(withDefaults());
return aHttp.build();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public class InceptionSecurityActuatorAutoConfiguration
public SecurityFilterChain actuatorFilterChain(HttpSecurity aHttp) throws Exception
{
aHttp.securityMatcher(BASE_URL + "/**");
aHttp.authorizeHttpRequests() //
aHttp.authorizeHttpRequests(rules -> rules //
.requestMatchers(BASE_URL + "/health").permitAll() //
.anyRequest().denyAll();
aHttp.sessionManagement() //
.sessionCreationPolicy(STATELESS);
.anyRequest().denyAll());
aHttp.sessionManagement(rules -> rules //
.sessionCreationPolicy(STATELESS));
return aHttp.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ public SecurityFilterChain uiViewFilterChain(HttpSecurity aHttp, CspProperties a

aHttp.securityMatcher(BASE_VIEW_URL + "/**");
// Views render data that we generally want to display in an IFrame on the editor page
aHttp.headers() //
.frameOptions().sameOrigin()//
aHttp.headers(headers -> headers //
.frameOptions(options -> options //
.sameOrigin()) //
.contentSecurityPolicy(csp -> {
csp.policyDirectives(join(";", //
"default-src 'none'", //
Expand All @@ -86,7 +87,7 @@ public SecurityFilterChain uiViewFilterChain(HttpSecurity aHttp, CspProperties a
"child-src 'self'", //
"base-uri 'self'", //
"frame-src 'self' 'self'"));
});
}));
commonConfiguration(aHttp);
return aHttp.build();
}
Expand All @@ -108,6 +109,5 @@ private void commonConfiguration(HttpSecurity aHttp) throws Exception
new Http403ForbiddenEntryPoint(), //
new AntPathRequestMatcher("/**"));
});

}
}

0 comments on commit ab99d8f

Please sign in to comment.