Add Serializable to Csrf Components
Issue gh-16276
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.web.csrf;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
|
||||
/**
|
||||
@@ -24,9 +26,11 @@ import org.springframework.security.access.AccessDeniedException;
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class CsrfException extends AccessDeniedException {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 7802567627837252670L;
|
||||
|
||||
public CsrfException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
+1
@@ -62,6 +62,7 @@ public class CsrfTokenRequestAttributeHandler implements CsrfTokenRequestHandler
|
||||
request.setAttribute(csrfAttrName, csrfToken);
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static final class SupplierCsrfToken implements CsrfToken {
|
||||
|
||||
private final Supplier<CsrfToken> csrfTokenSupplier;
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.web.csrf;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -24,9 +26,11 @@ import org.springframework.util.Assert;
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public final class DefaultCsrfToken implements CsrfToken {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 6552658053267913685L;
|
||||
|
||||
private final String token;
|
||||
|
||||
private final String parameterName;
|
||||
|
||||
+5
-1
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.web.csrf;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
@@ -25,9 +27,11 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class InvalidCsrfTokenException extends CsrfException {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -7745955098435417418L;
|
||||
|
||||
/**
|
||||
* @param expectedAccessToken
|
||||
* @param actualAccessToken
|
||||
|
||||
@@ -159,6 +159,7 @@ public final class LazyCsrfTokenRepository implements CsrfTokenRepository {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static final class SaveOnAccessCsrfToken implements CsrfToken {
|
||||
|
||||
private transient CsrfTokenRepository tokenRepository;
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.web.server.csrf;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.security.web.csrf.CsrfToken;
|
||||
|
||||
@@ -25,9 +27,11 @@ import org.springframework.security.web.csrf.CsrfToken;
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class CsrfException extends AccessDeniedException {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -8209680716517631141L;
|
||||
|
||||
public CsrfException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
+5
-1
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.security.web.server.csrf;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -24,9 +26,11 @@ import org.springframework.util.Assert;
|
||||
* @author Rob Winch
|
||||
* @since 5.0
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public final class DefaultCsrfToken implements CsrfToken {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 308340117851874929L;
|
||||
|
||||
private final String token;
|
||||
|
||||
private final String parameterName;
|
||||
|
||||
Reference in New Issue
Block a user