Skip to content

Commit

Permalink
chore: setup staging GOV_UK_PAY_TOKEN_GLOUCESTER (#2706)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Heneghan authored Jan 26, 2024
1 parent 3743eb2 commit 2bc7b7b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ BOPS_SUBMISSION_URL_CAMDEN=👻

## Gloucester
BOPS_SUBMISSION_URL_GLOUCESTER=👻
GOV_UK_PAY_TOKEN_GLOUCESTER=👻

## Medway
GOV_UK_PAY_TOKEN_MEDWAY=👻
Expand Down
1 change: 1 addition & 0 deletions api.planx.uk/.env.test.example
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ BOPS_SUBMISSION_URL_CAMDEN=👻

## Gloucester
BOPS_SUBMISSION_URL_GLOUCESTER=👻
GOV_UK_PAY_TOKEN_GLOUCESTER=👻

## Medway
GOV_UK_PAY_TOKEN_MEDWAY=👻
2 changes: 1 addition & 1 deletion api.planx.uk/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`]);
});
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions infrastructure/application/Pulumi.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 9 additions & 7 deletions infrastructure/application/utils/generateTeamSecrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`,
Expand Down
9 changes: 9 additions & 0 deletions infrastructure/common/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
Expand All @@ -29,6 +30,14 @@ export const teams: Team[] = [
name: "Southwark",
uniformInstances: ["Southwark"]
},
{
name: "Medway",
govPayStagingOnly: true
},
{
name: "Gloucester",
govPayStagingOnly: true
}
];

export type CustomDomains = Array<{
Expand Down

0 comments on commit 2bc7b7b

Please sign in to comment.