1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Add serialVersionUID to Authentication classes

Issue gh-16276
This commit is contained in:
Josh Cummings
2024-12-12 11:43:42 -07:00
parent e3cd4339b2
commit b9911fd522
45 changed files with 199 additions and 20 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2024 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.oauth2.core;
import java.io.Serial;
import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
@@ -34,6 +35,9 @@ import org.springframework.util.Assert;
*/
public final class DefaultOAuth2AuthenticatedPrincipal implements OAuth2AuthenticatedPrincipal, Serializable {
@Serial
private static final long serialVersionUID = 4631662622577433065L;
private final Map<String, Object> attributes;
private final Collection<GrantedAuthority> authorities;
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2024 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.oauth2.core;
import java.io.Serial;
import java.io.Serializable;
import java.time.Instant;
import java.util.Collections;
@@ -41,6 +42,9 @@ import org.springframework.util.Assert;
*/
public class OAuth2AccessToken extends AbstractOAuth2Token {
@Serial
private static final long serialVersionUID = -3041884478533441940L;
private final TokenType tokenType;
private final Set<String> scopes;
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.oauth2.core;
import java.io.Serial;
import java.time.Instant;
/**
@@ -30,6 +31,9 @@ import java.time.Instant;
*/
public class OAuth2DeviceCode extends AbstractOAuth2Token {
@Serial
private static final long serialVersionUID = -864134962034523562L;
/**
* Constructs an {@code OAuth2DeviceCode} using the provided parameters.
* @param tokenValue the token value
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2024 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.oauth2.core;
import java.io.Serial;
import java.time.Instant;
/**
@@ -36,6 +37,9 @@ import java.time.Instant;
*/
public class OAuth2RefreshToken extends AbstractOAuth2Token {
@Serial
private static final long serialVersionUID = -4114856398229602435L;
/**
* Constructs an {@code OAuth2RefreshToken} using the provided parameters.
* @param tokenValue the token value
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.oauth2.core;
import java.io.Serial;
import java.time.Instant;
/**
@@ -30,6 +31,9 @@ import java.time.Instant;
*/
public class OAuth2UserCode extends AbstractOAuth2Token {
@Serial
private static final long serialVersionUID = -3948612521903348476L;
/**
* Constructs an {@code OAuth2UserCode} using the provided parameters.
* @param tokenValue the token value
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2024 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.oauth2.core.oidc;
import java.io.Serial;
import java.time.Instant;
import java.util.Collection;
import java.util.Collections;
@@ -48,6 +49,9 @@ import org.springframework.util.Assert;
*/
public class OidcIdToken extends AbstractOAuth2Token implements IdTokenClaimAccessor {
@Serial
private static final long serialVersionUID = -1840734870428968020L;
private final Map<String, Object> claims;
/**
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2024 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.oauth2.core.oidc.user;
import java.io.Serial;
import java.util.Collection;
import java.util.Map;
@@ -42,6 +43,9 @@ import org.springframework.security.oauth2.core.user.DefaultOAuth2User;
*/
public class DefaultOidcUser extends DefaultOAuth2User implements OidcUser {
@Serial
private static final long serialVersionUID = -2378469202439157250L;
private final OidcIdToken idToken;
private final OidcUserInfo userInfo;
@@ -16,6 +16,7 @@
package org.springframework.security.oauth2.core.oidc.user;
import java.io.Serial;
import java.util.HashMap;
import java.util.Map;
@@ -36,6 +37,9 @@ import org.springframework.util.Assert;
*/
public class OidcUserAuthority extends OAuth2UserAuthority {
@Serial
private static final long serialVersionUID = -4675866280835753141L;
private final OidcIdToken idToken;
private final OidcUserInfo userInfo;