From fec39159a440eb725f34b5f0b83fb65857bf3e63 Mon Sep 17 00:00:00 2001 From: Jo Humphrey <31373245+jamdelion@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:27:22 +0000 Subject: [PATCH] chore: setup power automate tokens for Gateshead --- .env.example | 1 + api.planx.uk/.env.test.example | 1 + api.planx.uk/modules/auth/middleware.ts | 4 ++++ docker-compose.yml | 1 + infrastructure/application/Pulumi.production.yaml | 6 ++++-- infrastructure/application/Pulumi.staging.yaml | 6 ++++-- infrastructure/application/index.ts | 4 ++++ 7 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 759d790a91..90f746b2a2 100644 --- a/.env.example +++ b/.env.example @@ -34,6 +34,7 @@ FILE_API_KEY_LAMBETH=👻 FILE_API_KEY_SOUTHWARK=👻 FILE_API_KEY_EPSOM_EWELL=👻 FILE_API_KEY_MEDWAY=👻 +FILE_API_KEY_GATESHEAD=👻 # Editor EDITOR_URL_EXT=http://localhost:3000 diff --git a/api.planx.uk/.env.test.example b/api.planx.uk/.env.test.example index bdc74b375e..60ac5e4a5d 100644 --- a/api.planx.uk/.env.test.example +++ b/api.planx.uk/.env.test.example @@ -24,6 +24,7 @@ FILE_API_KEY_LAMBETH=👻 FILE_API_KEY_SOUTHWARK=👻 FILE_API_KEY_EPSOM_EWELL=👻 FILE_API_KEY_MEDWAY=👻 +FILE_API_KEY_GATESHEAD=👻 # Editor EDITOR_URL_EXT=example.com diff --git a/api.planx.uk/modules/auth/middleware.ts b/api.planx.uk/modules/auth/middleware.ts index 5b4cdfc9d3..22e07337c8 100644 --- a/api.planx.uk/modules/auth/middleware.ts +++ b/api.planx.uk/modules/auth/middleware.ts @@ -103,6 +103,10 @@ export const useFilePermission: RequestHandler = (req, _res, next): void => { req.headers["api-key"] as string, process.env.FILE_API_KEY_MEDWAY!, ) || + isEqual( + req.headers["api-key"] as string, + process.env.FILE_API_KEY_GATESHEAD!, + ) || isEqual( req.headers["api-key"] as string, process.env.FILE_API_KEY_EPSOM_EWELL!, diff --git a/docker-compose.yml b/docker-compose.yml index b045c55b3d..5022927716 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -129,6 +129,7 @@ services: FILE_API_KEY_SOUTHWARK: ${FILE_API_KEY_SOUTHWARK} FILE_API_KEY_EPSOM_EWELL: ${FILE_API_KEY_EPSOM_EWELL} FILE_API_KEY_MEDWAY: ${FILE_API_KEY_MEDWAY} + FILE_API_KEY_GATESHEAD: ${FILE_API_KEY_GATESHEAD} FILE_API_KEY_NEXUS: ${FILE_API_KEY_NEXUS} FILE_API_KEY: ${FILE_API_KEY} GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID} diff --git a/infrastructure/application/Pulumi.production.yaml b/infrastructure/application/Pulumi.production.yaml index 6aba6b28c2..87d073744c 100644 --- a/infrastructure/application/Pulumi.production.yaml +++ b/infrastructure/application/Pulumi.production.yaml @@ -12,6 +12,8 @@ config: secure: AAABANMl+fVFsRVGXvJV/aLManXO+TldXVDhp5QH6KGWJoG7O9Ket63zIW1iOiinINWJ2I5OizI= application:file-api-key-epsom-ewell: secure: AAABANvwhiVRBq8NH7ZqcToUzYn4X+KfC5Wm8WjWUKXT5TuVXqC6zHhVVKFBbmdtKjC4j5M4+bWsLiFO9dO0MLobxLpK7YCE + application:file-api-key-gateshead: + secure: AAABAIIeEiX2htVth4Obb5JMQ3fcezHG/utwUsPikaLNmX+rSmMpGQgcG3LM1pN7XDeaO8J/eZHMilG5OvxGyz7Yo+RxVZV0 application:file-api-key-lambeth: secure: AAABAMNhdCTlFx3fZH/nO71ildypZB2JR5NixlQCENsS1VqwdiOX17q/Gi1UFrCQi2qaY2sZFG4= application:file-api-key-medway: @@ -29,10 +31,10 @@ config: secure: AAABAHfDtVpAD8w32yINWTjgvuRQixWXYFf3/rEcyh59/pRSz+J4ZYCXNq5jqBiIXM2emB+7zOY= application:hasura-cpu: "512" application:hasura-memory: "2048" - application:hasura-proxy-cpu: "512" - application:hasura-proxy-memory: "2048" application:hasura-planx-api-key: secure: AAABAExsXFL7HabeK0Z1oSUJzI2NqVqEmKJ1ojYXyX4Hi8Sbt1Ht9QJc/Yn3cPBAB2r32HKa4HtqqLmfGjS+04lFB/I= + application:hasura-proxy-cpu: "512" + application:hasura-proxy-memory: "2048" application:idox-nexus-client: secure: AAABACdm6IyRjfVPrHLCS5eKQD0ixA2lFC5h04HULwcCXx3j application:idox-nexus-submission-url: todo diff --git a/infrastructure/application/Pulumi.staging.yaml b/infrastructure/application/Pulumi.staging.yaml index 49df40ad99..06ee49d150 100644 --- a/infrastructure/application/Pulumi.staging.yaml +++ b/infrastructure/application/Pulumi.staging.yaml @@ -13,6 +13,8 @@ config: secure: AAABAFpZq81zy3CKFXUgi9oEGIGp7LDVD3TNlYkZD4liX0bxOrmMJYdDpMmyGt4aGARF63nEUmo= application:file-api-key-epsom-ewell: secure: AAABAD1/nlJ2EOEglLiiNsOLbOd3KWCONhNhJAIdZQVnrSRsNIzX2luszOreQf20EYl8AZ4L1TiheqUHSt22e5z1FiLWoCtY + application:file-api-key-gateshead: + secure: AAABAC40pz4+QnXhA2QOYP2F33dc4bCnpL0Njd6hgxR4sTtzt1xF4+2HJpMGdptL2zVrbmdH+cMzrizu6cTmGELrsAoUIEvB application:file-api-key-lambeth: secure: AAABALQTeIf/uScxASJkhmoPRhewQT94Guad4iJ7GRk0DcND8wDUG0eNxDU4+XwUQZqCnL2DP+E= application:file-api-key-medway: @@ -30,10 +32,10 @@ config: secure: AAABAHsoh7ZNkr6ep3xXsUZpp/JIjshBX+tJ0KOFgGnJ4wxR0oIcB6VewVDuwSyFJRVix72YahM= application:hasura-cpu: "512" application:hasura-memory: "2048" - application:hasura-proxy-cpu: "512" - application:hasura-proxy-memory: "2048" application:hasura-planx-api-key: secure: AAABANHLs3ItPxkteh0chwMP2bKuHO3ovuRLi4FsIrCqerzXVIaTLFDqNR+4KBTeMPz4cnF5tCTwsrJv9GruZdXU+lg= + application:hasura-proxy-cpu: "512" + application:hasura-proxy-memory: "2048" application:idox-nexus-client: secure: AAABABprDQomVM9wJQkTMTVtUKvj9lVVVJLdpEBR5p3ibZYvSMedTOb2jztPa0vm6UCH2hilyOV2fsd+akYd3sP8Up5G26mkEKSLSSN4Nc9fu/Hi3Apn1rXHnw== application:idox-nexus-submission-url: https://dev.identity.idoxgroup.com/agw/submission-api diff --git a/infrastructure/application/index.ts b/infrastructure/application/index.ts index a4754a1ab5..317d680092 100644 --- a/infrastructure/application/index.ts +++ b/infrastructure/application/index.ts @@ -377,6 +377,10 @@ export = async () => { name: "FILE_API_KEY_MEDWAY", value: config.requireSecret("file-api-key-medway"), }, + { + name: "FILE_API_KEY_GATESHEAD", + value: config.requireSecret("file-api-key-gateshead"), + }, { name: "GOOGLE_CLIENT_ID", value: config.require("google-client-id"),