diff --git a/.env.example b/.env.example index 3169fdbe27..11d9f34b58 100644 --- a/.env.example +++ b/.env.example @@ -104,6 +104,7 @@ BOPS_SUBMISSION_URL_CAMDEN=👻 ## Gloucester BOPS_SUBMISSION_URL_GLOUCESTER=👻 +GOV_UK_PAY_TOKEN_GLOUCESTER=👻 ## Medway GOV_UK_PAY_TOKEN_MEDWAY=👻 diff --git a/api.planx.uk/.env.test.example b/api.planx.uk/.env.test.example index 877b1405bf..2dd3c6fc5d 100644 --- a/api.planx.uk/.env.test.example +++ b/api.planx.uk/.env.test.example @@ -55,6 +55,7 @@ BOPS_SUBMISSION_URL_CAMDEN=👻 ## Gloucester BOPS_SUBMISSION_URL_GLOUCESTER=👻 +GOV_UK_PAY_TOKEN_GLOUCESTER=👻 ## Medway GOV_UK_PAY_TOKEN_MEDWAY=👻 diff --git a/api.planx.uk/server.ts b/api.planx.uk/server.ts index ee394f463b..50006e9925 100644 --- a/api.planx.uk/server.ts +++ b/api.planx.uk/server.ts @@ -106,7 +106,7 @@ assert(process.env.BOPS_API_TOKEN); assert(process.env.UNIFORM_TOKEN_URL); assert(process.env.UNIFORM_SUBMISSION_URL); -// Medway has sandbox pay only, so skip assertion as this will fail in production +// Medway & Gloucester have sandbox pay only, so skip assertion as this will fail in production ["BUCKINGHAMSHIRE", "LAMBETH", "SOUTHWARK"].forEach((authority) => { assert(process.env[`GOV_UK_PAY_TOKEN_${authority}`]); }); diff --git a/docker-compose.yml b/docker-compose.yml index f9e380b099..0936aee91c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -156,6 +156,8 @@ services: UNIFORM_CLIENT_WYCOMBE: ${UNIFORM_CLIENT_WYCOMBE} # Medway GOV_UK_PAY_TOKEN_MEDWAY: ${GOV_UK_PAY_TOKEN_MEDWAY} + # Gloucester + GOV_UK_PAY_TOKEN_GLOUCESTER: ${GOV_UK_PAY_TOKEN_GLOUCESTER} sharedb: restart: unless-stopped diff --git a/infrastructure/application/Pulumi.staging.yaml b/infrastructure/application/Pulumi.staging.yaml index 785376f7be..6b59eff749 100644 --- a/infrastructure/application/Pulumi.staging.yaml +++ b/infrastructure/application/Pulumi.staging.yaml @@ -16,6 +16,8 @@ config: secure: AAABAGQuqQDU4S+vR+cQaFoa6xAeWU9clVaNonQ/dq0R8Dke+o0y7ALOmYMy4fOX4Pa6HiZl85npU/cbwy8HdMYaiA== application:gov-uk-pay-token-buckinghamshire: secure: AAABADroqKJ1/CanxoghKyCutFA8bmiPBuafrNYGNMn1H16jXiHuytHUUByTbXZZHtANciv7rkQEJosUmyay5j/ZFKu9TeS2WaIGBD913EVlv4iXDw3Y5OU2bSocROlYQm7/ + application:gov-uk-pay-token-gloucester: + secure: AAABANCvH7gf+3Bs9vZxg1QkkFUDnDnn0dn9n0UlDo3rJdF5ThFzqg4dc+mSxAyQ4OXZLPxvFmVmMY9QZNSZKGqXYSY2CJjed2GeGmQ5zHAOzSjkomxQqtpaRANAb3s7NQkn application:gov-uk-pay-token-lambeth: secure: AAABAPy5USkd8/hwq6vFXP45BXsYFUltR6gj8PoiZkOLRPUd1wgQ3Yhgc1Cyn+lb5cZrXBoVPjuVhm/UvBN82DNzRTl2TxAakCQQIrBU5xil+m9UnbY82CNSMDuEaWwMpR3C application:gov-uk-pay-token-medway: diff --git a/infrastructure/application/utils/generateTeamSecrets.ts b/infrastructure/application/utils/generateTeamSecrets.ts index 6020b17fb7..7bb906cc51 100644 --- a/infrastructure/application/utils/generateTeamSecrets.ts +++ b/infrastructure/application/utils/generateTeamSecrets.ts @@ -25,13 +25,15 @@ export const generateTeamSecrets = ( ): awsx.ecs.KeyValuePair[] => { const secrets: awsx.ecs.KeyValuePair[] = []; teams.forEach((team) => { - secrets.push({ - name: `GOV_UK_PAY_TOKEN_${name(team.name)}`, - value: - env === "sandbox" - ? "sandbox" - : config.require(`gov-uk-pay-token-${value(team.name)}`), - }); + if (team?.govPayStagingOnly && env !== "production") { + secrets.push({ + name: `GOV_UK_PAY_TOKEN_${name(team.name)}`, + value: + env === "sandbox" + ? "sandbox" + : config.require(`gov-uk-pay-token-${value(team.name)}`), + }); + } team.uniformInstances?.forEach((instance) => { secrets.push({ name: `UNIFORM_CLIENT_${name(instance)}`, diff --git a/infrastructure/common/teams.ts b/infrastructure/common/teams.ts index c677e1d692..2397350f2f 100644 --- a/infrastructure/common/teams.ts +++ b/infrastructure/common/teams.ts @@ -14,6 +14,7 @@ interface Team { name: string; // Must match "name" in the Digital Land dataset "local-authority-district" (https://www.planning.data.gov.uk/dataset/local-authority-district) uniformInstances?: string[]; + govPayStagingOnly?: boolean; }; export const teams: Team[] = [ @@ -29,6 +30,14 @@ export const teams: Team[] = [ name: "Southwark", uniformInstances: ["Southwark"] }, + { + name: "Medway", + govPayStagingOnly: true + }, + { + name: "Gloucester", + govPayStagingOnly: true + } ]; export type CustomDomains = Array<{