-
Couldn't load subscription status.
- Fork 6.2k
Add TimestampedGrantedAuthority for time-based authorization #17867
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
Conversation
I think the build failure appears to be related to serialization tests(SpringSecurityCoreVersionSerializableTests) - TimestampedGrantedAuthority is a new class without existing serialized files from previous versions. How should this be handled?
@yybmion thanks for the PR and for double-checking regarding serialization. Can you please add the following to the PR:
- Favor a random value for the serialization id
- Add a sample construction to
SerializationSamples - Enable the test
SpringSecurityCoreVersionSerializableTests#serializeCurrentVersionClassesand run it. This will generate the needed file. - Re-disable the test
In the end, there should be three file changes in your PR: The new authority implementation, a .serialized file, and SerializationSamples.
f6f001b to
8f64ab9
Compare
Thanks for the guidance @jzheaux. I’ve added the .serialized file and pushed the changes.
- Implement GrantedAuthority with temporal constraints (issuedAt, notBefore, expiresAt) - Use Builder pattern for flexible construction - Default issuedAt to Instant.now() when not specified - Add serialization sample and generated .serialized file - Add comprehensive tests Closes spring-projectsgh-17864 Signed-off-by: yybmion <yunyubin54@gmail.com>
8f64ab9 to
85f523a
Compare
Resolved conflicts with ce36fc1
Uh oh!
There was an error while loading. Please reload this page.
Adds
TimestampedGrantedAuthorityto support time-based authorization rules as described in #17864 .Changes
TimestampedGrantedAuthorityclass implementingGrantedAuthorityissuedAt,notBefore,expiresAtUsage
Fixes #17864