Remove compiler warnings for spring-security-config
Signed-off-by: 023-dev <0_2_3@naver.com>
This commit is contained in:
@@ -8,3 +8,4 @@ tasks.withType(JavaCompile) {
|
|||||||
tasks.withType(KotlinCompile) {
|
tasks.withType(KotlinCompile) {
|
||||||
kotlinOptions.allWarningsAsErrors = true
|
kotlinOptions.allWarningsAsErrors = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ apply plugin: 'io.spring.convention.spring-module'
|
|||||||
apply plugin: 'trang'
|
apply plugin: 'trang'
|
||||||
apply plugin: 'security-kotlin'
|
apply plugin: 'security-kotlin'
|
||||||
apply plugin: 'test-compile-target-jdk25'
|
apply plugin: 'test-compile-target-jdk25'
|
||||||
|
apply plugin: 'compile-warnings-error'
|
||||||
apply plugin: 'javadoc-warnings-error'
|
apply plugin: 'javadoc-warnings-error'
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
|
|||||||
+8
-4
@@ -521,8 +521,10 @@ public final class OAuth2ResourceServerConfigurer<H extends HttpSecurityBuilder<
|
|||||||
public OpaqueTokenConfigurer introspectionUri(String introspectionUri) {
|
public OpaqueTokenConfigurer introspectionUri(String introspectionUri) {
|
||||||
Assert.notNull(introspectionUri, "introspectionUri cannot be null");
|
Assert.notNull(introspectionUri, "introspectionUri cannot be null");
|
||||||
this.introspectionUri = introspectionUri;
|
this.introspectionUri = introspectionUri;
|
||||||
this.introspector = () -> new SpringOpaqueTokenIntrospector(this.introspectionUri, this.clientId,
|
this.introspector = () -> SpringOpaqueTokenIntrospector.withIntrospectionUri(this.introspectionUri)
|
||||||
this.clientSecret);
|
.clientId(this.clientId)
|
||||||
|
.clientSecret(this.clientSecret)
|
||||||
|
.build();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -531,8 +533,10 @@ public final class OAuth2ResourceServerConfigurer<H extends HttpSecurityBuilder<
|
|||||||
Assert.notNull(clientSecret, "clientSecret cannot be null");
|
Assert.notNull(clientSecret, "clientSecret cannot be null");
|
||||||
this.clientId = clientId;
|
this.clientId = clientId;
|
||||||
this.clientSecret = clientSecret;
|
this.clientSecret = clientSecret;
|
||||||
this.introspector = () -> new SpringOpaqueTokenIntrospector(this.introspectionUri, this.clientId,
|
this.introspector = () -> SpringOpaqueTokenIntrospector.withIntrospectionUri(this.introspectionUri)
|
||||||
this.clientSecret);
|
.clientId(this.clientId)
|
||||||
|
.clientSecret(this.clientSecret)
|
||||||
|
.build();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -286,7 +286,7 @@ class AuthorizeHttpRequestsDsl : AbstractRequestMatcherDsl {
|
|||||||
if (factoryOfRequestAuthorizationContext != null) {
|
if (factoryOfRequestAuthorizationContext != null) {
|
||||||
return factoryOfRequestAuthorizationContext
|
return factoryOfRequestAuthorizationContext
|
||||||
}
|
}
|
||||||
val factoryOfObjectType = ResolvableType.forClassWithGenerics(AuthorizationManagerFactory::class.java, Object::class.java)
|
val factoryOfObjectType = ResolvableType.forClassWithGenerics(AuthorizationManagerFactory::class.java, Any::class.java)
|
||||||
val factoryOfAny = context.getBeanProvider<AuthorizationManagerFactory<Any>>(factoryOfObjectType).getIfUnique()
|
val factoryOfAny = context.getBeanProvider<AuthorizationManagerFactory<Any>>(factoryOfObjectType).getIfUnique()
|
||||||
if (factoryOfAny != null) {
|
if (factoryOfAny != null) {
|
||||||
return factoryOfAny
|
return factoryOfAny
|
||||||
@@ -303,20 +303,20 @@ class AuthorizeHttpRequestsDsl : AbstractRequestMatcherDsl {
|
|||||||
return defaultFactory
|
return defaultFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun resolveRolePrefix(context: ApplicationContext): String {
|
private fun resolveRolePrefix(context: ApplicationContext): String? {
|
||||||
val beanNames = context.getBeanNamesForType(GrantedAuthorityDefaults::class.java)
|
val beanNames = context.getBeanNamesForType(GrantedAuthorityDefaults::class.java)
|
||||||
if (beanNames.isNotEmpty()) {
|
if (beanNames.isNotEmpty()) {
|
||||||
return context.getBean(GrantedAuthorityDefaults::class.java).rolePrefix
|
return context.getBean(GrantedAuthorityDefaults::class.java).rolePrefix
|
||||||
}
|
}
|
||||||
return "ROLE_";
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun resolveRoleHierarchy(context: ApplicationContext): RoleHierarchy {
|
private fun resolveRoleHierarchy(context: ApplicationContext): RoleHierarchy? {
|
||||||
val beanNames = context.getBeanNamesForType(RoleHierarchy::class.java)
|
val beanNames = context.getBeanNamesForType(RoleHierarchy::class.java)
|
||||||
if (beanNames.isNotEmpty()) {
|
if (beanNames.isNotEmpty()) {
|
||||||
return context.getBean(RoleHierarchy::class.java)
|
return context.getBean(RoleHierarchy::class.java)
|
||||||
}
|
}
|
||||||
return NullRoleHierarchy()
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -37,9 +37,11 @@ class HeadersDsl {
|
|||||||
private var cacheControl: ((HeadersConfigurer<HttpSecurity>.CacheControlConfig) -> Unit)? = null
|
private var cacheControl: ((HeadersConfigurer<HttpSecurity>.CacheControlConfig) -> Unit)? = null
|
||||||
private var hsts: ((HeadersConfigurer<HttpSecurity>.HstsConfig) -> Unit)? = null
|
private var hsts: ((HeadersConfigurer<HttpSecurity>.HstsConfig) -> Unit)? = null
|
||||||
private var frameOptions: ((HeadersConfigurer<HttpSecurity>.FrameOptionsConfig) -> Unit)? = null
|
private var frameOptions: ((HeadersConfigurer<HttpSecurity>.FrameOptionsConfig) -> Unit)? = null
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
private var hpkp: ((HeadersConfigurer<HttpSecurity>.HpkpConfig) -> Unit)? = null
|
private var hpkp: ((HeadersConfigurer<HttpSecurity>.HpkpConfig) -> Unit)? = null
|
||||||
private var contentSecurityPolicy: ((HeadersConfigurer<HttpSecurity>.ContentSecurityPolicyConfig) -> Unit)? = null
|
private var contentSecurityPolicy: ((HeadersConfigurer<HttpSecurity>.ContentSecurityPolicyConfig) -> Unit)? = null
|
||||||
private var referrerPolicy: ((HeadersConfigurer<HttpSecurity>.ReferrerPolicyConfig) -> Unit)? = null
|
private var referrerPolicy: ((HeadersConfigurer<HttpSecurity>.ReferrerPolicyConfig) -> Unit)? = null
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
private var featurePolicyDirectives: String? = null
|
private var featurePolicyDirectives: String? = null
|
||||||
private var permissionsPolicy: ((HeadersConfigurer<HttpSecurity>.PermissionsPolicyConfig) -> Unit)? = null
|
private var permissionsPolicy: ((HeadersConfigurer<HttpSecurity>.PermissionsPolicyConfig) -> Unit)? = null
|
||||||
private var crossOriginOpenerPolicy: ((HeadersConfigurer<HttpSecurity>.CrossOriginOpenerPolicyConfig) -> Unit)? = null
|
private var crossOriginOpenerPolicy: ((HeadersConfigurer<HttpSecurity>.CrossOriginOpenerPolicyConfig) -> Unit)? = null
|
||||||
@@ -120,6 +122,7 @@ class HeadersDsl {
|
|||||||
* @deprecated see <a href="https://owasp.org/www-community/controls/Certificate_and_Public_Key_Pinning">Certificate and Public Key Pinning</a> for more context
|
* @deprecated see <a href="https://owasp.org/www-community/controls/Certificate_and_Public_Key_Pinning">Certificate and Public Key Pinning</a> for more context
|
||||||
*/
|
*/
|
||||||
@Deprecated(message = "as of 5.8 with no replacement")
|
@Deprecated(message = "as of 5.8 with no replacement")
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
fun httpPublicKeyPinning(hpkpConfig: HttpPublicKeyPinningDsl.() -> Unit) {
|
fun httpPublicKeyPinning(hpkpConfig: HttpPublicKeyPinningDsl.() -> Unit) {
|
||||||
this.hpkp = HttpPublicKeyPinningDsl().apply(hpkpConfig).get()
|
this.hpkp = HttpPublicKeyPinningDsl().apply(hpkpConfig).get()
|
||||||
}
|
}
|
||||||
@@ -167,6 +170,7 @@ class HeadersDsl {
|
|||||||
* @param policyDirectives policyDirectives the security policy directive(s)
|
* @param policyDirectives policyDirectives the security policy directive(s)
|
||||||
*/
|
*/
|
||||||
@Deprecated("Use 'permissionsPolicy { }' instead.")
|
@Deprecated("Use 'permissionsPolicy { }' instead.")
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
fun featurePolicy(policyDirectives: String) {
|
fun featurePolicy(policyDirectives: String) {
|
||||||
this.featurePolicyDirectives = policyDirectives
|
this.featurePolicyDirectives = policyDirectives
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -614,6 +614,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
|||||||
* @see [RequiresChannelDsl]
|
* @see [RequiresChannelDsl]
|
||||||
* @deprecated please use [redirectToHttps] instead
|
* @deprecated please use [redirectToHttps] instead
|
||||||
*/
|
*/
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
@Deprecated(message="since 6.5 use redirectToHttps instead")
|
@Deprecated(message="since 6.5 use redirectToHttps instead")
|
||||||
fun requiresChannel(requiresChannelConfiguration: RequiresChannelDsl.() -> Unit) {
|
fun requiresChannel(requiresChannelConfiguration: RequiresChannelDsl.() -> Unit) {
|
||||||
val requiresChannelCustomizer = RequiresChannelDsl().apply(requiresChannelConfiguration).get()
|
val requiresChannelCustomizer = RequiresChannelDsl().apply(requiresChannelConfiguration).get()
|
||||||
|
|||||||
+2
@@ -14,6 +14,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@file:Suppress("DEPRECATION")
|
||||||
|
|
||||||
package org.springframework.security.config.annotation.web
|
package org.springframework.security.config.annotation.web
|
||||||
|
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class X509Dsl {
|
|||||||
authenticationDetailsSource?.also { x509.authenticationDetailsSource(authenticationDetailsSource) }
|
authenticationDetailsSource?.also { x509.authenticationDetailsSource(authenticationDetailsSource) }
|
||||||
userDetailsService?.also { x509.userDetailsService(userDetailsService) }
|
userDetailsService?.also { x509.userDetailsService(userDetailsService) }
|
||||||
authenticationUserDetailsService?.also { x509.authenticationUserDetailsService(authenticationUserDetailsService) }
|
authenticationUserDetailsService?.also { x509.authenticationUserDetailsService(authenticationUserDetailsService) }
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
subjectPrincipalRegex?.also { x509.subjectPrincipalRegex(subjectPrincipalRegex) }
|
subjectPrincipalRegex?.also { x509.subjectPrincipalRegex(subjectPrincipalRegex) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -14,6 +14,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@file:Suppress("DEPRECATION")
|
||||||
|
|
||||||
package org.springframework.security.config.annotation.web.headers
|
package org.springframework.security.config.annotation.web.headers
|
||||||
|
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity
|
||||||
|
|||||||
+1
-2
@@ -68,12 +68,11 @@ class SessionFixationDsl {
|
|||||||
internal fun get(): (SessionManagementConfigurer<HttpSecurity>.SessionFixationConfigurer) -> Unit {
|
internal fun get(): (SessionManagementConfigurer<HttpSecurity>.SessionFixationConfigurer) -> Unit {
|
||||||
return { sessionFixation ->
|
return { sessionFixation ->
|
||||||
strategy?.also {
|
strategy?.also {
|
||||||
when (strategy) {
|
when (it) {
|
||||||
SessionFixationStrategy.NEW -> sessionFixation.newSession()
|
SessionFixationStrategy.NEW -> sessionFixation.newSession()
|
||||||
SessionFixationStrategy.MIGRATE -> sessionFixation.migrateSession()
|
SessionFixationStrategy.MIGRATE -> sessionFixation.migrateSession()
|
||||||
SessionFixationStrategy.CHANGE_ID -> sessionFixation.changeSessionId()
|
SessionFixationStrategy.CHANGE_ID -> sessionFixation.changeSessionId()
|
||||||
SessionFixationStrategy.NONE -> sessionFixation.none()
|
SessionFixationStrategy.NONE -> sessionFixation.none()
|
||||||
null -> null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,6 +294,14 @@ final class SerializationSamples {
|
|||||||
Authentication authentication = TestAuthentication.authenticated(user);
|
Authentication authentication = TestAuthentication.authenticated(user);
|
||||||
SecurityContext securityContext = new SecurityContextImpl(authentication);
|
SecurityContext securityContext = new SecurityContextImpl(authentication);
|
||||||
|
|
||||||
|
instancioByClassName.put(OneTimeTokenAuthenticationToken.class, () -> {
|
||||||
|
@SuppressWarnings("removal")
|
||||||
|
InstancioOfClassApi<?> instancio = Instancio.of(OneTimeTokenAuthenticationToken.class);
|
||||||
|
instancio.supply(Select.all(OneTimeTokenAuthenticationToken.class),
|
||||||
|
(r) -> applyDetails(new OneTimeTokenAuthenticationToken("token")));
|
||||||
|
return instancio;
|
||||||
|
});
|
||||||
|
|
||||||
// oauth2-core
|
// oauth2-core
|
||||||
generatorByClassName.put(DefaultOAuth2User.class, (r) -> TestOAuth2Users.create());
|
generatorByClassName.put(DefaultOAuth2User.class, (r) -> TestOAuth2Users.create());
|
||||||
generatorByClassName.put(OAuth2AuthorizationRequest.class,
|
generatorByClassName.put(OAuth2AuthorizationRequest.class,
|
||||||
@@ -607,8 +615,7 @@ final class SerializationSamples {
|
|||||||
token.setDetails(details);
|
token.setDetails(details);
|
||||||
return token;
|
return token;
|
||||||
});
|
});
|
||||||
generatorByClassName.put(OneTimeTokenAuthenticationToken.class,
|
|
||||||
(r) -> applyDetails(new OneTimeTokenAuthenticationToken("username", "token")));
|
|
||||||
generatorByClassName.put(OneTimeTokenAuthentication.class,
|
generatorByClassName.put(OneTimeTokenAuthentication.class,
|
||||||
(r) -> applyDetails(new OneTimeTokenAuthentication("username", authentication.getAuthorities())));
|
(r) -> applyDetails(new OneTimeTokenAuthentication("username", authentication.getAuthorities())));
|
||||||
generatorByClassName.put(AccessDeniedException.class,
|
generatorByClassName.put(AccessDeniedException.class,
|
||||||
|
|||||||
+4
@@ -1201,6 +1201,7 @@ public class HeadersConfigurerTests {
|
|||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
|
@SuppressWarnings("removal")
|
||||||
static class PermissionsPolicyConfig {
|
static class PermissionsPolicyConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@@ -1221,6 +1222,7 @@ public class HeadersConfigurerTests {
|
|||||||
static class PermissionsPolicyStringConfig {
|
static class PermissionsPolicyStringConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@SuppressWarnings("removal")
|
||||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
http
|
http
|
||||||
@@ -1235,6 +1237,7 @@ public class HeadersConfigurerTests {
|
|||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
|
@SuppressWarnings("removal")
|
||||||
static class PermissionsPolicyInvalidConfig {
|
static class PermissionsPolicyInvalidConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@@ -1252,6 +1255,7 @@ public class HeadersConfigurerTests {
|
|||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
|
@SuppressWarnings("removal")
|
||||||
static class PermissionsPolicyInvalidStringConfig {
|
static class PermissionsPolicyInvalidStringConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|||||||
+1
@@ -1257,6 +1257,7 @@ public class OAuth2AuthorizationCodeGrantTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@SuppressWarnings("removal")
|
||||||
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
||||||
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
|
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
|
||||||
jdbcOperations);
|
jdbcOperations);
|
||||||
|
|||||||
+1
@@ -561,6 +561,7 @@ public class OAuth2ClientCredentialsGrantTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@SuppressWarnings("removal")
|
||||||
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
||||||
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
|
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
|
||||||
jdbcOperations);
|
jdbcOperations);
|
||||||
|
|||||||
+1
@@ -647,6 +647,7 @@ public class OAuth2ClientRegistrationTests {
|
|||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@SuppressWarnings("removal")
|
||||||
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
||||||
RegisteredClient registeredClient = TestRegisteredClients.registeredClient().build();
|
RegisteredClient registeredClient = TestRegisteredClients.registeredClient().build();
|
||||||
RegisteredClientParametersMapper registeredClientParametersMapper = new RegisteredClientParametersMapper();
|
RegisteredClientParametersMapper registeredClientParametersMapper = new RegisteredClientParametersMapper();
|
||||||
|
|||||||
+1
@@ -469,6 +469,7 @@ public class OAuth2RefreshTokenGrantTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@SuppressWarnings("removal")
|
||||||
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
||||||
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
|
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
|
||||||
jdbcOperations);
|
jdbcOperations);
|
||||||
|
|||||||
+1
@@ -515,6 +515,7 @@ public class OAuth2TokenIntrospectionTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@SuppressWarnings("removal")
|
||||||
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
||||||
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
|
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
|
||||||
jdbcOperations);
|
jdbcOperations);
|
||||||
|
|||||||
+1
@@ -318,6 +318,7 @@ public class OAuth2TokenRevocationTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@SuppressWarnings("removal")
|
||||||
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
||||||
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
|
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
|
||||||
jdbcOperations);
|
jdbcOperations);
|
||||||
|
|||||||
+1
@@ -778,6 +778,7 @@ public class OidcClientRegistrationTests {
|
|||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@SuppressWarnings("removal")
|
||||||
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
||||||
RegisteredClient registeredClient = TestRegisteredClients.registeredClient().build();
|
RegisteredClient registeredClient = TestRegisteredClients.registeredClient().build();
|
||||||
RegisteredClientParametersMapper registeredClientParametersMapper = new RegisteredClientParametersMapper();
|
RegisteredClientParametersMapper registeredClientParametersMapper = new RegisteredClientParametersMapper();
|
||||||
|
|||||||
+1
@@ -633,6 +633,7 @@ public class OidcTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@SuppressWarnings("removal")
|
||||||
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
|
||||||
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
|
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
|
||||||
jdbcOperations);
|
jdbcOperations);
|
||||||
|
|||||||
+1
@@ -100,6 +100,7 @@ import static org.mockito.Mockito.verify;
|
|||||||
* {@link org.springframework.security.config.web.server.ServerHttpSecurity.OAuth2ResourceServerSpec}
|
* {@link org.springframework.security.config.web.server.ServerHttpSecurity.OAuth2ResourceServerSpec}
|
||||||
*/
|
*/
|
||||||
@ExtendWith({ SpringTestContextExtension.class })
|
@ExtendWith({ SpringTestContextExtension.class })
|
||||||
|
@SuppressWarnings("removal")
|
||||||
public class OAuth2ResourceServerSpecTests {
|
public class OAuth2ResourceServerSpecTests {
|
||||||
|
|
||||||
private String expired = "eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE1MzUwMzc4OTd9.jqZDDjfc2eysX44lHXEIr9XFd2S8vjIZHCccZU-dRWMRJNsQ1QN5VNnJGklqJBXJR4qgla6cmVqPOLkUHDb0sL0nxM5XuzQaG5ZzKP81RV88shFyAiT0fD-6nl1k-Fai-Fu-VkzSpNXgeONoTxDaYhdB-yxmgrgsApgmbOTE_9AcMk-FQDXQ-pL9kynccFGV0lZx4CA7cyknKN7KBxUilfIycvXODwgKCjj_1WddLTCNGYogJJSg__7NoxzqbyWd3udbHVjqYq7GsMMrGB4_2kBD4CkghOSNcRHbT_DIXowxfAVT7PAg7Q0E5ruZsr2zPZacEUDhJ6-wbvlA0FAOUg";
|
private String expired = "eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE1MzUwMzc4OTd9.jqZDDjfc2eysX44lHXEIr9XFd2S8vjIZHCccZU-dRWMRJNsQ1QN5VNnJGklqJBXJR4qgla6cmVqPOLkUHDb0sL0nxM5XuzQaG5ZzKP81RV88shFyAiT0fD-6nl1k-Fai-Fu-VkzSpNXgeONoTxDaYhdB-yxmgrgsApgmbOTE_9AcMk-FQDXQ-pL9kynccFGV0lZx4CA7cyknKN7KBxUilfIycvXODwgKCjj_1WddLTCNGYogJJSg__7NoxzqbyWd3udbHVjqYq7GsMMrGB4_2kBD4CkghOSNcRHbT_DIXowxfAVT7PAg7Q0E5ruZsr2zPZacEUDhJ6-wbvlA0FAOUg";
|
||||||
|
|||||||
+5
@@ -167,6 +167,7 @@ public class OidcLogoutSpecTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("removal")
|
||||||
void logoutWhenInvalidLogoutTokenThenBadRequest() {
|
void logoutWhenInvalidLogoutTokenThenBadRequest() {
|
||||||
this.spring.register(WebServerConfig.class, OidcProviderConfig.class, DefaultConfig.class).autowire();
|
this.spring.register(WebServerConfig.class, OidcProviderConfig.class, DefaultConfig.class).autowire();
|
||||||
this.test.get().uri("/token/logout").exchange().expectStatus().isUnauthorized();
|
this.test.get().uri("/token/logout").exchange().expectStatus().isUnauthorized();
|
||||||
@@ -209,6 +210,7 @@ public class OidcLogoutSpecTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("removal")
|
||||||
void logoutWhenLogoutTokenSpecifiesOneSessionThenRemotelyInvalidatesOnlyThatSession() throws Exception {
|
void logoutWhenLogoutTokenSpecifiesOneSessionThenRemotelyInvalidatesOnlyThatSession() throws Exception {
|
||||||
this.spring.register(WebServerConfig.class, OidcProviderConfig.class, DefaultConfig.class).autowire();
|
this.spring.register(WebServerConfig.class, OidcProviderConfig.class, DefaultConfig.class).autowire();
|
||||||
String registrationId = this.clientRegistration.getRegistrationId();
|
String registrationId = this.clientRegistration.getRegistrationId();
|
||||||
@@ -252,6 +254,7 @@ public class OidcLogoutSpecTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("removal")
|
||||||
void logoutWhenRemoteLogoutUriThenUses() {
|
void logoutWhenRemoteLogoutUriThenUses() {
|
||||||
this.spring.register(WebServerConfig.class, OidcProviderConfig.class, LogoutUriConfig.class).autowire();
|
this.spring.register(WebServerConfig.class, OidcProviderConfig.class, LogoutUriConfig.class).autowire();
|
||||||
String registrationId = this.clientRegistration.getRegistrationId();
|
String registrationId = this.clientRegistration.getRegistrationId();
|
||||||
@@ -302,6 +305,7 @@ public class OidcLogoutSpecTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("removal")
|
||||||
void logoutWhenDifferentCookieNameThenUses() {
|
void logoutWhenDifferentCookieNameThenUses() {
|
||||||
this.spring.register(OidcProviderConfig.class, CookieConfig.class).autowire();
|
this.spring.register(OidcProviderConfig.class, CookieConfig.class).autowire();
|
||||||
String registrationId = this.clientRegistration.getRegistrationId();
|
String registrationId = this.clientRegistration.getRegistrationId();
|
||||||
@@ -325,6 +329,7 @@ public class OidcLogoutSpecTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("removal")
|
||||||
void logoutWhenRemoteLogoutFailsThenReportsPartialLogout() {
|
void logoutWhenRemoteLogoutFailsThenReportsPartialLogout() {
|
||||||
this.spring.register(WebServerConfig.class, OidcProviderConfig.class, WithBrokenLogoutConfig.class).autowire();
|
this.spring.register(WebServerConfig.class, OidcProviderConfig.class, WithBrokenLogoutConfig.class).autowire();
|
||||||
ServerLogoutHandler logoutHandler = this.spring.getContext().getBean(ServerLogoutHandler.class);
|
ServerLogoutHandler logoutHandler = this.spring.getContext().getBean(ServerLogoutHandler.class);
|
||||||
|
|||||||
+1
@@ -737,6 +737,7 @@ public class ServerHttpSecurityTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("removal")
|
||||||
void resourcesWhenLoginPageConfiguredThenServesCss() {
|
void resourcesWhenLoginPageConfiguredThenServesCss() {
|
||||||
this.http.formLogin(withDefaults());
|
this.http.formLogin(withDefaults());
|
||||||
this.http.authenticationManager(this.authenticationManager);
|
this.http.authenticationManager(this.authenticationManager);
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2004-present the original author or authors.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user