Skip to content

Commit

Permalink
fixed?
Browse files Browse the repository at this point in the history
  • Loading branch information
tpmcgowan committed Sep 22, 2023
1 parent 338eb5d commit e239d24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"start": "node $NODE_OPTIONS dist/server.js | bunyan -o short",
"start:dev": "concurrently -k -p \"[{name}]\" -n \"Views,TypeScript,Node,Sass\" -c \"yellow.bold,cyan.bold,green.bold,blue.bold\" \"npm run watch-views\" \"npm run watch-ts\" \"npm run watch-node\" \"npm run watch-sass\"",
"oidc-wiremock": "curl --silent --output /dev/null -X POST --data \"@./integration_tests/mockApis/mappings/openid-configuration.json\" http://localhost:9091/__admin/mappings",
"start-feature": "npm run oidc-wiremock && export $(cat feature.env) && node $NODE_DEBUG_OPTION dist/server.js | bunyan -o short",
"watch-node-feature": "npm run oidc-wiremock && export $(cat feature.env) && nodemon --watch dist/ $NODE_DEBUG_OPTION dist/server.js | bunyan -o short",
"start-feature": "npm run oidc-wiremock && export GOVUK_ONE_LOGIN_PRIVATE_KEY=$(cat integration_tests/testKeys/client_private_key.pem) && export $(cat feature.env) && node $NODE_DEBUG_OPTION dist/server.js | bunyan -o short",
"watch-node-feature": "npm run oidc-wiremock && export GOVUK_ONE_LOGIN_PRIVATE_KEY=$(cat integration_tests/testKeys/client_private_key.pem) && export $(cat feature.env) && nodemon --watch dist/ $NODE_DEBUG_OPTION dist/server.js | bunyan -o short",
"start-feature:dev": "concurrently -k -p \"[{name}]\" -n \"Views,TypeScript,Node,Sass\" -c \"yellow.bold,cyan.bold,green.bold,blue.bold\" \"npm run watch-views\" \"npm run watch-ts\" \"npm run watch-node-feature\" \"npm run watch-sass\"",
"lint": "eslint . --cache --max-warnings 0",
"typecheck": "tsc && tsc -p integration_tests",
Expand Down
8 changes: 1 addition & 7 deletions server/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import fs from 'fs'

const production = process.env.NODE_ENV === 'production'

function get<T>(name: string, fallback: T, options = { requireInProduction: false }): T | string {
Expand Down Expand Up @@ -65,11 +63,7 @@ export default {
govukOneLogin: {
url: get('GOVUK_ONE_LOGIN_URL', 'http://localhost:9091/govukOneLogin', requiredInProduction),
clientId: get('GOVUK_ONE_LOGIN_CLIENT_ID', 'clientId', requiredInProduction),
privateKey: get(
'GOVUK_ONE_LOGIN_PRIVATE_KEY',
fs.readFileSync('integration_tests/testKeys/client_private_key.pem').toString(),
requiredInProduction,
),
privateKey: get('GOVUK_ONE_LOGIN_PRIVATE_KEY', 'privateKey', requiredInProduction),
},
tokenVerification: {
url: get('TOKEN_VERIFICATION_API_URL', 'http://localhost:8100', requiredInProduction),
Expand Down

0 comments on commit e239d24

Please sign in to comment.