Skip to content

Commit

Permalink
Fix typo in class names: GatewaySharedAu(t)hentication
Browse files Browse the repository at this point in the history
  • Loading branch information
groldan committed Sep 5, 2024
1 parent 1efe00a commit 16d70d4
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion config
Submodule config updated 1 files
+32 −0 geoserver_logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>When a user is logged in through the regular web ui's authentication form, the {@link
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -46,8 +46,8 @@ void disableByConfig() {
context ->
assertThat(context)
.hasNotFailed()
.doesNotHaveBean(GatewaySharedAuhenticationPreFilter.class)
.doesNotHaveBean(GatewaySharedAuthenticationPreFilter.class)
.doesNotHaveBean(
GatewaySharedAuhenticationPostFilter.class));
GatewaySharedAuthenticationPostFilter.class));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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, //
Expand All @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 16d70d4

Please sign in to comment.