Fix compile warnings for spring-security-config #18596
Open
+22
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes all compiler warnings from the
spring-security-configmodule and applies thecompile-warnings-errorplugin to prevent future warnings.Changes
Java Changes
SpringOpaqueTokenIntrospectorconstructor with the new Builder pattern introduced in Spring Security 6.5new SpringOpaqueTokenIntrospector(introspectionUri, clientId, clientSecret)SpringOpaqueTokenIntrospector.withIntrospectionUri(...).clientId(...).clientSecret(...).build()Kotlin Changes
AuthorizeHttpRequestsDsl.kt:
Object::class.javawithAny::class.java(Kotlin best practice)resolveRolePrefix()andresolveRoleHierarchy()return types to nullable to fix "condition always true" warningsHeadersDsl.kt: Added
@Suppress("DEPRECATION")for deprecatedHpkpConfigusage (class itself is deprecated)HttpSecurityDsl.kt: Added
@Suppress("DEPRECATION")for deprecatedrequiresChannel()methodRequiresChannelDsl.kt: Added
@file:Suppress("DEPRECATION")for deprecated channel security classesX509Dsl.kt: Added
@Suppress("DEPRECATION")for deprecatedsubjectPrincipalRegexpropertyHttpPublicKeyPinningDsl.kt: Added
@file:Suppress("DEPRECATION")for deprecated HPKP classesSessionFixationDsl.kt: Removed unnecessary null case in when expression
Build Configuration
compile-warnings-errorplugin to fail build on warningsTesting
Related Issues
Closes gh-18419