Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: setup staging GOV_UK_PAY_TOKEN_GLOUCESTER #2706

Merged
merged 4 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading