From 95aebb3caf3d902c9574628699cdb11cb068ed69 Mon Sep 17 00:00:00 2001 From: Jo Humphrey <31373245+jamdelion@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:03:38 +0100 Subject: [PATCH] chore: remove BOPS_API_TOKEN (#3743) --- .env.example | 2 -- api.planx.uk/.env.test.example | 3 --- api.planx.uk/modules/send/bops/bops.ts | 2 +- api.planx.uk/server.ts | 3 +-- docker-compose.yml | 1 - infrastructure/application/Pulumi.production.yaml | 2 -- infrastructure/application/Pulumi.staging.yaml | 2 -- infrastructure/application/index.ts | 4 ---- 8 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.env.example b/.env.example index ee53588dc0..9ee369705a 100644 --- a/.env.example +++ b/.env.example @@ -69,8 +69,6 @@ PRODUCTION_PG_URL_FOR_USER_GITHUB_ACTIONS=👻 SHAREDB_PORT=7003 # Integrations (local and pull request environments point to third party staging environments) -BOPS_API_TOKEN=👻 - GOVUK_NOTIFY_API_KEY=👻 UNIFORM_TOKEN_URL=👻 diff --git a/api.planx.uk/.env.test.example b/api.planx.uk/.env.test.example index 664aa4e0b9..947deafa0b 100644 --- a/api.planx.uk/.env.test.example +++ b/api.planx.uk/.env.test.example @@ -32,9 +32,6 @@ HASURA_PLANX_API_KEY=👻 MINIO_PORT=1234 # Integrations -BOPS_API_TOKEN=👻 -BOPS_API_TOKEN=👻 - GOVUK_NOTIFY_API_KEY=testlocaldev2-👻 UNIFORM_TOKEN_URL=👻 diff --git a/api.planx.uk/modules/send/bops/bops.ts b/api.planx.uk/modules/send/bops/bops.ts index ccd8c388ac..334d9f06df 100644 --- a/api.planx.uk/modules/send/bops/bops.ts +++ b/api.planx.uk/modules/send/bops/bops.ts @@ -64,7 +64,7 @@ const sendToBOPS = async (req: Request, res: Response, next: NextFunction) => { adapter: "http", headers: { "Content-Type": "application/json", - Authorization: `Bearer ${bopsToken || process.env.BOPS_API_TOKEN}`, + Authorization: `Bearer ${bopsToken}`, }, data: exportData, }) diff --git a/api.planx.uk/server.ts b/api.planx.uk/server.ts index 53336b40c7..04730a5be0 100644 --- a/api.planx.uk/server.ts +++ b/api.planx.uk/server.ts @@ -5,7 +5,7 @@ import cookieParser from "cookie-parser"; import cookieSession from "cookie-session"; import type { CorsOptions } from "cors"; import cors from "cors"; -import type { ErrorRequestHandler, Request } from "express"; +import type { ErrorRequestHandler } from "express"; import express from "express"; import pinoLogger from "express-pino-logger"; import helmet from "helmet"; @@ -106,7 +106,6 @@ app.use(helmet()); assert(process.env.GOVUK_NOTIFY_API_KEY); assert(process.env.HASURA_PLANX_API_KEY); -assert(process.env.BOPS_API_TOKEN); assert(process.env.UNIFORM_TOKEN_URL); assert(process.env.UNIFORM_SUBMISSION_URL); diff --git a/docker-compose.yml b/docker-compose.yml index 4b222ac8e5..3a8af48c12 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -121,7 +121,6 @@ services: AWS_S3_BUCKET: ${AWS_S3_BUCKET} AWS_S3_REGION: ${AWS_S3_REGION} AWS_SECRET_KEY: ${AWS_SECRET_KEY} - BOPS_API_TOKEN: ${BOPS_API_TOKEN} # This is controlled via generateCORSAllowList() in staging and production CORS_ALLOWLIST: ${EDITOR_URL_EXT}, ${API_URL_EXT}, https://login.live.com, https://login.microsoftonline.com EDITOR_URL_EXT: ${EDITOR_URL_EXT} diff --git a/infrastructure/application/Pulumi.production.yaml b/infrastructure/application/Pulumi.production.yaml index 45c3471c54..3b86ad4a72 100644 --- a/infrastructure/application/Pulumi.production.yaml +++ b/infrastructure/application/Pulumi.production.yaml @@ -3,8 +3,6 @@ config: secure: AAABAE+ZtQZO26XlmfAS7tG1DkwQ+G5OP82Roe4EOuk/tG1bMsI= application:airbrake-project-key: secure: AAABAPIGB+gWevPn0SzWnuSuV1RmdwpLOlWKnu8cM/kxLfslvdCIRcU0n0M0XNJ3jwj4EdFn7/llsL1Kg2XnDA== - application:bops-api-token: - secure: AAABALRtSjQMRjERtkHs6WBOI7MBMw4bFOuHO8qLLPe9Pfg8Nlbp61XalZA1pmXsRt/T+59fGcdqbKA5WRkOZVibhFo= application:cloudflare-zone-id: a9b9933f28e786ec4cfd4bb596f5a519 application:encryption-key: secure: AAABAGbTpoRtazwoNFNmaPCW0RdeTqjhEzQuYR1kl4ft7EWNxqswAu8Dc9T+YBxkYr3uaHbu5obzyo8I4QuVgg== diff --git a/infrastructure/application/Pulumi.staging.yaml b/infrastructure/application/Pulumi.staging.yaml index 2aed2d8846..9ffd625e37 100644 --- a/infrastructure/application/Pulumi.staging.yaml +++ b/infrastructure/application/Pulumi.staging.yaml @@ -3,8 +3,6 @@ config: secure: AAABABxcp8r3CZAw1kXuXkwPZ8cKRDQyOg4+gVvqzKuCFWb8BEU= application:airbrake-project-key: secure: AAABABujxMHxU8Abj4QpyQTz7bLt3AP2wBFaypVkDZ2khzc6eh6lHLljTEkzpLUncno3gNNDXnrmxzXvqKnQdQ== - application:bops-api-token: - secure: AAABAJx2KnnFeuEmwRB5VyE790TeYxiKmWFuVXVY8Lb7+HDNRYND8Pfd9d61zjwPzi9Jf2ZlT0OH++1MXYafhdQO28Y= application:cloudflare-zone-id: secure: AAABAPZz/bzFCZEZd+jzPpYP4HXAOLYQmLGf2YLQE2YPfMBUtDC83KCo2l2DJ4AL4OKL+jFFx8wrrJc6DDwXJQ== application:encryption-key: diff --git a/infrastructure/application/index.ts b/infrastructure/application/index.ts index 0bcaf4dba5..950e21782f 100644 --- a/infrastructure/application/index.ts +++ b/infrastructure/application/index.ts @@ -365,10 +365,6 @@ export = async () => { value: config.requireSecret("session-secret"), }, { name: "API_URL_EXT", value: `https://api.${DOMAIN}` }, - { - name: "BOPS_API_TOKEN", - value: config.requireSecret("bops-api-token"), - }, { name: "JWT_SECRET", value: config.requireSecret("jwt-secret") }, { name: "PORT", value: String(API_PORT) }, {