Skip to content

Commit 586e7e9

Browse files
VIA-345 AJ/SB Modify /authorize endpoint to redirect to test app static url
1 parent 14ef6b3 commit 586e7e9

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

infrastructure/environments/test/fake-api/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ COPY --chmod=0755 <<EOF /entrypoint.sh
1010
set -e
1111

1212
export LOGIN_ROOT_URL=\${LOGIN_ROOT_URL:-'http://api.test.vita.internal'}
13+
export APP_ROOT_URL=\${APP_ROOT_URL:-'http://app.test.vita.internal'}
1314
export ELID_DELAY_SECONDS=\${ELID_DELAY_SECONDS:-0}
1415
export APIM_DELAY_SECONDS=\${APIM_DELAY_SECONDS:-0}
1516

16-
envsubst '\$LOGIN_ROOT_URL \$ELID_DELAY_SECONDS \$APIM_DELAY_SECONDS' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
17+
envsubst '\$LOGIN_ROOT_URL \$APP_ROOT_URL \$ELID_DELAY_SECONDS \$APIM_DELAY_SECONDS' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
1718

1819
exec "\$@"
1920
EOF

infrastructure/environments/test/fake-api/nginx.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ server {
77
sub_filter_types application/json;
88

99
set $login_root_url "${LOGIN_ROOT_URL}";
10+
set $app_root_url "${APP_ROOT_URL}";
1011

1112
location /eligibility-signposting-api/patient-check/ {
1213
access_by_lua_block { ngx.sleep(${ELID_DELAY_SECONDS}) }
@@ -38,7 +39,7 @@ server {
3839
}
3940

4041
location = /authorize {
41-
return 302 'https://localhost:3000/api/auth/callback/nhs-login?code=2345&$args';
42+
return 302 '$app_root_url/api/auth/callback/nhs-login?code=2345&$args';
4243
}
4344

4445
location = /token {

infrastructure/environments/test/fake-api/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ docker build --no-cache -t fake-api .
1919

2020
docker stop local-fake-api
2121

22-
docker run -d --rm -p 9123:9123 -e LOGIN_ROOT_URL="http://localhost:9123" -e ELID_DELAY_SECONDS=1 -e APIM_DELAY_SECONDS=1 --name local-fake-api fake-api
22+
docker run -d --rm -p 9123:9123 -e LOGIN_ROOT_URL="http://localhost:9123" -e APP_ROOT_URL="https://localhost:3000" -e ELID_DELAY_SECONDS=1 -e APIM_DELAY_SECONDS=1 --name local-fake-api fake-api
2323

2424
docker logs local-fake-api --follow | less +F # If you need to see what's going on in nginx
2525

@@ -72,7 +72,7 @@ docker tag fake-api:latest "$fake_api_ecr_repository_url":latest
7272

7373
docker push "$fake_api_ecr_repository_url":latest
7474

75-
aws ecs update-service --cluster fake-api-ecs-cluster --service fake-api-ecs-service --force-new-deployment --profile vita-dev --region eu-west-2
75+
aws ecs update-service --cluster fake-api-project-cluster --service fake-api --force-new-deployment --profile vita-test --region eu-west-2
7676
```
7777

7878
### Check it's working

0 commit comments

Comments
 (0)