Skip to content

Commit

Permalink
Merge pull request #1411 from govuk-one-login/BAU/local-stub-authorize
Browse files Browse the repository at this point in the history
BAU: Rework local stub to call /authorize
  • Loading branch information
dbes-gds authored Feb 29, 2024
2 parents 8ea98ab + ec7fd3f commit 5f8e2c9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile-stub
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.12.1-alpine3.16@sha256:67373bd5d90ea600cb5f0fa58d7a5a4e6ebf50b6e05c50c1d1cc22df5134db43
FROM node:18.12.1-alpine3.16@sha256:a56bbaddffb19e03fa78d0b2c88cf70ec2f8d40e30048c757fb7c17fd1e12d8d

ENV NODE_ENV "development"
ENV PORT 2000
Expand Down
6 changes: 5 additions & 1 deletion dev-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ app.get("/", (req, res) => {
console.log(`lng is: ${lngCookieValue}`);

const location = url.parse(response.headers.location, true);
const redirect = "http://localhost:3000/authorize?" + querystring.stringify(location.query)

console.log(`orch response location query is: ${redirect}`);

res.redirect(
"http://localhost:3000/?" + querystring.stringify(location.query)
redirect
);
})
.catch(function (error) {
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ services:
- SUPPORT_INTERNATIONAL_NUMBERS=${SUPPORT_INTERNATIONAL_NUMBERS}
- SUPPORT_LANGUAGE_CY=${SUPPORT_LANGUAGE_CY}
- SUPPORT_ACCOUNT_RECOVERY=${SUPPORT_ACCOUNT_RECOVERY}
- SUPPORT_AUTH_ORCH_SPLIT=${SUPPORT_AUTH_ORCH_SPLIT}
- REDIS_PORT=6379
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
restart: on-failure
networks:
- di-net
Expand Down
2 changes: 1 addition & 1 deletion local.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.12.1-alpine3.16@sha256:67373bd5d90ea600cb5f0fa58d7a5a4e6ebf50b6e05c50c1d1cc22df5134db43
FROM node:18.12.1-alpine3.16@sha256:a56bbaddffb19e03fa78d0b2c88cf70ec2f8d40e30048c757fb7c17fd1e12d8d

ENV NODE_ENV "development"
ENV PORT 3000
Expand Down
7 changes: 7 additions & 0 deletions startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ fi
echo "Stopping frontend services..."
docker-compose down

if [[ -z "${AWS_ACCESS_KEY_ID:-}" || -z "${AWS_SECRET_ACCESS_KEY:-}" ]]; then
echo "!! AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY must be set in the environment." >&2
echo "!! Configure AWS access for either gds-di-development (sandpit) or di-auth-development (authdevs)." >&2
echo "!! For gds-cli: gds aws digital-identity-dev -- ${0}" >&2
exit 1
fi

if [ $LOCAL == "1" ]; then
echo "Starting frontend local service..."
docker compose -f "docker-compose.yml" up -d --wait --no-deps redis di-auth-stub-default di-auth-stub-no-mfa
Expand Down

0 comments on commit 5f8e2c9

Please sign in to comment.