From ade35bd956ebebc1b23af435df0ec0b235193750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E6=96=87=E6=9D=B0?= <978399943@qq.com> Date: Wed, 15 Jan 2025 16:15:46 +0800 Subject: [PATCH] Add Override annotation --- .../authentication/OAuth2AccessTokenAuthenticationContext.java | 1 + .../OAuth2AuthorizationCodeRequestAuthenticationContext.java | 1 + .../OAuth2AuthorizationConsentAuthenticationContext.java | 1 + .../authentication/OAuth2ClientAuthenticationContext.java | 1 + .../OAuth2ClientCredentialsAuthenticationContext.java | 1 + .../oidc/authentication/OidcUserInfoAuthenticationContext.java | 1 + .../server/authorization/token/DefaultOAuth2TokenContext.java | 1 + .../oauth2/server/authorization/token/JwtEncodingContext.java | 1 + .../server/authorization/token/OAuth2TokenClaimsContext.java | 1 + 9 files changed, 9 insertions(+) diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AccessTokenAuthenticationContext.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AccessTokenAuthenticationContext.java index 4f18a92f7..d20f8a38a 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AccessTokenAuthenticationContext.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AccessTokenAuthenticationContext.java @@ -100,6 +100,7 @@ public Builder accessTokenResponse(OAuth2AccessTokenResponse.Builder accessToken * Builds a new {@link OAuth2AccessTokenAuthenticationContext}. * @return the {@link OAuth2AccessTokenAuthenticationContext} */ + @Override public OAuth2AccessTokenAuthenticationContext build() { Assert.notNull(get(OAuth2AccessTokenResponse.Builder.class), "accessTokenResponse cannot be null"); return new OAuth2AccessTokenAuthenticationContext(getContext()); diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AuthorizationCodeRequestAuthenticationContext.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AuthorizationCodeRequestAuthenticationContext.java index 35ea4f9b7..565c4fb8b 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AuthorizationCodeRequestAuthenticationContext.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AuthorizationCodeRequestAuthenticationContext.java @@ -142,6 +142,7 @@ public Builder authorizationConsent(OAuth2AuthorizationConsent authorizationCons * Builds a new {@link OAuth2AuthorizationCodeRequestAuthenticationContext}. * @return the {@link OAuth2AuthorizationCodeRequestAuthenticationContext} */ + @Override public OAuth2AuthorizationCodeRequestAuthenticationContext build() { Assert.notNull(get(RegisteredClient.class), "registeredClient cannot be null"); return new OAuth2AuthorizationCodeRequestAuthenticationContext(getContext()); diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AuthorizationConsentAuthenticationContext.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AuthorizationConsentAuthenticationContext.java index aff7c9d3d..2a9874920 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AuthorizationConsentAuthenticationContext.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AuthorizationConsentAuthenticationContext.java @@ -155,6 +155,7 @@ public Builder authorizationRequest(OAuth2AuthorizationRequest authorizationRequ * Builds a new {@link OAuth2AuthorizationConsentAuthenticationContext}. * @return the {@link OAuth2AuthorizationConsentAuthenticationContext} */ + @Override public OAuth2AuthorizationConsentAuthenticationContext build() { Assert.notNull(get(OAuth2AuthorizationConsent.Builder.class), "authorizationConsentBuilder cannot be null"); Assert.notNull(get(RegisteredClient.class), "registeredClient cannot be null"); diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2ClientAuthenticationContext.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2ClientAuthenticationContext.java index 936759b8e..be95cfb84 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2ClientAuthenticationContext.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2ClientAuthenticationContext.java @@ -96,6 +96,7 @@ public Builder registeredClient(RegisteredClient registeredClient) { * Builds a new {@link OAuth2ClientAuthenticationContext}. * @return the {@link OAuth2ClientAuthenticationContext} */ + @Override public OAuth2ClientAuthenticationContext build() { Assert.notNull(get(RegisteredClient.class), "registeredClient cannot be null"); return new OAuth2ClientAuthenticationContext(getContext()); diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2ClientCredentialsAuthenticationContext.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2ClientCredentialsAuthenticationContext.java index 074484341..f786f4757 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2ClientCredentialsAuthenticationContext.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2ClientCredentialsAuthenticationContext.java @@ -96,6 +96,7 @@ public Builder registeredClient(RegisteredClient registeredClient) { * Builds a new {@link OAuth2ClientCredentialsAuthenticationContext}. * @return the {@link OAuth2ClientCredentialsAuthenticationContext} */ + @Override public OAuth2ClientCredentialsAuthenticationContext build() { Assert.notNull(get(RegisteredClient.class), "registeredClient cannot be null"); return new OAuth2ClientCredentialsAuthenticationContext(getContext()); diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/oidc/authentication/OidcUserInfoAuthenticationContext.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/oidc/authentication/OidcUserInfoAuthenticationContext.java index 054bc18d2..cb6510ac8 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/oidc/authentication/OidcUserInfoAuthenticationContext.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/oidc/authentication/OidcUserInfoAuthenticationContext.java @@ -116,6 +116,7 @@ public Builder authorization(OAuth2Authorization authorization) { * Builds a new {@link OidcUserInfoAuthenticationContext}. * @return the {@link OidcUserInfoAuthenticationContext} */ + @Override public OidcUserInfoAuthenticationContext build() { Assert.notNull(get(OAuth2AccessToken.class), "accessToken cannot be null"); Assert.notNull(get(OAuth2Authorization.class), "authorization cannot be null"); diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/token/DefaultOAuth2TokenContext.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/token/DefaultOAuth2TokenContext.java index 34b388613..2066f7c51 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/token/DefaultOAuth2TokenContext.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/token/DefaultOAuth2TokenContext.java @@ -70,6 +70,7 @@ private Builder() { * Builds a new {@link DefaultOAuth2TokenContext}. * @return the {@link DefaultOAuth2TokenContext} */ + @Override public DefaultOAuth2TokenContext build() { return new DefaultOAuth2TokenContext(getContext()); } diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/token/JwtEncodingContext.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/token/JwtEncodingContext.java index 6c7dec3c7..7510cb348 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/token/JwtEncodingContext.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/token/JwtEncodingContext.java @@ -102,6 +102,7 @@ private Builder(JwsHeader.Builder jwsHeaderBuilder, JwtClaimsSet.Builder claimsB * Builds a new {@link JwtEncodingContext}. * @return the {@link JwtEncodingContext} */ + @Override public JwtEncodingContext build() { return new JwtEncodingContext(getContext()); } diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/token/OAuth2TokenClaimsContext.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/token/OAuth2TokenClaimsContext.java index 155bacd45..a831cf5b1 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/token/OAuth2TokenClaimsContext.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/token/OAuth2TokenClaimsContext.java @@ -84,6 +84,7 @@ private Builder(OAuth2TokenClaimsSet.Builder claimsBuilder) { * Builds a new {@link OAuth2TokenClaimsContext}. * @return the {@link OAuth2TokenClaimsContext} */ + @Override public OAuth2TokenClaimsContext build() { return new OAuth2TokenClaimsContext(getContext()); }