Skip to content

Commit

Permalink
Polish HttpSecurity
Browse files Browse the repository at this point in the history
  • Loading branch information
sjohnr committed Jul 29, 2022
1 parent 0c0c75c commit 15f525c
Showing 1 changed file with 65 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,23 +186,23 @@ private ApplicationContext getContext() {
* @EnableWebSecurity
* public class CsrfSecurityConfig {
*
* @Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .headers()
* .contentTypeOptions()
* .and()
* .xssProtection()
* .and()
* .cacheControl()
* .and()
* .httpStrictTransportSecurity()
* .and()
* .frameOptions()
* .and()
* ...;
* return http.build();
* }
* @Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .headers()
* .contentTypeOptions()
* .and()
* .xssProtection()
* .and()
* .cacheControl()
* .and()
* .httpStrictTransportSecurity()
* .and()
* .frameOptions()
* .and()
* ...;
* return http.build();
* }
* }
* </pre>
*
Expand All @@ -213,13 +213,13 @@ private ApplicationContext getContext() {
* &#064;EnableWebSecurity
* public class CsrfSecurityConfig {
*
* &#064;Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .headers().disable()
* ...;
* return http.build();
* }
* &#064;Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .headers().disable()
* ...;
* return http.build();
* }
* }
* </pre>
*
Expand All @@ -234,18 +234,18 @@ private ApplicationContext getContext() {
* &#064;EnableWebSecurity
* public class CsrfSecurityConfig {
*
* &#064;Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .headers()
* .defaultsDisabled()
* .cacheControl()
* .and()
* .frameOptions()
* .and()
* ...;
* return http.build();
* }
* &#064;Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .headers()
* .defaultsDisabled()
* .cacheControl()
* .and()
* .frameOptions()
* .and()
* ...;
* return http.build();
* }
* }
* </pre>
*
Expand All @@ -258,16 +258,16 @@ private ApplicationContext getContext() {
* &#064;EnableWebSecurity
* public class CsrfSecurityConfig {
*
* &#064;Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .headers()
* .frameOptions()
* .disable()
* .and()
* ...;
* return http.build();
* }
* &#064;Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .headers()
* .frameOptions()
* .disable()
* .and()
* ...;
* return http.build();
* }
* }
* </pre>
* @return the {@link HeadersConfigurer} for further customizations
Expand Down Expand Up @@ -403,12 +403,12 @@ public CorsConfigurer<HttpSecurity> cors() throws Exception {
* &#064;EnableWebSecurity
* public class CorsSecurityConfig {
*
* &#064;Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .cors(withDefaults());
* return http.build();
* }
* &#064;Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .cors(withDefaults());
* return http.build();
* }
* }
* </pre>
* @param corsCustomizer the {@link Customizer} to provide more options for the
Expand Down Expand Up @@ -1614,13 +1614,13 @@ public HttpSecurity servletApi(Customizer<ServletApiConfigurer<HttpSecurity>> se
* &#064;EnableWebSecurity
* public class CsrfSecurityConfig {
*
* &#064;Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .csrf().disable()
* ...;
* return http.build();
* }
* &#064;Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .csrf().disable()
* ...;
* return http.build();
* }
* }
* </pre>
* @return the {@link CsrfConfigurer} for further customizations
Expand All @@ -1640,12 +1640,12 @@ public CsrfConfigurer<HttpSecurity> csrf() throws Exception {
* &#064;EnableWebSecurity
* public class CsrfSecurityConfig {
*
* &#064;Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .csrf((csrf) -&gt; csrf.disable());
* return http.build();
* }
* &#064;Bean
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
* http
* .csrf((csrf) -&gt; csrf.disable());
* return http.build();
* }
* }
* </pre>
* @param csrfCustomizer the {@link Customizer} to provide more options for the
Expand Down

0 comments on commit 15f525c

Please sign in to comment.