Remove compiler warnings in spring-security-web#18820
Open
jkuhel wants to merge 1 commit intospring-projects:mainfrom
Open
Remove compiler warnings in spring-security-web#18820jkuhel wants to merge 1 commit intospring-projects:mainfrom
jkuhel wants to merge 1 commit intospring-projects:mainfrom
Conversation
- fix compiler warnings in ServerOneTimeTOkenAuthenticationConverter - Replace deprecated API calls to create a OneTimeTokenAuthenticationToken.unauthenticated with OneTimeTokenAuthenticationToken(String token) call - Update HttpMessageConverterAuthenticationSuccessHandler to replace deprecated MappingJackson2HttpMessageConverter with JacksonJsonHttpMessageConverter - Replace updated OneTimeTokenAuthenticationConverter to use non-deprecated OneTimeTokenAuthenticationToken constructor - update tests to remove use of deprecated methods - refactor JdbcTokenRepositoryImpl to remove extension of deprecated JdbcDaoSupport class - enable compile-warnings-error plugin Signed-off-by: Joe Kuhel <4983938+jkuhel@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 resolves the compiler warnings in the
spring-security-webmodule.Some of these warnings were straight forward changes:
ServerOneTimeTokenAuthenticationConverter: Replace deprecated callOneTimeTokenAuthenticationToken.unauthenticatedwithOneTimeTokenAuthenticationToken(String token)HttpMessageConverterAuthenticationSuccessHandlerto replace deprecatedMappingJackson2HttpMessageConverterwithJacksonJsonHttpMessageConverterOneTimeTokenAuthenticationConverterto use non-deprecatedOneTimeTokenAuthenticationTokenconstructorDelegatingAuthenticationEntryPointTests/OneTimeTokenAuthenticationFilterTeststo remove use of deprecated methodscompile-warnings-errorforspring-security-webJdbcTokenRepositoryImplchanges@rwinch The more involved change was in
JdbcTokenRepositoryImplwith the extension of deprecatedJdbcDaoSupport. What would be the best way to handle this?To start off for now, I opted to try an implementation that removes
extends JdbcDaoSupport. However, this could be a breaking change for anyone that has extendedJdbcTokenRepositoryImpldirectly via the no-arg constructor withsetDataSource()pattern.If it would be best to not introduce this change or take a different approach, let me know.
Here is a summary of changes I made:
DataSourceconstructor parameter (replaces inheritedsetDataSource()) and used to createJdbcTemplatein the classloggerfield (previously inherited fromJdbcDaoSupport)setCreateTableOnStartup(true)by implementingInitializingBeanto preserve theafterPropertiesSet()call toinitDao()lifecycleRememberMeBeanDefinitionParserto accommodate changes from property injection to constructor injection of theDataSourceJdbcTokenRepositoryImplTestsaccordinglyCloses #18441