diff --git a/envoy-control-tests/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/JWTFilterTest.kt b/envoy-control-tests/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/JWTFilterTest.kt index 960fe9d1d..cde3777a4 100644 --- a/envoy-control-tests/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/JWTFilterTest.kt +++ b/envoy-control-tests/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/JWTFilterTest.kt @@ -93,6 +93,9 @@ class JWTFilterTest { incoming: unlistedEndpointsPolicy: blockAndLog endpoints: + - path: '/unprotected' + clients: ['echo2'] + unlistedClientsPolicy: blockAndLog - path: '/first-provider-protected' clients: ['echo2'] unlistedClientsPolicy: blockAndLog @@ -205,6 +208,22 @@ class JWTFilterTest { envoy.waitForReadyServices("oauth") } + @Test + fun `should allow request without jwt for unprotected endpoint`() { + + // given + registerEnvoyServiceAndWait() + + // when + val response = echo2Envoy.egressOperations.callService( + service = "echo", + pathAndQuery = "/unprotected" + ) + + // then + assertThat(response).isOk().isFrom(service) + } + @Test fun `should reject request without jwt`() {