-
Notifications
You must be signed in to change notification settings - Fork 0
initial commit spring security 16489 before improvements #10
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-16488 Signed-off-by: Max Batischev <mblancer@mail.ru>
Reviewer's Guide by SourceryThis pull request introduces the Sequence diagram for GenerateOneTimeTokenWebFilter with ServerGenerateOneTimeTokenRequestResolversequenceDiagram
participant Exchange as ServerWebExchange
participant Filter as GenerateOneTimeTokenWebFilter
participant Resolver as ServerGenerateOneTimeTokenRequestResolver
participant Service as ReactiveOneTimeTokenService
participant Handler as ServerOneTimeTokenGenerationSuccessHandler
Exchange->>Filter: filter(exchange, chain)
Filter->>Resolver: resolve(exchange)
activate Resolver
Resolver-->>Filter: GenerateOneTimeTokenRequest
deactivate Resolver
Filter->>Service: generate(GenerateOneTimeTokenRequest)
activate Service
Service-->>Filter: OneTimeToken
deactivate Service
Filter->>Handler: handle(exchange, token)
activate Handler
Handler-->>Filter: Mono<Void>
deactivate Handler
Filter-->>Exchange: Mono<Void>
Updated class diagram for OneTimeTokenLoginSpecclassDiagram
class OneTimeTokenLoginSpec {
-ServerSecurityContextRepository securityContextRepository
-ServerGenerateOneTimeTokenRequestResolver requestResolver
-String loginProcessingUrl
-String defaultSubmitPageUrl
+OneTimeTokenLoginSpec authenticationConverter(ServerAuthenticationConverter authenticationConverter)
+OneTimeTokenLoginSpec generateRequestResolver(ServerGenerateOneTimeTokenRequestResolver requestResolver)
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR Reviewer Guide 🔍(Review updated until commit f4484d8)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to f4484d8 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit f4484d8
Suggestions up to commit f4484d8
|
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 adding a test case for when the username parameter is missing in the request.
- It would be helpful to provide a more detailed explanation or example of how to configure a custom ServerGenerateOneTimeTokenRequestResolver in the reference documentation.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 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.
import org.springframework.http.MediaType; | ||
import org.springframework.mock.http.server.reactive.MockServerHttpRequest; | ||
import org.springframework.mock.web.server.MockServerWebExchange; | ||
import org.springframework.security.authentication.ott.GenerateOneTimeTokenRequest; |
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.
suggestion (testing): Missing test cases for invalid input
It would be beneficial to add tests that cover scenarios with invalid input in the request, such as an empty username, whitespace-only username, or a very long username. This ensures the resolver handles these edge cases gracefully and provides appropriate error handling or defaults.
|
User description
Closes spring-projectsgh-16488
PR Type
Enhancement, Tests, Documentation
Description
Introduced
ServerGenerateOneTimeTokenRequestResolver
for customizable one-time token generation.DefaultServerGenerateOneTimeTokenRequestResolver
as the default implementation.setExpiresIn
.Updated
GenerateOneTimeTokenWebFilter
to useServerGenerateOneTimeTokenRequestResolver
.Enhanced Kotlin DSL and Java configuration to support custom
ServerGenerateOneTimeTokenRequestResolver
.Added comprehensive tests for the new resolver and its integration.
Updated documentation to guide customization of
GenerateOneTimeTokenRequest
.Changes walkthrough 📝
5 files
Added support for
ServerGenerateOneTimeTokenRequestResolver
inServerHttpSecurity
.Introduced
DefaultServerGenerateOneTimeTokenRequestResolver
for tokengeneration.
Integrated
ServerGenerateOneTimeTokenRequestResolver
intoGenerateOneTimeTokenWebFilter
.Added
ServerGenerateOneTimeTokenRequestResolver
interface for tokenrequest resolution.
Enhanced Kotlin DSL to support custom token request resolver.
3 files
Updated tests for one-time token generation with new resolver.
Added unit tests for
DefaultServerGenerateOneTimeTokenRequestResolver
.Added integration tests for custom token expiration in Kotlin DSL.
1 files
Documented customization of
GenerateOneTimeTokenRequest
and resolver.