From b764c666c6181c6e4d3b97cfa0409263c63233ea Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Tue, 17 Oct 2017 21:06:27 -0500 Subject: [PATCH] Fix jwt package tangles JWT is part of OAuth2, so it should be a subpackage of oauth2. Fixes gh-4614 --- .../security/{ => oauth2}/jose/jws/JwsAlgorithm.java | 4 ++-- .../org/springframework/security/{ => oauth2}/jwt/Jwt.java | 4 ++-- .../springframework/security/{ => oauth2}/jwt/JwtClaim.java | 4 ++-- .../security/{ => oauth2}/jwt/JwtClaimAccessor.java | 4 ++-- .../security/{ => oauth2}/jwt/JwtDecoder.java | 4 ++-- .../security/{ => oauth2}/jwt/JwtException.java | 4 ++-- .../{ => oauth2}/jwt/NimbusJwtDecoderJwkSupport.java | 6 +++--- .../client/authentication/jwt/JwtDecoderRegistry.java | 2 +- .../client/authentication/jwt/NimbusJwtDecoderRegistry.java | 4 ++-- .../OidcAuthorizationCodeAuthenticationProvider.java | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) rename oauth2/jwt-jose/src/main/java/org/springframework/security/{ => oauth2}/jose/jws/JwsAlgorithm.java (95%) rename oauth2/jwt-jose/src/main/java/org/springframework/security/{ => oauth2}/jwt/Jwt.java (95%) rename oauth2/jwt-jose/src/main/java/org/springframework/security/{ => oauth2}/jwt/JwtClaim.java (91%) rename oauth2/jwt-jose/src/main/java/org/springframework/security/{ => oauth2}/jwt/JwtClaimAccessor.java (94%) rename oauth2/jwt-jose/src/main/java/org/springframework/security/{ => oauth2}/jwt/JwtDecoder.java (94%) rename oauth2/jwt-jose/src/main/java/org/springframework/security/{ => oauth2}/jwt/JwtException.java (89%) rename oauth2/jwt-jose/src/main/java/org/springframework/security/{ => oauth2}/jwt/NimbusJwtDecoderJwkSupport.java (96%) diff --git a/oauth2/jwt-jose/src/main/java/org/springframework/security/jose/jws/JwsAlgorithm.java b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jose/jws/JwsAlgorithm.java similarity index 95% rename from oauth2/jwt-jose/src/main/java/org/springframework/security/jose/jws/JwsAlgorithm.java rename to oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jose/jws/JwsAlgorithm.java index caf1ee0c41..3f2eb32ac6 100644 --- a/oauth2/jwt-jose/src/main/java/org/springframework/security/jose/jws/JwsAlgorithm.java +++ b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jose/jws/JwsAlgorithm.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2002-2017 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. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.jose.jws; +package org.springframework.security.oauth2.jose.jws; /** * The cryptographic algorithms defined by the JSON Web Algorithms (JWA) specification diff --git a/oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/Jwt.java b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/Jwt.java similarity index 95% rename from oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/Jwt.java rename to oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/Jwt.java index 967a5f520c..fdde589fa6 100644 --- a/oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/Jwt.java +++ b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/Jwt.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2002-2017 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. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.jwt; +package org.springframework.security.oauth2.jwt; import org.springframework.security.oauth2.core.SecurityToken; import org.springframework.util.Assert; diff --git a/oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/JwtClaim.java b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtClaim.java similarity index 91% rename from oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/JwtClaim.java rename to oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtClaim.java index edf82bb8f1..6d7c4d3d1f 100644 --- a/oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/JwtClaim.java +++ b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtClaim.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2002-2017 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. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.jwt; +package org.springframework.security.oauth2.jwt; /** * The "Registered Claim Names" defined by the JSON Web Token (JWT) specification diff --git a/oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/JwtClaimAccessor.java b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtClaimAccessor.java similarity index 94% rename from oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/JwtClaimAccessor.java rename to oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtClaimAccessor.java index 787029b35e..cd3c42efce 100644 --- a/oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/JwtClaimAccessor.java +++ b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtClaimAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2002-2017 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. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.jwt; +package org.springframework.security.oauth2.jwt; import org.springframework.security.oauth2.core.ClaimAccessor; diff --git a/oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/JwtDecoder.java b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtDecoder.java similarity index 94% rename from oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/JwtDecoder.java rename to oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtDecoder.java index 8976a5c626..7c4564afdf 100644 --- a/oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/JwtDecoder.java +++ b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2002-2017 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. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.jwt; +package org.springframework.security.oauth2.jwt; /** * Implementations of this interface are responsible for "decoding" diff --git a/oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/JwtException.java b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtException.java similarity index 89% rename from oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/JwtException.java rename to oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtException.java index 8a69decb7e..c24f5bba55 100644 --- a/oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/JwtException.java +++ b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtException.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2002-2017 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. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.jwt; +package org.springframework.security.oauth2.jwt; /** * Base exception for all JSON Web Token (JWT) related errors. diff --git a/oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/NimbusJwtDecoderJwkSupport.java b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoderJwkSupport.java similarity index 96% rename from oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/NimbusJwtDecoderJwkSupport.java rename to oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoderJwkSupport.java index f7cc813996..8ad8f20fff 100644 --- a/oauth2/jwt-jose/src/main/java/org/springframework/security/jwt/NimbusJwtDecoderJwkSupport.java +++ b/oauth2/jwt-jose/src/main/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoderJwkSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2002-2017 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. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.jwt; +package org.springframework.security.oauth2.jwt; import com.nimbusds.jose.JWSAlgorithm; import com.nimbusds.jose.jwk.source.JWKSource; @@ -28,7 +28,7 @@ import com.nimbusds.jwt.JWTClaimsSet; import com.nimbusds.jwt.JWTParser; import com.nimbusds.jwt.proc.ConfigurableJWTProcessor; import com.nimbusds.jwt.proc.DefaultJWTProcessor; -import org.springframework.security.jose.jws.JwsAlgorithm; +import org.springframework.security.oauth2.jose.jws.JwsAlgorithm; import org.springframework.util.Assert; import java.net.MalformedURLException; diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/authentication/jwt/JwtDecoderRegistry.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/authentication/jwt/JwtDecoderRegistry.java index 90c47a7395..e547877ab5 100644 --- a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/authentication/jwt/JwtDecoderRegistry.java +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/authentication/jwt/JwtDecoderRegistry.java @@ -15,7 +15,7 @@ */ package org.springframework.security.oauth2.client.authentication.jwt; -import org.springframework.security.jwt.JwtDecoder; +import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.security.oauth2.client.registration.ClientRegistration; /** diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/authentication/jwt/NimbusJwtDecoderRegistry.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/authentication/jwt/NimbusJwtDecoderRegistry.java index bd23c81807..df1ca3b2d9 100644 --- a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/authentication/jwt/NimbusJwtDecoderRegistry.java +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/authentication/jwt/NimbusJwtDecoderRegistry.java @@ -15,8 +15,8 @@ */ package org.springframework.security.oauth2.client.authentication.jwt; -import org.springframework.security.jwt.JwtDecoder; -import org.springframework.security.jwt.NimbusJwtDecoderJwkSupport; +import org.springframework.security.oauth2.jwt.JwtDecoder; +import org.springframework.security.oauth2.jwt.NimbusJwtDecoderJwkSupport; import org.springframework.security.oauth2.client.registration.ClientRegistration; import org.springframework.util.Assert; import org.springframework.util.StringUtils; diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/oidc/client/authentication/OidcAuthorizationCodeAuthenticationProvider.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/oidc/client/authentication/OidcAuthorizationCodeAuthenticationProvider.java index 7f4e69b0ee..8d8957c1a9 100644 --- a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/oidc/client/authentication/OidcAuthorizationCodeAuthenticationProvider.java +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/oidc/client/authentication/OidcAuthorizationCodeAuthenticationProvider.java @@ -18,8 +18,8 @@ package org.springframework.security.oauth2.oidc.client.authentication; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; -import org.springframework.security.jwt.Jwt; -import org.springframework.security.jwt.JwtDecoder; +import org.springframework.security.oauth2.jwt.Jwt; +import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.security.oauth2.client.authentication.AuthorizationCodeAuthenticationToken; import org.springframework.security.oauth2.client.authentication.AuthorizationGrantTokenExchanger; import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationException;