Mark Serialization Support for Events
Issue gh-16276
This commit is contained in:
+6
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.web.authentication.session;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.authentication.event.AbstractAuthenticationEvent;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -29,6 +31,9 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class SessionFixationProtectionEvent extends AbstractAuthenticationEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -2554621992006921150L;
|
||||
|
||||
private final String oldSessionId;
|
||||
|
||||
private final String newSessionId;
|
||||
|
||||
+5
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.web.authentication.switchuser;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.authentication.event.AbstractAuthenticationEvent;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
@@ -27,6 +29,9 @@ import org.springframework.security.core.userdetails.UserDetails;
|
||||
*/
|
||||
public class AuthenticationSwitchUserEvent extends AbstractAuthenticationEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 6265996480231793939L;
|
||||
|
||||
private final UserDetails targetUser;
|
||||
|
||||
/**
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ import org.springframework.security.core.session.SessionCreationEvent;
|
||||
* @author Ray Krueger
|
||||
* @author Luke Taylor
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class HttpSessionCreatedEvent extends SessionCreationEvent {
|
||||
|
||||
public HttpSessionCreatedEvent(HttpSession session) {
|
||||
|
||||
+1
@@ -33,6 +33,7 @@ import org.springframework.security.core.session.SessionDestroyedEvent;
|
||||
* @author Luke Taylor
|
||||
* @author Rob Winch
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class HttpSessionDestroyedEvent extends SessionDestroyedEvent {
|
||||
|
||||
public HttpSessionDestroyedEvent(HttpSession session) {
|
||||
|
||||
+7
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.web.session;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
|
||||
import org.springframework.security.core.session.SessionIdChangedEvent;
|
||||
@@ -26,8 +28,12 @@ import org.springframework.security.core.session.SessionIdChangedEvent;
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class HttpSessionIdChangedEvent extends SessionIdChangedEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -5725731666499807941L;
|
||||
|
||||
private final String oldSessionId;
|
||||
|
||||
private final String newSessionId;
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,6 +30,7 @@ import org.springframework.util.Assert;
|
||||
* @author Rob Winch
|
||||
* @since 4.2
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public final class SessionInformationExpiredEvent extends ApplicationEvent {
|
||||
|
||||
private final HttpServletRequest request;
|
||||
|
||||
Reference in New Issue
Block a user