From 16d70d4d8a1a14ad87c4b493498d563a52cb1796 Mon Sep 17 00:00:00 2001 From: Gabriel Roldan Date: Wed, 4 Sep 2024 21:19:39 -0300 Subject: [PATCH] Fix typo in class names: GatewaySharedAu(t)hentication --- config | 2 +- .../GatewaySharedAuthAutoConfiguration.java | 12 ++++++------ ...> GatewaySharedAuthenticationPostFilter.java} | 8 ++++---- ...=> GatewaySharedAuthenticationPreFilter.java} | 8 ++++---- .../GatewaySharedAuthAutoConfigurationTest.java | 12 ++++++------ ...java => GatewaySharedAuthenticationTest.java} | 16 ++++++++-------- 6 files changed, 29 insertions(+), 29 deletions(-) rename src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/{GatewaySharedAuhenticationPostFilter.java => GatewaySharedAuthenticationPostFilter.java} (96%) rename src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/{GatewaySharedAuhenticationPreFilter.java => GatewaySharedAuthenticationPreFilter.java} (97%) rename src/apps/infrastructure/gateway/src/test/java/org/geoserver/cloud/security/gateway/sharedauth/{GatewaySharedAuhenticationTest.java => GatewaySharedAuthenticationTest.java} (97%) diff --git a/config b/config index e1ad364c8..e5540755c 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit e1ad364c8dc9482d1a445e7c50822d597232e4f4 +Subproject commit e5540755cc134c5a8e036914530907f321b23155 diff --git a/src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/autoconfigure/gateway/GatewaySharedAuthAutoConfiguration.java b/src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/autoconfigure/gateway/GatewaySharedAuthAutoConfiguration.java index a9b69dfc7..332c7d523 100644 --- a/src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/autoconfigure/gateway/GatewaySharedAuthAutoConfiguration.java +++ b/src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/autoconfigure/gateway/GatewaySharedAuthAutoConfiguration.java @@ -6,8 +6,8 @@ import lombok.extern.slf4j.Slf4j; -import org.geoserver.cloud.security.gateway.sharedauth.GatewaySharedAuhenticationPostFilter; -import org.geoserver.cloud.security.gateway.sharedauth.GatewaySharedAuhenticationPreFilter; +import org.geoserver.cloud.security.gateway.sharedauth.GatewaySharedAuthenticationPostFilter; +import org.geoserver.cloud.security.gateway.sharedauth.GatewaySharedAuthenticationPreFilter; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; @@ -28,12 +28,12 @@ void logEnabled() { } @Bean - GatewaySharedAuhenticationPreFilter gatewaySharedAuhenticationGlobalPreFilter() { - return new GatewaySharedAuhenticationPreFilter(); + GatewaySharedAuthenticationPreFilter gatewaySharedAuthenticationGlobalPreFilter() { + return new GatewaySharedAuthenticationPreFilter(); } @Bean - GatewaySharedAuhenticationPostFilter gatewaySharedAuhenticationGlobalPostFilter() { - return new GatewaySharedAuhenticationPostFilter(); + GatewaySharedAuthenticationPostFilter gatewaySharedAuthenticationGlobalPostFilter() { + return new GatewaySharedAuthenticationPostFilter(); } } diff --git a/src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuhenticationPostFilter.java b/src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuthenticationPostFilter.java similarity index 96% rename from src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuhenticationPostFilter.java rename to src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuthenticationPostFilter.java index b51bcf3ee..45d0516fd 100644 --- a/src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuhenticationPostFilter.java +++ b/src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuthenticationPostFilter.java @@ -27,8 +27,8 @@ import java.util.stream.Collectors; /** - * {@link GlobalFilter} working in tandem with {@link GatewaySharedAuhenticationPreFilter} to enable - * sharing the webui form-based authentication object with the other services. + * {@link GlobalFilter} working in tandem with {@link GatewaySharedAuthenticationPreFilter} to + * enable sharing the webui form-based authentication object with the other services. * *

When a user is logged in through the regular web ui's authentication form, the {@link * Authentication} object is held in the web ui's {@link WebSession}. Hence, further requests to @@ -53,10 +53,10 @@ * string for {@literal x-gsc-username}. * * @since 1.9 - * @see GatewaySharedAuhenticationPreFilter + * @see GatewaySharedAuthenticationPreFilter */ @Slf4j(topic = "org.geoserver.cloud.security.gateway.sharedauth.post") -public class GatewaySharedAuhenticationPostFilter implements GlobalFilter, Ordered { +public class GatewaySharedAuthenticationPostFilter implements GlobalFilter, Ordered { /** * @return {@link Ordered#LOWEST_PRECEDENCE}, being a post-filter, means it'll run the first diff --git a/src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuhenticationPreFilter.java b/src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuthenticationPreFilter.java similarity index 97% rename from src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuhenticationPreFilter.java rename to src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuthenticationPreFilter.java index b4318d315..11811a47b 100644 --- a/src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuhenticationPreFilter.java +++ b/src/apps/infrastructure/gateway/src/main/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuthenticationPreFilter.java @@ -29,7 +29,7 @@ import java.util.stream.Collectors; /** - * {@link GlobalFilter} working in tandem with {@link GatewaySharedAuhenticationPostFilter} to + * {@link GlobalFilter} working in tandem with {@link GatewaySharedAuthenticationPostFilter} to * enable sharing the webui form-based authentication object with the other services. * *

When a user is logged in through the regular web ui's authentication form, the {@link @@ -53,13 +53,13 @@ * impresonation attempts by removing the {@literal x-gsc-username} and {@literal x-gsc-roles} * headers from incoming requests, and appending them to proxied requests using the values taken * from the {@link WebSession}, if present (as stored by the {@link - * GatewaySharedAuhenticationPostFilter post-filter}. + * GatewaySharedAuthenticationPostFilter post-filter}. * * @since 1.9 - * @see GatewaySharedAuhenticationPostFilter + * @see GatewaySharedAuthenticationPostFilter */ @Slf4j(topic = "org.geoserver.cloud.security.gateway.sharedauth.pre") -public class GatewaySharedAuhenticationPreFilter implements GlobalFilter, Ordered { +public class GatewaySharedAuthenticationPreFilter implements GlobalFilter, Ordered { /** * @return {@link Ordered#HIGHEST_PRECEDENCE}, being a pre-filter, means it'll run the first for diff --git a/src/apps/infrastructure/gateway/src/test/java/org/geoserver/cloud/autoconfigure/gateway/GatewaySharedAuthAutoConfigurationTest.java b/src/apps/infrastructure/gateway/src/test/java/org/geoserver/cloud/autoconfigure/gateway/GatewaySharedAuthAutoConfigurationTest.java index ef8d67fca..6a65a5de9 100644 --- a/src/apps/infrastructure/gateway/src/test/java/org/geoserver/cloud/autoconfigure/gateway/GatewaySharedAuthAutoConfigurationTest.java +++ b/src/apps/infrastructure/gateway/src/test/java/org/geoserver/cloud/autoconfigure/gateway/GatewaySharedAuthAutoConfigurationTest.java @@ -6,8 +6,8 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.geoserver.cloud.security.gateway.sharedauth.GatewaySharedAuhenticationPostFilter; -import org.geoserver.cloud.security.gateway.sharedauth.GatewaySharedAuhenticationPreFilter; +import org.geoserver.cloud.security.gateway.sharedauth.GatewaySharedAuthenticationPostFilter; +import org.geoserver.cloud.security.gateway.sharedauth.GatewaySharedAuthenticationPreFilter; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; @@ -35,8 +35,8 @@ private void assertEnabled(ReactiveWebApplicationContextRunner contextRunner) { context -> assertThat(context) .hasNotFailed() - .hasSingleBean(GatewaySharedAuhenticationPreFilter.class) - .hasSingleBean(GatewaySharedAuhenticationPostFilter.class)); + .hasSingleBean(GatewaySharedAuthenticationPreFilter.class) + .hasSingleBean(GatewaySharedAuthenticationPostFilter.class)); } @Test @@ -46,8 +46,8 @@ void disableByConfig() { context -> assertThat(context) .hasNotFailed() - .doesNotHaveBean(GatewaySharedAuhenticationPreFilter.class) + .doesNotHaveBean(GatewaySharedAuthenticationPreFilter.class) .doesNotHaveBean( - GatewaySharedAuhenticationPostFilter.class)); + GatewaySharedAuthenticationPostFilter.class)); } } diff --git a/src/apps/infrastructure/gateway/src/test/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuhenticationTest.java b/src/apps/infrastructure/gateway/src/test/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuthenticationTest.java similarity index 97% rename from src/apps/infrastructure/gateway/src/test/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuhenticationTest.java rename to src/apps/infrastructure/gateway/src/test/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuthenticationTest.java index f6df504ed..2307fd385 100644 --- a/src/apps/infrastructure/gateway/src/test/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuhenticationTest.java +++ b/src/apps/infrastructure/gateway/src/test/java/org/geoserver/cloud/security/gateway/sharedauth/GatewaySharedAuthenticationTest.java @@ -52,8 +52,8 @@ import java.util.stream.Stream; /** - * Wiremock integration test for a running gateway with {@link GatewaySharedAuhenticationPreFilter} - * and {@link GatewaySharedAuhenticationPostFilter} + * Wiremock integration test for a running gateway with {@link GatewaySharedAuthenticationPreFilter} + * and {@link GatewaySharedAuthenticationPostFilter} */ @SpringBootTest( classes = GatewayApplication.class, // @@ -64,7 +64,7 @@ // @TestMethodOrder is not really needed, just used to run tests in the workflow order, but tests // are isolated @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -class GatewaySharedAuhenticationTest { +class GatewaySharedAuthenticationTest { // stub mappings in JSON format, see https://wiremock.org/docs/stubbing/ /** request stub for the webui returning the logged-in username and roles as response headers */ @@ -162,7 +162,7 @@ class GatewaySharedAuhenticationTest { */ @BeforeAll static void saveWireMock(WireMockRuntimeInfo runtimeInfo) { - GatewaySharedAuhenticationTest.wmRuntimeInfo = runtimeInfo; + GatewaySharedAuthenticationTest.wmRuntimeInfo = runtimeInfo; } /** Set up a gateway route that proxies all requests to the wiremock server */ @@ -206,7 +206,7 @@ void setUp(WireMockRuntimeInfo runtimeInfo) { /** * Make a request where the caller is trying to impersonate a user with request headers {@code - * x-gsc-username} and {@code x-gsc-roles}, verify {@link GatewaySharedAuhenticationPreFilter} + * x-gsc-username} and {@code x-gsc-roles}, verify {@link GatewaySharedAuthenticationPreFilter} * removes them from the proxy request */ @Test @@ -236,7 +236,7 @@ void preFilterRemovesIncomingSharedAuthHeaders(WireMockRuntimeInfo runtimeInfo) /** * Make a request to the wms service, once the {@code x-gsc-username} and {@code x-gsc-roles} - * are stored in the the {@link WebSession}, verify {@link GatewaySharedAuhenticationPreFilter} + * are stored in the the {@link WebSession}, verify {@link GatewaySharedAuthenticationPreFilter} * appends them as request headers to the wms service proxied request */ @Test @@ -280,7 +280,7 @@ void preFilterAppendsRequestHeadersFromSession(WireMockRuntimeInfo runtimeInfo) /** * Make a request to the webui that returns the {@code x-gsc-username} and {@code x-gsc-roles} - * response headers, verify {@link GatewaySharedAuhenticationPostFilter} saves them in the + * response headers, verify {@link GatewaySharedAuthenticationPostFilter} saves them in the * {@link WebSession} */ @Test @@ -317,7 +317,7 @@ void postFilterRemovesUserAndRolesFromSessionOnEmptyUserResponseHeader( /** * Make a call to the web-ui that returns {@code x-gsc-username} and {@code x-gsc-roles} - * headers, and verify {@link GatewaySharedAuhenticationPostFilter} does not propagate them to + * headers, and verify {@link GatewaySharedAuthenticationPostFilter} does not propagate them to * the response. */ @Test