Skip to content

Commit

Permalink
Fix checkstyle violations for test module in 1.2.x
Browse files Browse the repository at this point in the history
Issue gh-1624
  • Loading branch information
jgrandja committed May 23, 2024
1 parent 365ae4e commit 9d336eb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
import java.util.List;
import java.util.Set;

import jakarta.servlet.http.HttpServletRequest;

import com.nimbusds.jose.jwk.JWKSet;
import com.nimbusds.jose.jwk.source.JWKSource;
import com.nimbusds.jose.proc.SecurityContext;
import jakarta.servlet.http.HttpServletRequest;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -376,7 +375,7 @@ SecurityFilterChain authorizationServerSecurityFilterChain(
OAuth2AuthorizationServerConfigurer authorizationServerConfigurer =
new OAuth2AuthorizationServerConfigurer();
authorizationServerConfigurer
.clientAuthentication(clientAuthentication ->
.clientAuthentication((clientAuthentication) ->
clientAuthentication
.authenticationConverter(
new PublicClientRefreshTokenAuthenticationConverter())
Expand All @@ -387,10 +386,10 @@ SecurityFilterChain authorizationServerSecurityFilterChain(

http
.securityMatcher(endpointsMatcher)
.authorizeHttpRequests(authorize ->
.authorizeHttpRequests((authorize) ->
authorize.anyRequest().authenticated()
)
.csrf(csrf -> csrf.ignoringRequestMatchers(endpointsMatcher))
.csrf((csrf) -> csrf.ignoringRequestMatchers(endpointsMatcher))
.apply(authorizationServerConfigurer);
return http.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@

import javax.crypto.spec.SecretKeySpec;

import jakarta.servlet.http.HttpServletResponse;

import com.nimbusds.jose.jwk.JWKSet;
import com.nimbusds.jose.jwk.source.JWKSource;
import com.nimbusds.jose.proc.SecurityContext;
import jakarta.servlet.http.HttpServletResponse;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import org.junit.jupiter.api.AfterAll;
Expand Down Expand Up @@ -685,7 +684,7 @@ public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity h
private Consumer<List<AuthenticationProvider>> configureClientRegistrationConverters() {
// @formatter:off
return (authenticationProviders) ->
authenticationProviders.forEach(authenticationProvider -> {
authenticationProviders.forEach((authenticationProvider) -> {
List<String> supportedCustomClientMetadata = List.of("custom-metadata-name-1", "custom-metadata-name-2");
if (authenticationProvider instanceof OidcClientRegistrationAuthenticationProvider provider) {
provider.setRegisteredClientConverter(new CustomRegisteredClientConverter(supportedCustomClientMetadata));
Expand Down Expand Up @@ -769,7 +768,7 @@ PasswordEncoder passwordEncoder() {

}

private static class CustomRegisteredClientConverter
private static final class CustomRegisteredClientConverter
implements Converter<OidcClientRegistration, RegisteredClient> {

private final OidcClientRegistrationRegisteredClientConverter delegate = new OidcClientRegistrationRegisteredClientConverter();
Expand Down Expand Up @@ -799,7 +798,7 @@ public RegisteredClient convert(OidcClientRegistration clientRegistration) {

}

private static class CustomClientRegistrationConverter
private static final class CustomClientRegistrationConverter
implements Converter<RegisteredClient, OidcClientRegistration> {

private final RegisteredClientOidcClientRegistrationConverter delegate = new RegisteredClientOidcClientRegistrationConverter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ static class AuthorizationServerConfigurationWithCustomRefreshTokenGenerator

// @formatter:off
@Bean
public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception {
SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception {
OAuth2AuthorizationServerConfigurer authorizationServerConfigurer =
new OAuth2AuthorizationServerConfigurer();
http.apply(authorizationServerConfigurer);
Expand All @@ -750,10 +750,10 @@ public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity h

http
.securityMatcher(endpointsMatcher)
.authorizeHttpRequests(authorize ->
.authorizeHttpRequests((authorize) ->
authorize.anyRequest().authenticated()
)
.csrf(csrf -> csrf.ignoringRequestMatchers(endpointsMatcher));
.csrf((csrf) -> csrf.ignoringRequestMatchers(endpointsMatcher));

return http.build();
}
Expand Down

0 comments on commit 9d336eb

Please sign in to comment.