-
Notifications
You must be signed in to change notification settings - Fork 0
Fix JdbcUserCredentialRepository Save #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Closes spring-projectsgh-16620 Signed-off-by: Max Batischev <[email protected]>
Reviewer's Guide by SourceryThis pull request fixes the Updated class diagram for JdbcUserCredentialRepositoryclassDiagram
class JdbcUserCredentialRepository {
-JdbcOperations jdbcOperations
-LobHandler lobHandler
-Function<CredentialRecord, List<SqlParameterValue>> credentialRecordParametersMapper
-String tableName
-String idFilter
-String findByUserIdSql
-String findByCredentialIdSql
-String findAllByUserIdSql
-String deleteCredentialRecordSql
-String updateCredentialRecordSql
-String insertCredentialRecordSql
+JdbcUserCredentialRepository(JdbcOperations jdbcOperations, LobHandler lobHandler, Function<CredentialRecord, List<SqlParameterValue>> credentialRecordParametersMapper, String tableName, String idFilter)
+delete(Bytes credentialId)
+save(CredentialRecord record)
+findByCredentialId(Bytes credentialId)
+findAllByUserId(String userId)
+updateCredentialRecord(CredentialRecord record)
+insertCredentialRecord(CredentialRecord record)
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @GuusArts - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider extracting the common parts of
insertCredentialRecord
andupdateCredentialRecord
into a shared method.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
User description
Closes spring-projectsgh-16620
PR Type
Bug fix, Tests
Description
Fixes
JdbcUserCredentialRepository.save
to update existing records.Adds SQL query for updating credential records in the database.
Implements logic to handle both insert and update operations in
save
.Introduces a new test case to verify record updates in
JdbcUserCredentialRepositoryTests
.Changes walkthrough 📝
JdbcUserCredentialRepository.java
Enhance `JdbcUserCredentialRepository` to support record updates
web/src/main/java/org/springframework/security/web/webauthn/management/JdbcUserCredentialRepository.java
save
method to handle updates and inserts.updateCredentialRecord
andinsertCredentialRecord
.JdbcUserCredentialRepositoryTests.java
Add test for updating credential records
web/src/test/java/org/springframework/security/web/webauthn/management/JdbcUserCredentialRepositoryTests.java
ImmutableCredentialRecord
for test updates.