Polish HttpSecurity
This commit is contained in:
parent
984355e637
commit
99f768bab9
|
@ -408,23 +408,23 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* public class CsrfSecurityConfig {
|
* public class CsrfSecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||||
* http
|
* http
|
||||||
* .headers()
|
* .headers()
|
||||||
* .contentTypeOptions()
|
* .contentTypeOptions()
|
||||||
* .and()
|
* .and()
|
||||||
* .xssProtection()
|
* .xssProtection()
|
||||||
* .and()
|
* .and()
|
||||||
* .cacheControl()
|
* .cacheControl()
|
||||||
* .and()
|
* .and()
|
||||||
* .httpStrictTransportSecurity()
|
* .httpStrictTransportSecurity()
|
||||||
* .and()
|
* .and()
|
||||||
* .frameOptions()
|
* .frameOptions()
|
||||||
* .and()
|
* .and()
|
||||||
* ...;
|
* ...;
|
||||||
* return http.build();
|
* return http.build();
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -435,13 +435,13 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* public class CsrfSecurityConfig {
|
* public class CsrfSecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||||
* http
|
* http
|
||||||
* .headers().disable()
|
* .headers().disable()
|
||||||
* ...;
|
* ...;
|
||||||
* return http.build();
|
* return http.build();
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -456,18 +456,18 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* public class CsrfSecurityConfig {
|
* public class CsrfSecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||||
* http
|
* http
|
||||||
* .headers()
|
* .headers()
|
||||||
* .defaultsDisabled()
|
* .defaultsDisabled()
|
||||||
* .cacheControl()
|
* .cacheControl()
|
||||||
* .and()
|
* .and()
|
||||||
* .frameOptions()
|
* .frameOptions()
|
||||||
* .and()
|
* .and()
|
||||||
* ...;
|
* ...;
|
||||||
* return http.build();
|
* return http.build();
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -480,16 +480,16 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* public class CsrfSecurityConfig {
|
* public class CsrfSecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||||
* http
|
* http
|
||||||
* .headers()
|
* .headers()
|
||||||
* .frameOptions()
|
* .frameOptions()
|
||||||
* .disable()
|
* .disable()
|
||||||
* .and()
|
* .and()
|
||||||
* ...;
|
* ...;
|
||||||
* return http.build();
|
* return http.build();
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
* @return the {@link HeadersConfigurer} for further customizations
|
* @return the {@link HeadersConfigurer} for further customizations
|
||||||
|
@ -625,12 +625,12 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* public class CorsSecurityConfig {
|
* public class CorsSecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||||
* http
|
* http
|
||||||
* .cors(withDefaults());
|
* .cors(withDefaults());
|
||||||
* return http.build();
|
* return http.build();
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
* @param corsCustomizer the {@link Customizer} to provide more options for the
|
* @param corsCustomizer the {@link Customizer} to provide more options for the
|
||||||
|
@ -1836,13 +1836,13 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* public class CsrfSecurityConfig {
|
* public class CsrfSecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||||
* http
|
* http
|
||||||
* .csrf().disable()
|
* .csrf().disable()
|
||||||
* ...;
|
* ...;
|
||||||
* return http.build();
|
* return http.build();
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
* @return the {@link CsrfConfigurer} for further customizations
|
* @return the {@link CsrfConfigurer} for further customizations
|
||||||
|
@ -1862,12 +1862,12 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* public class CsrfSecurityConfig {
|
* public class CsrfSecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||||
* http
|
* http
|
||||||
* .csrf((csrf) -> csrf.disable());
|
* .csrf((csrf) -> csrf.disable());
|
||||||
* return http.build();
|
* return http.build();
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
* @param csrfCustomizer the {@link Customizer} to provide more options for the
|
* @param csrfCustomizer the {@link Customizer} to provide more options for the
|
||||||
|
|
Loading…
Reference in New Issue