Skip to content

Commit

Permalink
Added unprotected oauth endpoint in oauth e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubpieta committed Feb 13, 2025
1 parent 55d9dbe commit 3706536
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ class JWTFilterTest {
incoming:
unlistedEndpointsPolicy: blockAndLog
endpoints:
- path: '/unprotected'
clients: ['echo2']
unlistedClientsPolicy: blockAndLog
- path: '/first-provider-protected'
clients: ['echo2']
unlistedClientsPolicy: blockAndLog
Expand Down Expand Up @@ -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`() {

Expand Down

0 comments on commit 3706536

Please sign in to comment.