-
Notifications
You must be signed in to change notification settings - Fork 6k
Implement Serializable
for WebAuthnAuthentication
#16285
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
Implement Serializable
for WebAuthnAuthentication
#16285
Conversation
ece0590
to
77f76f8
Compare
b1b63b8
to
125e369
Compare
e9388ae
to
7838079
Compare
Thanks for the Pull Request. Historically the serialVersionUID no longer used for new classes implementing Serializable. Going forward we should generate a serialVersionUID. Please take a look at 6f379aa which was progress towards #16276 for an example for how to implement it. It uses generated serialVersionUID and adds tests. The ticket #16276 also has instructions on how to address it. NOTE: This PR has some overlap with gh-16438 |
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.
Thanks for the updates.
This PR says it closes gh-16273 but it doesn't add a test for serialization / deserialization of WebAuthnAuthentication
. Can you please add it?
Since the ticket is targeting 6.4.x this PR should be pointed at the 6.4.x branch. We will then forward merge it.
I've also provided feedback inline.
@@ -508,6 +511,11 @@ class SpringSecurityCoreVersionSerializableTests { | |||
(r) -> new AuthenticationSwitchUserEvent(authentication, user)); | |||
generatorByClassName.put(HttpSessionCreatedEvent.class, | |||
(r) -> new HttpSessionCreatedEvent(new MockHttpSession())); | |||
|
|||
// webauthn | |||
generatorByClassName.put(Bytes.class, (r) -> Bytes.random()); |
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.
Please create a TestBytes which returns a constant Bytes so that this does not change for each run.
// webauthn | ||
generatorByClassName.put(Bytes.class, (r) -> Bytes.random()); | ||
generatorByClassName.put(ImmutablePublicKeyCredentialUserEntity.class, | ||
(r) -> TestPublicKeyCredentialUserEntity.userEntity().build()); |
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.
Please ensure that TestPublicKeyCredentialUserEntity uses a constant value for the Bytes (get it from TestBytes).
Closes spring-projectsgh-16273 Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
25351a3
to
7905906
Compare
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Serializable
for PublicKeyCredentialUserEntitySerializable
for WebAuthnAuthentication
Closes gh-16273