Skip to content

Commit

Permalink
docs: add note about envs to team-secret doc (#3846)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamdelion authored Oct 24, 2024
1 parent 9b4390d commit 2220aa8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/how-to/how-to-add-a-team-secret.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ This guide will demonstrate how to -
1. Get the raw secret, e.g. you might have been sent it in an email from a council officer.

### Get the encryption key
1. In `/infrastructure/application`, run `pulumi config get encryption-key --stack production`.
1. In `/infrastructure/application`, run `pulumi config get encryption-key --stack <stack_name>`.
2. This should output the encryption key in the terminal.

> [!NOTE]
> The `stack_name` should be either `production` or `staging`, depending on which environment the secret is for (e.g. `staging_govpay_secret`).
### Encrypt the secret
1. In `/scripts/encrypt`, run the encryption script using the encryption key and raw secret that you obtained in the previous steps: `pnpm encrypt <encryption-key> <secret>`.
2. This should output the encrypted secret in the terminal.
Expand All @@ -25,8 +28,11 @@ This guide will demonstrate how to -
2. In the `team_integrations` table, find the row for the relevant team and paste the encrypted secret into the correct field (e.g. `production_govpay_secret`).
3. Press save!

Note: If updating a `staging` secret, you can manually kick off the `sync-staging-db` [GitHub action](https://github.com/theopensystemslab/planx-new/actions/workflows/sync-staging-db.yml) outside of its nightly run, to ensure the secret is available on the staging environment sooner.
> [!TIP]
> If updating a `staging` secret, you can manually kick off the `sync-staging-db` [GitHub action](https://github.com/theopensystemslab/planx-new/actions/workflows/sync-staging-db.yml) outside of its nightly run, to ensure the secret is available on the staging environment sooner.
### Test

You should now prompt the team representative (e.g. council officer) to test that the secret has been successfully updated, e.g. test a flow with GovPay.

You can also test a flow yourself by adding the `Calculate` and `Pay` components into a flow within that team. If it doesn't work, you should see an error: `GOV.UK Pay is not enabled for this local authority`.

0 comments on commit 2220aa8

Please sign in to comment.