Apply Checkstyle WhitespaceAfterCheck module
This commit is contained in:
+1
-1
@@ -125,7 +125,7 @@ public class OAuth2AuthorizationRequestRedirectFilter extends OncePerRequestFilt
|
||||
|
||||
String redirectUriStr = this.expandRedirectUri(request, clientRegistration);
|
||||
|
||||
Map<String,Object> additionalParameters = new HashMap<>();
|
||||
Map<String, Object> additionalParameters = new HashMap<>();
|
||||
additionalParameters.put(OAuth2ParameterNames.REGISTRATION_ID, clientRegistration.getRegistrationId());
|
||||
|
||||
OAuth2AuthorizationRequest.Builder builder;
|
||||
|
||||
+2
-2
@@ -117,7 +117,7 @@ public class OAuth2LoginAuthenticationFilter extends AbstractAuthenticationProce
|
||||
}
|
||||
this.authorizationRequestRepository.removeAuthorizationRequest(request);
|
||||
|
||||
String registrationId = (String)authorizationRequest.getAdditionalParameters().get(OAuth2ParameterNames.REGISTRATION_ID);
|
||||
String registrationId = (String) authorizationRequest.getAdditionalParameters().get(OAuth2ParameterNames.REGISTRATION_ID);
|
||||
ClientRegistration clientRegistration = this.clientRegistrationRepository.findByRegistrationId(registrationId);
|
||||
|
||||
OAuth2LoginAuthenticationToken authenticationRequest = new OAuth2LoginAuthenticationToken(
|
||||
@@ -125,7 +125,7 @@ public class OAuth2LoginAuthenticationFilter extends AbstractAuthenticationProce
|
||||
authenticationRequest.setDetails(this.authenticationDetailsSource.buildDetails(request));
|
||||
|
||||
OAuth2LoginAuthenticationToken authenticationResult =
|
||||
(OAuth2LoginAuthenticationToken)this.getAuthenticationManager().authenticate(authenticationRequest);
|
||||
(OAuth2LoginAuthenticationToken) this.getAuthenticationManager().authenticate(authenticationRequest);
|
||||
|
||||
OAuth2AuthenticationToken oauth2Authentication = new OAuth2AuthenticationToken(
|
||||
authenticationResult.getPrincipal(),
|
||||
|
||||
+3
-3
@@ -119,7 +119,7 @@ public class OAuth2LoginAuthenticationProviderTests {
|
||||
when(this.authorizationRequest.getScopes()).thenReturn(new LinkedHashSet<>(Collections.singleton("openid")));
|
||||
|
||||
OAuth2LoginAuthenticationToken authentication =
|
||||
(OAuth2LoginAuthenticationToken)this.authenticationProvider.authenticate(
|
||||
(OAuth2LoginAuthenticationToken) this.authenticationProvider.authenticate(
|
||||
new OAuth2LoginAuthenticationToken(this.clientRegistration, this.authorizationExchange));
|
||||
|
||||
assertThat(authentication).isNull();
|
||||
@@ -175,7 +175,7 @@ public class OAuth2LoginAuthenticationProviderTests {
|
||||
when(this.userService.loadUser(any())).thenReturn(principal);
|
||||
|
||||
OAuth2LoginAuthenticationToken authentication =
|
||||
(OAuth2LoginAuthenticationToken)this.authenticationProvider.authenticate(
|
||||
(OAuth2LoginAuthenticationToken) this.authenticationProvider.authenticate(
|
||||
new OAuth2LoginAuthenticationToken(this.clientRegistration, this.authorizationExchange));
|
||||
|
||||
assertThat(authentication.isAuthenticated()).isTrue();
|
||||
@@ -207,7 +207,7 @@ public class OAuth2LoginAuthenticationProviderTests {
|
||||
this.authenticationProvider.setAuthoritiesMapper(authoritiesMapper);
|
||||
|
||||
OAuth2LoginAuthenticationToken authentication =
|
||||
(OAuth2LoginAuthenticationToken)this.authenticationProvider.authenticate(
|
||||
(OAuth2LoginAuthenticationToken) this.authenticationProvider.authenticate(
|
||||
new OAuth2LoginAuthenticationToken(this.clientRegistration, this.authorizationExchange));
|
||||
|
||||
assertThat(authentication.getAuthorities()).isEqualTo(mappedAuthorities);
|
||||
|
||||
+3
-3
@@ -143,7 +143,7 @@ public class OidcAuthorizationCodeAuthenticationProviderTests {
|
||||
when(this.authorizationRequest.getScopes()).thenReturn(new LinkedHashSet<>(Collections.singleton("scope1")));
|
||||
|
||||
OAuth2LoginAuthenticationToken authentication =
|
||||
(OAuth2LoginAuthenticationToken)this.authenticationProvider.authenticate(
|
||||
(OAuth2LoginAuthenticationToken) this.authenticationProvider.authenticate(
|
||||
new OAuth2LoginAuthenticationToken(this.clientRegistration, this.authorizationExchange));
|
||||
|
||||
assertThat(authentication).isNull();
|
||||
@@ -355,7 +355,7 @@ public class OidcAuthorizationCodeAuthenticationProviderTests {
|
||||
when(this.userService.loadUser(any())).thenReturn(principal);
|
||||
|
||||
OAuth2LoginAuthenticationToken authentication =
|
||||
(OAuth2LoginAuthenticationToken)this.authenticationProvider.authenticate(
|
||||
(OAuth2LoginAuthenticationToken) this.authenticationProvider.authenticate(
|
||||
new OAuth2LoginAuthenticationToken(this.clientRegistration, this.authorizationExchange));
|
||||
|
||||
assertThat(authentication.isAuthenticated()).isTrue();
|
||||
@@ -389,7 +389,7 @@ public class OidcAuthorizationCodeAuthenticationProviderTests {
|
||||
this.authenticationProvider.setAuthoritiesMapper(authoritiesMapper);
|
||||
|
||||
OAuth2LoginAuthenticationToken authentication =
|
||||
(OAuth2LoginAuthenticationToken)this.authenticationProvider.authenticate(
|
||||
(OAuth2LoginAuthenticationToken) this.authenticationProvider.authenticate(
|
||||
new OAuth2LoginAuthenticationToken(this.clientRegistration, this.authorizationExchange));
|
||||
|
||||
assertThat(authentication.getAuthorities()).isEqualTo(mappedAuthorities);
|
||||
|
||||
+1
-1
@@ -159,7 +159,7 @@ public class OidcUserServiceTests {
|
||||
|
||||
assertThat(user.getAuthorities().size()).isEqualTo(1);
|
||||
assertThat(user.getAuthorities().iterator().next()).isInstanceOf(OidcUserAuthority.class);
|
||||
OidcUserAuthority userAuthority = (OidcUserAuthority)user.getAuthorities().iterator().next();
|
||||
OidcUserAuthority userAuthority = (OidcUserAuthority) user.getAuthorities().iterator().next();
|
||||
assertThat(userAuthority.getAuthority()).isEqualTo("ROLE_USER");
|
||||
assertThat(userAuthority.getIdToken()).isEqualTo(user.getIdToken());
|
||||
assertThat(userAuthority.getUserInfo()).isEqualTo(user.getUserInfo());
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ public class DefaultOAuth2UserServiceTests {
|
||||
|
||||
assertThat(user.getAuthorities().size()).isEqualTo(1);
|
||||
assertThat(user.getAuthorities().iterator().next()).isInstanceOf(OAuth2UserAuthority.class);
|
||||
OAuth2UserAuthority userAuthority = (OAuth2UserAuthority)user.getAuthorities().iterator().next();
|
||||
OAuth2UserAuthority userAuthority = (OAuth2UserAuthority) user.getAuthorities().iterator().next();
|
||||
assertThat(userAuthority.getAuthority()).isEqualTo("ROLE_USER");
|
||||
assertThat(userAuthority.getAttributes()).isEqualTo(user.getAttributes());
|
||||
}
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class OAuth2AuthorizationRequestUriBuilderTests {
|
||||
@Test
|
||||
public void buildWhenScopeMultiThenSeparatedByEncodedSpace() {
|
||||
OAuth2AuthorizationRequest request = OAuth2AuthorizationRequest.implicit()
|
||||
.additionalParameters(Collections.singletonMap("foo","bar"))
|
||||
.additionalParameters(Collections.singletonMap("foo", "bar"))
|
||||
.authorizationUri("https://idp.example.com/oauth2/v2/auth")
|
||||
.clientId("client-id")
|
||||
.state("thestate")
|
||||
|
||||
+2
-2
@@ -75,7 +75,7 @@ public interface ClaimAccessor {
|
||||
return null;
|
||||
}
|
||||
Map<String, Object> claimValues = new HashMap<>();
|
||||
((Map<?, ?>)this.getClaims().get(claim)).forEach((k, v) -> claimValues.put(k.toString(), v));
|
||||
((Map<?, ?>) this.getClaims().get(claim)).forEach((k, v) -> claimValues.put(k.toString(), v));
|
||||
return claimValues;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public interface ClaimAccessor {
|
||||
return null;
|
||||
}
|
||||
List<String> claimValues = new ArrayList<>();
|
||||
((List<?>)this.getClaims().get(claim)).forEach(e -> claimValues.add(e.toString()));
|
||||
((List<?>) this.getClaims().get(claim)).forEach(e -> claimValues.add(e.toString()));
|
||||
return claimValues;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -33,7 +33,7 @@ import java.util.Set;
|
||||
*/
|
||||
public final class OAuth2AccessTokenResponse {
|
||||
private OAuth2AccessToken accessToken;
|
||||
private Map<String,Object> additionalParameters;
|
||||
private Map<String, Object> additionalParameters;
|
||||
|
||||
private OAuth2AccessTokenResponse() {
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public final class OAuth2AccessTokenResponse {
|
||||
private OAuth2AccessToken.TokenType tokenType;
|
||||
private long expiresIn;
|
||||
private Set<String> scopes;
|
||||
private Map<String,Object> additionalParameters;
|
||||
private Map<String, Object> additionalParameters;
|
||||
|
||||
private Builder(String tokenValue) {
|
||||
this.tokenValue = tokenValue;
|
||||
@@ -76,7 +76,7 @@ public final class OAuth2AccessTokenResponse {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder additionalParameters(Map<String,Object> additionalParameters) {
|
||||
public Builder additionalParameters(Map<String, Object> additionalParameters) {
|
||||
this.additionalParameters = additionalParameters;
|
||||
return this;
|
||||
}
|
||||
|
||||
+3
-3
@@ -49,7 +49,7 @@ public final class OAuth2AuthorizationRequest implements Serializable {
|
||||
private String redirectUri;
|
||||
private Set<String> scopes;
|
||||
private String state;
|
||||
private Map<String,Object> additionalParameters;
|
||||
private Map<String, Object> additionalParameters;
|
||||
|
||||
private OAuth2AuthorizationRequest() {
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public final class OAuth2AuthorizationRequest implements Serializable {
|
||||
private String redirectUri;
|
||||
private Set<String> scopes;
|
||||
private String state;
|
||||
private Map<String,Object> additionalParameters;
|
||||
private Map<String, Object> additionalParameters;
|
||||
|
||||
private Builder(AuthorizationGrantType authorizationGrantType) {
|
||||
Assert.notNull(authorizationGrantType, "authorizationGrantType cannot be null");
|
||||
@@ -147,7 +147,7 @@ public final class OAuth2AuthorizationRequest implements Serializable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder additionalParameters(Map<String,Object> additionalParameters) {
|
||||
public Builder additionalParameters(Map<String, Object> additionalParameters) {
|
||||
this.additionalParameters = additionalParameters;
|
||||
return this;
|
||||
}
|
||||
|
||||
+6
-6
@@ -123,12 +123,12 @@ public final class DefaultAddressStandardClaim implements AddressStandardClaim {
|
||||
}
|
||||
|
||||
public Builder(Map<String, Object> addressFields) {
|
||||
this.formatted((String)addressFields.get(FORMATTED_FIELD_NAME));
|
||||
this.streetAddress((String)addressFields.get(STREET_ADDRESS_FIELD_NAME));
|
||||
this.locality((String)addressFields.get(LOCALITY_FIELD_NAME));
|
||||
this.region((String)addressFields.get(REGION_FIELD_NAME));
|
||||
this.postalCode((String)addressFields.get(POSTAL_CODE_FIELD_NAME));
|
||||
this.country((String)addressFields.get(COUNTRY_FIELD_NAME));
|
||||
this.formatted((String) addressFields.get(FORMATTED_FIELD_NAME));
|
||||
this.streetAddress((String) addressFields.get(STREET_ADDRESS_FIELD_NAME));
|
||||
this.locality((String) addressFields.get(LOCALITY_FIELD_NAME));
|
||||
this.region((String) addressFields.get(REGION_FIELD_NAME));
|
||||
this.postalCode((String) addressFields.get(POSTAL_CODE_FIELD_NAME));
|
||||
this.country((String) addressFields.get(COUNTRY_FIELD_NAME));
|
||||
}
|
||||
|
||||
public Builder formatted(String formatted) {
|
||||
|
||||
Reference in New Issue
Block a user