Make FactorGrantedAuthority Builder constructor public#19035
Closed
hqqw2h-lgtm wants to merge 1 commit intospring-projects:mainfrom
Closed
Make FactorGrantedAuthority Builder constructor public#19035hqqw2h-lgtm wants to merge 1 commit intospring-projects:mainfrom
hqqw2h-lgtm wants to merge 1 commit intospring-projects:mainfrom
Conversation
Allow external code to construct FactorGrantedAuthority.Builder directly, enabling custom issuedAt values for scenarios like persisting MFA factor timestamps. Closes spring-projectsgh-18975 Signed-off-by: hanweiwei <duzielww@163.com> Signed-off-by: hanweiwei <duzielww@163.com>
c103dd0 to
7e5ab5f
Compare
Contributor
|
Hi, @hqqw2h-lgtm, thanks for the PR. I'm not sure I understand the value of the current just yet. Why are the static factories, withFactor and withAuthority, insufficient in your case? Perhaps you could demonstrate in your unit testing what you can do now that couldn't be done before. |
Author
|
Thanks for the feedback. You're right that the existing static factories (withAuthority/withFactor) already support setting issuedAt via the builder, so this constructor visibility change does not add sufficient value. Closing this PR. |
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.
Summary
Make the
FactorGrantedAuthority.Builderconstructor public so that external code can create aBuilderdirectly and set a customissuedAtvalue.This enables scenarios like persisting MFA factor timestamps (along with user agent and IP address) so the user is not prompted for a configurable period when next logging in.
Builder(String authority)fromprivatetopublicBuilderconstructionCloses gh-18975