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

docs: add note about envs to team-secret doc #3846

Merged
merged 2 commits into from
Oct 24, 2024
Merged
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
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`.
Loading