Replace < and > with < and > in Javadoc
Closes gh-9847
This commit is contained in:
parent
20751d2063
commit
204a32aba8
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2019 the original author or authors.
|
||||
* Copyright 2019-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -60,7 +60,7 @@ import org.springframework.security.rsocket.util.matcher.RoutePayloadExchangeMat
|
|||
* @Bean
|
||||
* PayloadSocketAcceptorInterceptor rsocketInterceptor(RSocketSecurity rsocket) {
|
||||
* rsocket
|
||||
* .authorizePayload((authorize) ->
|
||||
* .authorizePayload((authorize) ->
|
||||
* authorize
|
||||
* .anyRequest().authenticated()
|
||||
* );
|
||||
|
@ -87,7 +87,7 @@ import org.springframework.security.rsocket.util.matcher.RoutePayloadExchangeMat
|
|||
* @Bean
|
||||
* PayloadSocketAcceptorInterceptor rsocketInterceptor(RSocketSecurity rsocket) {
|
||||
* rsocket
|
||||
* .authorizePayload((authorize) ->
|
||||
* .authorizePayload((authorize) ->
|
||||
* authorize
|
||||
* // must have ROLE_SETUP to make connection
|
||||
* .setup().hasRole("SETUP")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -269,11 +269,11 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
* .openidLogin((openidLogin) ->
|
||||
* .openidLogin((openidLogin) ->
|
||||
* openidLogin
|
||||
* .permitAll()
|
||||
* );
|
||||
|
@ -302,48 +302,48 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
*
|
||||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http.authorizeRequests((authorizeRequests) ->
|
||||
* http.authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
* .openidLogin((openidLogin) ->
|
||||
* .openidLogin((openidLogin) ->
|
||||
* openidLogin
|
||||
* .loginPage("/login")
|
||||
* .permitAll()
|
||||
* .authenticationUserDetailsService(
|
||||
* new AutoProvisioningUserDetailsService())
|
||||
* .attributeExchange((googleExchange) ->
|
||||
* .attributeExchange((googleExchange) ->
|
||||
* googleExchange
|
||||
* .identifierPattern("https://www.google.com/.*")
|
||||
* .attribute((emailAttribute) ->
|
||||
* .attribute((emailAttribute) ->
|
||||
* emailAttribute
|
||||
* .name("email")
|
||||
* .type("https://axschema.org/contact/email")
|
||||
* .required(true)
|
||||
* )
|
||||
* .attribute((firstnameAttribute) ->
|
||||
* .attribute((firstnameAttribute) ->
|
||||
* firstnameAttribute
|
||||
* .name("firstname")
|
||||
* .type("https://axschema.org/namePerson/first")
|
||||
* .required(true)
|
||||
* )
|
||||
* .attribute((lastnameAttribute) ->
|
||||
* .attribute((lastnameAttribute) ->
|
||||
* lastnameAttribute
|
||||
* .name("lastname")
|
||||
* .type("https://axschema.org/namePerson/last")
|
||||
* .required(true)
|
||||
* )
|
||||
* )
|
||||
* .attributeExchange((yahooExchange) ->
|
||||
* .attributeExchange((yahooExchange) ->
|
||||
* yahooExchange
|
||||
* .identifierPattern(".*yahoo.com.*")
|
||||
* .attribute((emailAttribute) ->
|
||||
* .attribute((emailAttribute) ->
|
||||
* emailAttribute
|
||||
* .name("email")
|
||||
* .type("https://schema.openid.net/contact/email")
|
||||
* .required(true)
|
||||
* )
|
||||
* .attribute((fullnameAttribute) ->
|
||||
* .attribute((fullnameAttribute) ->
|
||||
* fullnameAttribute
|
||||
* .name("fullname")
|
||||
* .type("https://axschema.org/namePerson")
|
||||
|
@ -497,7 +497,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .headers((headers) ->
|
||||
* .headers((headers) ->
|
||||
* headers
|
||||
* .contentTypeOptions(withDefaults())
|
||||
* .xssProtection(withDefaults())
|
||||
|
@ -519,7 +519,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .headers((headers) -> headers.disable());
|
||||
* .headers((headers) -> headers.disable());
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
|
@ -538,7 +538,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .headers((headers) ->
|
||||
* .headers((headers) ->
|
||||
* headers
|
||||
* .defaultsDisabled()
|
||||
* .cacheControl(withDefaults())
|
||||
|
@ -560,9 +560,9 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .headers((headers) ->
|
||||
* .headers((headers) ->
|
||||
* headers
|
||||
* .frameOptions((frameOptions) -> frameOptions.disable())
|
||||
* .frameOptions((frameOptions) -> frameOptions.disable())
|
||||
* );
|
||||
* }
|
||||
* </pre>
|
||||
|
@ -686,17 +686,17 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .anyRequest().hasRole("USER")
|
||||
* )
|
||||
* .formLogin((formLogin) ->
|
||||
* .formLogin((formLogin) ->
|
||||
* formLogin
|
||||
* .permitAll()
|
||||
* )
|
||||
* .sessionManagement((sessionManagement) ->
|
||||
* .sessionManagement((sessionManagement) ->
|
||||
* sessionManagement
|
||||
* .sessionConcurrency((sessionConcurrency) ->
|
||||
* .sessionConcurrency((sessionConcurrency) ->
|
||||
* sessionConcurrency
|
||||
* .maximumSessions(1)
|
||||
* .expiredUrl("/login?expired")
|
||||
|
@ -797,11 +797,11 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .requiresChannel((requiresChannel) ->
|
||||
* .requiresChannel((requiresChannel) ->
|
||||
* requiresChannel
|
||||
* .anyRequest().requiresSecure()
|
||||
* )
|
||||
* .portMapper((portMapper) ->
|
||||
* .portMapper((portMapper) ->
|
||||
* portMapper
|
||||
* .http(9090).mapsTo(9443)
|
||||
* .http(80).mapsTo(443)
|
||||
|
@ -910,11 +910,11 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
* .jee((jee) ->
|
||||
* .jee((jee) ->
|
||||
* jee
|
||||
* .mappableRoles("USER", "ADMIN")
|
||||
* );
|
||||
|
@ -1018,7 +1018,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
|
@ -1090,7 +1090,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
|
@ -1197,7 +1197,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
|
@ -1218,7 +1218,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/admin/**").hasRole("ADMIN")
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
|
@ -1240,7 +1240,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* .antMatchers("/admin/**").hasRole("ADMIN")
|
||||
|
@ -1281,7 +1281,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeHttpRequests((authorizeHttpRequests) ->
|
||||
* .authorizeHttpRequests((authorizeHttpRequests) ->
|
||||
* authorizeHttpRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
|
@ -1302,7 +1302,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeHttpRequests((authorizeHttpRequests) ->
|
||||
* .authorizeHttpRequests((authorizeHttpRequests) ->
|
||||
* authorizeHttpRequests
|
||||
* .antMatchers("/admin/**").hasRole("ADMIN")
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
|
@ -1324,7 +1324,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeHttpRequests((authorizeHttpRequests) ->
|
||||
* .authorizeHttpRequests((authorizeHttpRequests) ->
|
||||
* authorizeHttpRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* .antMatchers("/admin/**").hasRole("ADMIN")
|
||||
|
@ -1380,11 +1380,11 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
* .requestCache((requestCache) ->
|
||||
* .requestCache((requestCache) ->
|
||||
* requestCache.disable()
|
||||
* );
|
||||
* }
|
||||
|
@ -1428,12 +1428,12 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
* // sample exception handling customization
|
||||
* .exceptionHandling((exceptionHandling) ->
|
||||
* .exceptionHandling((exceptionHandling) ->
|
||||
* exceptionHandling
|
||||
* .accessDeniedPage("/errors/access-denied")
|
||||
* );
|
||||
|
@ -1477,7 +1477,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .securityContext((securityContext) ->
|
||||
* .securityContext((securityContext) ->
|
||||
* securityContext
|
||||
* .securityContextRepository(SCR)
|
||||
* );
|
||||
|
@ -1519,7 +1519,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .servletApi((servletApi) ->
|
||||
* .servletApi((servletApi) ->
|
||||
* servletApi.disable()
|
||||
* );
|
||||
* }
|
||||
|
@ -1575,7 +1575,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .csrf((csrf) -> csrf.disable());
|
||||
* .csrf((csrf) -> csrf.disable());
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
|
@ -1651,13 +1651,13 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
* .formLogin(withDefaults())
|
||||
* // sample logout customization
|
||||
* .logout((logout) ->
|
||||
* .logout((logout) ->
|
||||
* logout.deleteCookies("remove")
|
||||
* .invalidateHttpSession(false)
|
||||
* .logoutUrl("/custom-logout")
|
||||
|
@ -1766,13 +1766,13 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
* .formLogin(withDefaults())
|
||||
* // sample anonymous customization
|
||||
* .anonymous((anonymous) ->
|
||||
* .anonymous((anonymous) ->
|
||||
* anonymous
|
||||
* .authorities("ROLE_ANON")
|
||||
* )
|
||||
|
@ -1792,13 +1792,13 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
* .formLogin(withDefaults())
|
||||
* // sample anonymous customization
|
||||
* .anonymous((anonymous) ->
|
||||
* .anonymous((anonymous) ->
|
||||
* anonymous.disable()
|
||||
* );
|
||||
* }
|
||||
|
@ -1901,7 +1901,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
|
@ -1920,11 +1920,11 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
* .formLogin((formLogin) ->
|
||||
* .formLogin((formLogin) ->
|
||||
* formLogin
|
||||
* .usernameParameter("username")
|
||||
* .passwordParameter("password")
|
||||
|
@ -2278,7 +2278,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .anyRequest().authenticated()
|
||||
* )
|
||||
|
@ -2362,7 +2362,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .anyRequest().authenticated()
|
||||
* )
|
||||
|
@ -2419,13 +2419,13 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .anyRequest().authenticated()
|
||||
* )
|
||||
* .oauth2ResourceServer((oauth2ResourceServer) ->
|
||||
* .oauth2ResourceServer((oauth2ResourceServer) ->
|
||||
* oauth2ResourceServer
|
||||
* .jwt((jwt) ->
|
||||
* .jwt((jwt) ->
|
||||
* jwt
|
||||
* .decoder(jwtDecoder())
|
||||
* )
|
||||
|
@ -2512,12 +2512,12 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
* .formLogin(withDefaults())
|
||||
* .requiresChannel((requiresChannel) ->
|
||||
* .requiresChannel((requiresChannel) ->
|
||||
* requiresChannel
|
||||
* .anyRequest().requiresSecure()
|
||||
* );
|
||||
|
@ -2586,7 +2586,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
|
@ -2828,11 +2828,11 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .requestMatchers((requestMatchers) ->
|
||||
* .requestMatchers((requestMatchers) ->
|
||||
* requestMatchers
|
||||
* .antMatchers("/api/**", "/oauth/**")
|
||||
* )
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
|
@ -2851,12 +2851,12 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .requestMatchers((requestMatchers) ->
|
||||
* .requestMatchers((requestMatchers) ->
|
||||
* requestMatchers
|
||||
* .antMatchers("/api/**")
|
||||
* .antMatchers("/oauth/**")
|
||||
* )
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
|
@ -2875,15 +2875,15 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @Override
|
||||
* protected void configure(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .requestMatchers((requestMatchers) ->
|
||||
* .requestMatchers((requestMatchers) ->
|
||||
* requestMatchers
|
||||
* .antMatchers("/api/**")
|
||||
* )
|
||||
* .requestMatchers((requestMatchers) ->
|
||||
* .requestMatchers((requestMatchers) ->
|
||||
* requestMatchers
|
||||
* .antMatchers("/oauth/**")
|
||||
* )
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* .authorizeRequests((authorizeRequests) ->
|
||||
* authorizeRequests
|
||||
* .antMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -29,7 +29,7 @@ import org.springframework.security.config.annotation.web.builders.WebSecurity;
|
|||
* <pre>
|
||||
* @Bean
|
||||
* public WebSecurityCustomizer ignoringCustomizer() {
|
||||
* return (web) -> web.ignoring().antMatchers("/ignore1", "/ignore2");
|
||||
* return (web) -> web.ignoring().antMatchers("/ignore1", "/ignore2");
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -170,7 +170,7 @@ public final class CsrfConfigurer<H extends HttpSecurityBuilder<H>>
|
|||
* <pre>
|
||||
* http
|
||||
* .csrf()
|
||||
* .ignoringRequestMatchers((request) -> "XMLHttpRequest".equals(request.getHeader("X-Requested-With")))
|
||||
* .ignoringRequestMatchers((request) -> "XMLHttpRequest".equals(request.getHeader("X-Requested-With")))
|
||||
* .and()
|
||||
* ...
|
||||
* </pre>
|
||||
|
|
|
@ -398,7 +398,7 @@ public class ServerHttpSecurity {
|
|||
* http
|
||||
* // ...
|
||||
* .redirectToHttps()
|
||||
* .httpsRedirectWhen((serverWebExchange) ->
|
||||
* .httpsRedirectWhen((serverWebExchange) ->
|
||||
* serverWebExchange.getRequest().getHeaders().containsKey("X-Requires-Https"))
|
||||
* return http.build();
|
||||
* }
|
||||
|
@ -433,9 +433,9 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .redirectToHttps((redirectToHttps) ->
|
||||
* .redirectToHttps((redirectToHttps) ->
|
||||
* redirectToHttps
|
||||
* .httpsRedirectWhen((serverWebExchange) ->
|
||||
* .httpsRedirectWhen((serverWebExchange) ->
|
||||
* serverWebExchange.getRequest().getHeaders().containsKey("X-Requires-Https"))
|
||||
* );
|
||||
* return http.build();
|
||||
|
@ -503,7 +503,7 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .csrf((csrf) ->
|
||||
* .csrf((csrf) ->
|
||||
* csrf.disabled()
|
||||
* );
|
||||
* return http.build();
|
||||
|
@ -518,7 +518,7 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .csrf((csrf) ->
|
||||
* .csrf((csrf) ->
|
||||
* csrf
|
||||
* // Handle CSRF failures
|
||||
* .accessDeniedHandler(accessDeniedHandler)
|
||||
|
@ -609,7 +609,7 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .anonymous((anonymous) ->
|
||||
* .anonymous((anonymous) ->
|
||||
* anonymous
|
||||
* .key("key")
|
||||
* .authorities("ROLE_ANONYMOUS")
|
||||
|
@ -662,7 +662,7 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .httpBasic((httpBasic) ->
|
||||
* .httpBasic((httpBasic) ->
|
||||
* httpBasic
|
||||
* // used for authenticating the credentials
|
||||
* .authenticationManager(authenticationManager)
|
||||
|
@ -721,7 +721,7 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .formLogin((formLogin) ->
|
||||
* .formLogin((formLogin) ->
|
||||
* formLogin
|
||||
* // used for authenticating the credentials
|
||||
* .authenticationManager(authenticationManager)
|
||||
|
@ -783,7 +783,7 @@ public class ServerHttpSecurity {
|
|||
* @Bean
|
||||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* .x509((x509) ->
|
||||
* .x509((x509) ->
|
||||
* x509
|
||||
* .authenticationManager(authenticationManager)
|
||||
* .principalExtractor(principalExtractor)
|
||||
|
@ -841,7 +841,7 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .oauth2Login((oauth2Login) ->
|
||||
* .oauth2Login((oauth2Login) ->
|
||||
* oauth2Login
|
||||
* .authenticationConverter(authenticationConverter)
|
||||
* .authenticationManager(manager)
|
||||
|
@ -892,7 +892,7 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .oauth2Client((oauth2Client) ->
|
||||
* .oauth2Client((oauth2Client) ->
|
||||
* oauth2Client
|
||||
* .clientRegistrationRepository(clientRegistrationRepository)
|
||||
* .authorizedClientRepository(authorizedClientRepository)
|
||||
|
@ -943,9 +943,9 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .oauth2ResourceServer((oauth2ResourceServer) ->
|
||||
* .oauth2ResourceServer((oauth2ResourceServer) ->
|
||||
* oauth2ResourceServer
|
||||
* .jwt((jwt) ->
|
||||
* .jwt((jwt) ->
|
||||
* jwt
|
||||
* .publicKey(publicKey())
|
||||
* )
|
||||
|
@ -1029,15 +1029,15 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .headers((headers) ->
|
||||
* .headers((headers) ->
|
||||
* headers
|
||||
* // customize frame options to be same origin
|
||||
* .frameOptions((frameOptions) ->
|
||||
* .frameOptions((frameOptions) ->
|
||||
* frameOptions
|
||||
* .mode(XFrameOptionsServerHttpHeadersWriter.Mode.SAMEORIGIN)
|
||||
* )
|
||||
* // disable cache control
|
||||
* .cache((cache) ->
|
||||
* .cache((cache) ->
|
||||
* cache
|
||||
* .disable()
|
||||
* )
|
||||
|
@ -1090,7 +1090,7 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .exceptionHandling((exceptionHandling) ->
|
||||
* .exceptionHandling((exceptionHandling) ->
|
||||
* exceptionHandling
|
||||
* // customize how to request for authentication
|
||||
* .authenticationEntryPoint(entryPoint)
|
||||
|
@ -1125,10 +1125,10 @@ public class ServerHttpSecurity {
|
|||
* .pathMatchers(HttpMethod.POST, "/users").hasAuthority("USER_POST")
|
||||
* // a request to /users/{username} requires the current authentication's username
|
||||
* // to be equal to the {username}
|
||||
* .pathMatchers("/users/{username}").access((authentication, context) ->
|
||||
* .pathMatchers("/users/{username}").access((authentication, context) ->
|
||||
* authentication
|
||||
* .map(Authentication::getName)
|
||||
* .map((username) -> username.equals(context.getVariables().get("username")))
|
||||
* .map((username) -> username.equals(context.getVariables().get("username")))
|
||||
* .map(AuthorizationDecision::new)
|
||||
* )
|
||||
* // allows providing a custom matching strategy that requires the role "ROLE_CUSTOM"
|
||||
|
@ -1155,7 +1155,7 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .authorizeExchange((exchanges) ->
|
||||
* .authorizeExchange((exchanges) ->
|
||||
* exchanges
|
||||
* // any URL that starts with /admin/ requires the role "ROLE_ADMIN"
|
||||
* .pathMatchers("/admin/**").hasRole("ADMIN")
|
||||
|
@ -1163,10 +1163,10 @@ public class ServerHttpSecurity {
|
|||
* .pathMatchers(HttpMethod.POST, "/users").hasAuthority("USER_POST")
|
||||
* // a request to /users/{username} requires the current authentication's username
|
||||
* // to be equal to the {username}
|
||||
* .pathMatchers("/users/{username}").access((authentication, context) ->
|
||||
* .pathMatchers("/users/{username}").access((authentication, context) ->
|
||||
* authentication
|
||||
* .map(Authentication::getName)
|
||||
* .map((username) -> username.equals(context.getVariables().get("username")))
|
||||
* .map((username) -> username.equals(context.getVariables().get("username")))
|
||||
* .map(AuthorizationDecision::new)
|
||||
* )
|
||||
* // allows providing a custom matching strategy that requires the role "ROLE_CUSTOM"
|
||||
|
@ -1224,7 +1224,7 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .logout((logout) ->
|
||||
* .logout((logout) ->
|
||||
* logout
|
||||
* // configures how log out is done
|
||||
* .logoutHandler(logoutHandler)
|
||||
|
@ -1280,7 +1280,7 @@ public class ServerHttpSecurity {
|
|||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* // ...
|
||||
* .requestCache((requestCache) ->
|
||||
* .requestCache((requestCache) ->
|
||||
* requestCache
|
||||
* // configures how the request is cached
|
||||
* .requestCache(customRequestCache)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -31,7 +31,7 @@ import java.util.Map;
|
|||
*
|
||||
* <pre>
|
||||
* String idForEncode = "bcrypt";
|
||||
* Map<String,PasswordEncoder> encoders = new HashMap<>();
|
||||
* Map<String,PasswordEncoder> encoders = new HashMap<>();
|
||||
* encoders.put(idForEncode, new BCryptPasswordEncoder());
|
||||
* encoders.put("noop", NoOpPasswordEncoder.getInstance());
|
||||
* encoders.put("pbkdf2", new Pbkdf2PasswordEncoder());
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -99,7 +99,7 @@ public final class JwtIssuerReactiveAuthenticationManagerResolver
|
|||
* authenticationManagers.put("https://issuerOne.example.org", managerOne);
|
||||
* authenticationManagers.put("https://issuerTwo.example.org", managerTwo);
|
||||
* JwtIssuerReactiveAuthenticationManagerResolver resolver = new JwtIssuerReactiveAuthenticationManagerResolver
|
||||
* ((issuer) -> Mono.justOrEmpty(authenticationManagers.get(issuer));
|
||||
* ((issuer) -> Mono.justOrEmpty(authenticationManagers.get(issuer));
|
||||
* </pre>
|
||||
*
|
||||
* The keys in the {@link Map} are the trusted issuers.
|
||||
|
|
Loading…
Reference in New Issue