-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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#serializeCurrentVersionClasses
and 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
.
- 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>
f6f001b
to
8f64ab9
Compare
Thanks for the guidance @jzheaux. I’ve added the .serialized file and pushed the changes.
Uh oh!
There was an error while loading. Please reload this page.
Adds
TimestampedGrantedAuthority
to support time-based authorization rules as described in #17864 .Changes
TimestampedGrantedAuthority
class implementingGrantedAuthority
issuedAt
,notBefore
,expiresAt
Usage
Fixes #17864