-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#32591 use reverse proxy in tests to get rid of LocalhostHttpClient
- Loading branch information
Showing
17 changed files
with
184 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
http_port 8080 | ||
https_port 8443 | ||
} | ||
localhost { | ||
reverse_proxy /isalive mock-oauth2-server:8080 | ||
} | ||
login.microsoftonline.com { | ||
tls internal | ||
reverse_proxy /common/discovery/* wiremock:8080 | ||
reverse_proxy /test-tenant-id/* mock-oauth2-server:8080 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM caddy:2.8.4 | ||
RUN apk update && apk upgrade && apk add curl | ||
COPY ./Caddyfile /etc/caddy/Caddyfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,61 @@ | ||
services: | ||
wiremock: | ||
image: local.wiremock.cdrapi | ||
container_name: wiremock-cdr-client | ||
build: ./wiremock | ||
mem_limit: 256m | ||
healthcheck: | ||
# use a mapped URL for health checking; the response is a 200 OK with a string body "OK" | ||
test: curl --fail http://localhost:8080/health || exit 1 | ||
interval: 5s | ||
retries: 5 | ||
start_period: 5s | ||
timeout: 10s | ||
ports: | ||
- "9090:8080" | ||
- "8443:8443" | ||
- "9090:8080" | ||
environment: | ||
- TZ=Europe/Zurich | ||
command: ["--verbose", "--https-port", "8443", "--global-response-templating"] | ||
networks: | ||
- cdr_client_net | ||
|
||
mock-oauth2-server: | ||
image: ghcr.io/navikt/mock-oauth2-server:2.1.9 | ||
image: ghcr.io/navikt/mock-oauth2-server:2.1.10 | ||
container_name: mock-oauth2-server-cdr-client | ||
environment: | ||
- TZ=Europe/Zurich | ||
- LOG_LEVEL=DEBUG | ||
- JSON_CONFIG_PATH=/app/config.json | ||
- SERVER_PORT=8443 | ||
ports: | ||
- "8444:8443" | ||
- SERVER_PORT=8080 | ||
volumes: | ||
- ./mockOAuth2Server/config.json:/app/config.json | ||
- ./mockOAuth2Server/mockoauth2server.p12:/app/mockoauth2server.p12 | ||
networks: | ||
- cdr_client_net | ||
|
||
caddy: | ||
depends_on: | ||
wiremock: | ||
condition: service_healthy | ||
image: local.caddy.cdrappmgr | ||
container_name: caddy-app-mgr | ||
build: ./caddy | ||
mem_limit: 256m | ||
ports: | ||
- "8443:8443" | ||
healthcheck: | ||
# checks the mock-oauth2-server's health endpoint to prove that both caddy and the mock-oauth2-server are up and running | ||
test: curl --insecure --fail https://localhost:8443/isalive || exit 1 | ||
interval: 5s | ||
retries: 5 | ||
start_period: 120s | ||
timeout: 10s | ||
networks: | ||
- cdr_client_net | ||
|
||
networks: | ||
cdr_client_net: | ||
name: cdr_client_net | ||
ipam: | ||
config: | ||
- subnet: 10.112.0.0/16 | ||
- subnet: 10.113.0.0/16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
FROM wiremock/wiremock:3.6.0-alpine | ||
FROM wiremock/wiremock:3.9.2-1-alpine | ||
|
||
RUN apk update && apk upgrade && apk add curl | ||
|
||
COPY ./mappings/* /home/wiremock/mappings/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"request": { | ||
"urlPattern": "/health", | ||
"method": "GET" | ||
}, | ||
"response": { | ||
"status": 200, | ||
"headers": { | ||
"Content-Type": "text/plain" | ||
}, | ||
"body": "OK" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.