Mark Serialization Support for Events
Issue gh-16276
This commit is contained in:
@@ -32,6 +32,7 @@ import org.springframework.util.Assert;
|
||||
* instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public class AuthenticationCredentialsNotFoundEvent extends AbstractAuthorizationEvent {
|
||||
|
||||
private final AuthenticationCredentialsNotFoundException credentialsNotFoundException;
|
||||
|
||||
@@ -39,6 +39,7 @@ import org.springframework.util.Assert;
|
||||
* instead
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public class AuthorizationFailureEvent extends AbstractAuthorizationEvent {
|
||||
|
||||
private final AccessDeniedException accessDeniedException;
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.springframework.util.Assert;
|
||||
* instead
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public class AuthorizedEvent extends AbstractAuthorizationEvent {
|
||||
|
||||
private final Authentication authentication;
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.springframework.security.authorization.event.AuthorizationGrantedEven
|
||||
* {@link AuthorizationGrantedEvent#getSource()} to deduce public invocations.
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public class PublicInvocationEvent extends AbstractAuthorizationEvent {
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.authentication.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
||||
@@ -27,6 +29,9 @@ import org.springframework.security.core.AuthenticationException;
|
||||
*/
|
||||
public class AuthenticationFailureBadCredentialsEvent extends AbstractAuthenticationFailureEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -5245144711561130379L;
|
||||
|
||||
public AuthenticationFailureBadCredentialsEvent(Authentication authentication, AuthenticationException exception) {
|
||||
super(authentication, exception);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.authentication.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
||||
@@ -27,6 +29,9 @@ import org.springframework.security.core.AuthenticationException;
|
||||
*/
|
||||
public class AuthenticationFailureCredentialsExpiredEvent extends AbstractAuthenticationFailureEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -7595086332769705203L;
|
||||
|
||||
public AuthenticationFailureCredentialsExpiredEvent(Authentication authentication,
|
||||
AuthenticationException exception) {
|
||||
super(authentication, exception);
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.authentication.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
||||
@@ -27,6 +29,9 @@ import org.springframework.security.core.AuthenticationException;
|
||||
*/
|
||||
public class AuthenticationFailureDisabledEvent extends AbstractAuthenticationFailureEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 8037552364666766279L;
|
||||
|
||||
public AuthenticationFailureDisabledEvent(Authentication authentication, AuthenticationException exception) {
|
||||
super(authentication, exception);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.authentication.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
||||
@@ -27,6 +29,9 @@ import org.springframework.security.core.AuthenticationException;
|
||||
*/
|
||||
public class AuthenticationFailureExpiredEvent extends AbstractAuthenticationFailureEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -8437264795214121718L;
|
||||
|
||||
public AuthenticationFailureExpiredEvent(Authentication authentication, AuthenticationException exception) {
|
||||
super(authentication, exception);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.authentication.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
||||
@@ -27,6 +29,9 @@ import org.springframework.security.core.AuthenticationException;
|
||||
*/
|
||||
public class AuthenticationFailureLockedEvent extends AbstractAuthenticationFailureEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -5126110096093568463L;
|
||||
|
||||
public AuthenticationFailureLockedEvent(Authentication authentication, AuthenticationException exception) {
|
||||
super(authentication, exception);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.authentication.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
||||
@@ -27,6 +29,9 @@ import org.springframework.security.core.AuthenticationException;
|
||||
*/
|
||||
public class AuthenticationFailureProviderNotFoundEvent extends AbstractAuthenticationFailureEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 9122219669183263487L;
|
||||
|
||||
public AuthenticationFailureProviderNotFoundEvent(Authentication authentication,
|
||||
AuthenticationException exception) {
|
||||
super(authentication, exception);
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.authentication.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
||||
@@ -27,6 +29,9 @@ import org.springframework.security.core.AuthenticationException;
|
||||
*/
|
||||
public class AuthenticationFailureProxyUntrustedEvent extends AbstractAuthenticationFailureEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1801476426012753252L;
|
||||
|
||||
public AuthenticationFailureProxyUntrustedEvent(Authentication authentication, AuthenticationException exception) {
|
||||
super(authentication, exception);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.authentication.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
||||
@@ -27,6 +29,9 @@ import org.springframework.security.core.AuthenticationException;
|
||||
*/
|
||||
public class AuthenticationFailureServiceExceptionEvent extends AbstractAuthenticationFailureEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 5580062757249390756L;
|
||||
|
||||
public AuthenticationFailureServiceExceptionEvent(Authentication authentication,
|
||||
AuthenticationException exception) {
|
||||
super(authentication, exception);
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.authentication.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
|
||||
/**
|
||||
@@ -25,6 +27,9 @@ import org.springframework.security.core.Authentication;
|
||||
*/
|
||||
public class AuthenticationSuccessEvent extends AbstractAuthenticationEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2537206344128673963L;
|
||||
|
||||
public AuthenticationSuccessEvent(Authentication authentication) {
|
||||
super(authentication);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.authentication.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@@ -34,6 +36,9 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class InteractiveAuthenticationSuccessEvent extends AbstractAuthenticationEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -1990271553478571709L;
|
||||
|
||||
private final Class<?> generatedBy;
|
||||
|
||||
public InteractiveAuthenticationSuccessEvent(Authentication authentication, Class<?> generatedBy) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 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.authentication.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
|
||||
/**
|
||||
@@ -26,6 +28,9 @@ import org.springframework.security.core.Authentication;
|
||||
*/
|
||||
public class LogoutSuccessEvent extends AbstractAuthenticationEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 5112491795571632311L;
|
||||
|
||||
public LogoutSuccessEvent(Authentication authentication) {
|
||||
super(authentication);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.authentication.jaas.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
|
||||
/**
|
||||
@@ -26,6 +28,9 @@ import org.springframework.security.core.Authentication;
|
||||
*/
|
||||
public class JaasAuthenticationFailedEvent extends JaasAuthenticationEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -240510538971925002L;
|
||||
|
||||
private final Exception exception;
|
||||
|
||||
public JaasAuthenticationFailedEvent(Authentication auth, Exception exception) {
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.authentication.jaas.event;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
|
||||
/**
|
||||
@@ -28,6 +30,9 @@ import org.springframework.security.core.Authentication;
|
||||
*/
|
||||
public class JaasAuthenticationSuccessEvent extends JaasAuthenticationEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2236826715750256181L;
|
||||
|
||||
public JaasAuthenticationSuccessEvent(Authentication auth) {
|
||||
super(auth);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 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.security.core.Authentication;
|
||||
* @author Josh Cummings
|
||||
* @since 5.7
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class AuthorizationDeniedEvent<T> extends AuthorizationEvent {
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 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,7 @@
|
||||
|
||||
package org.springframework.security.authorization.event;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
@@ -31,8 +32,12 @@ import org.springframework.util.Assert;
|
||||
* @author Josh Cummings
|
||||
* @since 5.8
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class AuthorizationEvent extends ApplicationEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -9053927371500241295L;
|
||||
|
||||
private final Supplier<Authentication> authentication;
|
||||
|
||||
private final AuthorizationResult result;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 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,7 @@
|
||||
|
||||
package org.springframework.security.authorization.event;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
@@ -30,8 +31,12 @@ import org.springframework.security.core.Authentication;
|
||||
* @author Josh Cummings
|
||||
* @since 5.7
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class AuthorizationGrantedEvent<T> extends AuthorizationEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -8690818228055810339L;
|
||||
|
||||
/**
|
||||
* @deprecated please use a constructor that takes an
|
||||
* {@link org.springframework.security.authorization.AuthorizationResult}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -26,6 +26,7 @@ import org.springframework.context.ApplicationEvent;
|
||||
* @author Josh Cummings
|
||||
* @since 5.6
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class SecurityContextChangedEvent extends ApplicationEvent {
|
||||
|
||||
public static final Supplier<SecurityContext> NO_CONTEXT = () -> null;
|
||||
|
||||
@@ -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.core.session;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**
|
||||
@@ -26,6 +28,9 @@ import org.springframework.context.ApplicationEvent;
|
||||
*/
|
||||
public class AbstractSessionEvent extends ApplicationEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -6878881229287231479L;
|
||||
|
||||
public AbstractSessionEvent(Object source) {
|
||||
super(source);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user