@govuk-pay/cli 0.0.51 → 0.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/package.json +2 -1
  2. package/readme.md +11 -0
  3. package/src/commands/secrets/config/config.types.js +45 -0
  4. package/src/commands/secrets/config/secrets/pay_low_pass/deploy-7.js +9 -0
  5. package/src/commands/secrets/config/secrets/pay_low_pass/deploy-tooling.js +18 -0
  6. package/src/commands/secrets/config/secrets/pay_low_pass/deploy.js +64 -0
  7. package/src/commands/secrets/config/secrets/pay_low_pass/dev.js +13 -0
  8. package/src/commands/secrets/config/secrets/pay_low_pass/production-2.js +104 -0
  9. package/src/commands/secrets/config/secrets/pay_low_pass/production.js +8 -0
  10. package/src/commands/secrets/config/secrets/pay_low_pass/staging-2.js +98 -0
  11. package/src/commands/secrets/config/secrets/pay_low_pass/staging.js +8 -0
  12. package/src/commands/secrets/config/secrets/pay_low_pass/test-12.js +101 -0
  13. package/src/commands/secrets/config/secrets/pay_low_pass/test-perf-1.js +98 -0
  14. package/src/commands/secrets/config/secrets/pay_low_pass/test.js +13 -0
  15. package/src/commands/secrets/config/secrets/pay_low_pass.js +27 -0
  16. package/src/commands/secrets/config/secrets/ssm.js +4 -0
  17. package/src/commands/secrets/config/secrets/value/deploy-tooling.js +10 -0
  18. package/src/commands/secrets/config/secrets/value/deploy.js +20 -0
  19. package/src/commands/secrets/config/secrets/value/production-2.js +45 -0
  20. package/src/commands/secrets/config/secrets/value/staging-2.js +47 -0
  21. package/src/commands/secrets/config/secrets/value/test-12.js +47 -0
  22. package/src/commands/secrets/config/secrets/value/test-perf-1.js +49 -0
  23. package/src/commands/secrets/config/secrets/value.js +17 -0
  24. package/src/commands/secrets/config/secrets.js +83 -0
  25. package/src/commands/secrets/config/service_secrets.js +238 -0
  26. package/src/commands/secrets/providers/factory.js +36 -0
  27. package/src/commands/secrets/providers/pass_repo.js +65 -0
  28. package/src/commands/secrets/providers/providers.types.js +21 -0
  29. package/src/commands/secrets/providers/ssm.js +155 -0
  30. package/src/commands/secrets/providers/value.js +10 -0
  31. package/src/commands/secrets/subcommands/audit.js +41 -9
  32. package/src/commands/secrets/subcommands/fetch.js +36 -15
  33. package/src/commands/secrets/subcommands/provision.js +99 -7
  34. package/src/commands/secrets.js +1 -1
  35. package/src/core/commandRouter.js +1 -0
  36. package/src/core/standardContent.js +5 -1
  37. package/src/util/configs.js +7 -1
  38. package/src/commands/secrets/subcommands/copy.js +0 -35
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TEST_CONFIG = void 0;
4
+ exports.TEST_CONFIG = {
5
+ alb_and_s3_logging_pipeline: {
6
+ firehose_hec_token: 'splunk/firehose-hec-token'
7
+ },
8
+ codebuild: {
9
+ 'docker-username': 'dockerhub/concourse-username',
10
+ 'docker-access-token': 'dockerhub/concourse-access-token',
11
+ 'github-access-token': 'alphagov-pay-ci-concourse/github.com-concourse-github-personal-access-token'
12
+ }
13
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PAY_LOW_PASS_CONFIG = void 0;
4
+ const deploy_7_1 = require("./pay_low_pass/deploy-7");
5
+ const deploy_1 = require("./pay_low_pass/deploy");
6
+ const deploy_tooling_1 = require("./pay_low_pass/deploy-tooling");
7
+ const dev_1 = require("./pay_low_pass/dev");
8
+ const production_2_1 = require("./pay_low_pass/production-2");
9
+ const production_1 = require("./pay_low_pass/production");
10
+ const staging_2_1 = require("./pay_low_pass/staging-2");
11
+ const staging_1 = require("./pay_low_pass/staging");
12
+ const test_12_1 = require("./pay_low_pass/test-12");
13
+ const test_1 = require("./pay_low_pass/test");
14
+ const test_perf_1_1 = require("./pay_low_pass/test-perf-1");
15
+ exports.PAY_LOW_PASS_CONFIG = {
16
+ deploy: deploy_1.DEPLOY_CONFIG,
17
+ 'deploy-7': deploy_7_1.DEPLOY_7_CONFIG,
18
+ 'deploy-tooling': deploy_tooling_1.DEPLOY_TOOLING_CONFIG,
19
+ dev: dev_1.DEV_CONFIG,
20
+ production: production_1.PRODUCTION_CONFIG,
21
+ 'production-2': production_2_1.PRODUCTION_2_CONFIG,
22
+ staging: staging_1.STAGING_CONFIG,
23
+ 'staging-2': staging_2_1.STAGING_2_CONFIG,
24
+ test: test_1.TEST_CONFIG,
25
+ 'test-12': test_12_1.TEST_12_CONFIG,
26
+ 'test-perf-1': test_perf_1_1.TEST_PERF_1_CONFIG
27
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SSM_CONFIG = void 0;
4
+ exports.SSM_CONFIG = {};
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEPLOY_TOOLING_CONFIG = void 0;
4
+ exports.DEPLOY_TOOLING_CONFIG = {
5
+ 'pact-broker': {
6
+ DB_SUPPORT_USER_READONLY: 'pact_broker_support_readonly',
7
+ DB_SUPPORT_USER_READWRITE: 'pact_broker_support_readwrite',
8
+ DB_USER: 'pact_broker'
9
+ }
10
+ };
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEPLOY_CONFIG = void 0;
4
+ exports.DEPLOY_CONFIG = {
5
+ 'cd-pay-dev': {
6
+ pay_aws_deploy_account_id: '424875624006',
7
+ pay_aws_dev_account_id: '673337093959',
8
+ pay_aws_staging_account_id: '888564216586',
9
+ pay_aws_test_account_id: '223851549868'
10
+ },
11
+ 'cd-pay-deploy': {
12
+ 'internal-vulnerability-scan/jira-base-url': 'https://payments-platform.atlassian.net',
13
+ 'pay-team-manual/github-username': 'alphagov-pay-ci-concourse',
14
+ pay_aws_deploy_account_id: '424875624006',
15
+ pay_aws_prod_account_id: '092359438320',
16
+ pay_aws_production_account_id: '092359438320',
17
+ pay_aws_staging_account_id: '888564216586',
18
+ pay_aws_test_account_id: '223851549868'
19
+ }
20
+ };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PRODUCTION_2_CONFIG = void 0;
4
+ exports.PRODUCTION_2_CONFIG = {
5
+ adminusers: {
6
+ DB_SUPPORT_USER_READONLY: 'adminusers_support_readonly',
7
+ DB_SUPPORT_USER_READWRITE: 'adminusers_support_readwrite',
8
+ DB_USER: 'adminusers1',
9
+ NOTIFY_SECRET: ''
10
+ },
11
+ connector: {
12
+ DB_SUPPORT_USER_READONLY: 'connector_support_readonly',
13
+ DB_SUPPORT_USER_READWRITE: 'connector_support_readwrite',
14
+ DB_USER: 'connector2',
15
+ NOTIFY_SECRET: ''
16
+ },
17
+ frontend: {
18
+ AB_TEST_THRESHOLD: '50'
19
+ },
20
+ ledger: {
21
+ DB_SUPPORT_USER_READONLY: 'ledger_support_readonly',
22
+ DB_SUPPORT_USER_READWRITE: 'ledger_support_readwrite',
23
+ DB_USER: 'ledger'
24
+ },
25
+ publicauth: {
26
+ DB_SUPPORT_USER_READONLY: 'publicauth_support_readonly',
27
+ DB_SUPPORT_USER_READWRITE: 'publicauth_support_readwrite',
28
+ DB_USER: 'publicauth1'
29
+ },
30
+ products: {
31
+ DB_SUPPORT_USER_READONLY: 'products_support_readonly',
32
+ DB_SUPPORT_USER_READWRITE: 'products_support_readwrite',
33
+ DB_USER: 'products'
34
+ },
35
+ toolbox: {
36
+ AUTH_GITHUB_ADMIN_TEAM_ID: '3320243',
37
+ AUTH_GITHUB_USER_SUPPORT_TEAM_ID: '3304532',
38
+ AUTH_GITHUB_VIEW_ONLY_TEAM_ID: '7196958'
39
+ },
40
+ webhooks: {
41
+ DB_SUPPORT_USER_READONLY: 'webhooks_support_readonly',
42
+ DB_SUPPORT_USER_READWRITE: 'webhooks_support_readwrite',
43
+ DB_USER: 'webhooks'
44
+ }
45
+ };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STAGING_2_CONFIG = void 0;
4
+ exports.STAGING_2_CONFIG = {
5
+ adminusers: {
6
+ DB_SUPPORT_USER_READONLY: 'adminusers_support_readonly',
7
+ DB_SUPPORT_USER_READWRITE: 'adminusers_support_readwrite',
8
+ DB_USER: 'adminusers1',
9
+ NOTIFY_SECRET: ''
10
+ },
11
+ connector: {
12
+ DB_SUPPORT_USER_READONLY: 'connector_support_readonly',
13
+ DB_SUPPORT_USER_READWRITE: 'connector_support_readwrite',
14
+ DB_USER: 'connector1',
15
+ NOTIFY_SECRET: ''
16
+ },
17
+ frontend: {
18
+ AB_TEST_THRESHOLD: '50',
19
+ GOOGLE_PAY_MERCHANT_ID: 'value-not-set',
20
+ GOOGLE_PAY_MERCHANT_ID_2: 'value-not-set'
21
+ },
22
+ ledger: {
23
+ DB_SUPPORT_USER_READONLY: 'ledger_support_readonly',
24
+ DB_SUPPORT_USER_READWRITE: 'ledger_support_readwrite',
25
+ DB_USER: 'ledger'
26
+ },
27
+ publicauth: {
28
+ DB_SUPPORT_USER_READONLY: 'publicauth_support_readonly',
29
+ DB_SUPPORT_USER_READWRITE: 'publicauth_support_readwrite',
30
+ DB_USER: 'publicauth1'
31
+ },
32
+ products: {
33
+ DB_SUPPORT_USER_READONLY: 'products_support_readonly',
34
+ DB_SUPPORT_USER_READWRITE: 'products_support_readwrite',
35
+ DB_USER: 'products'
36
+ },
37
+ toolbox: {
38
+ AUTH_GITHUB_ADMIN_TEAM_ID: '3304500',
39
+ AUTH_GITHUB_USER_SUPPORT_TEAM_ID: '3304500',
40
+ AUTH_GITHUB_VIEW_ONLY_TEAM_ID: '3304500'
41
+ },
42
+ webhooks: {
43
+ DB_SUPPORT_USER_READONLY: 'webhooks_support_readonly',
44
+ DB_SUPPORT_USER_READWRITE: 'webhooks_support_readwrite',
45
+ DB_USER: 'webhooks'
46
+ }
47
+ };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TEST_12_CONFIG = void 0;
4
+ exports.TEST_12_CONFIG = {
5
+ adminusers: {
6
+ DB_SUPPORT_USER_READONLY: 'adminusers_support_readonly',
7
+ DB_SUPPORT_USER_READWRITE: 'adminusers_support_readwrite',
8
+ DB_USER: 'adminusers1',
9
+ NOTIFY_SECRET: ''
10
+ },
11
+ connector: {
12
+ DB_SUPPORT_USER_READONLY: 'connector_support_readonly',
13
+ DB_SUPPORT_USER_READWRITE: 'connector_support_readwrite',
14
+ DB_USER: 'connector2',
15
+ NOTIFY_SECRET: ''
16
+ },
17
+ frontend: {
18
+ AB_TEST_THRESHOLD: '50',
19
+ GOOGLE_PAY_MERCHANT_ID: 'value-not-set',
20
+ GOOGLE_PAY_MERCHANT_ID_2: 'value-not-set'
21
+ },
22
+ ledger: {
23
+ DB_SUPPORT_USER_READONLY: 'ledger_support_readonly',
24
+ DB_SUPPORT_USER_READWRITE: 'ledger_support_readwrite',
25
+ DB_USER: 'ledger'
26
+ },
27
+ products: {
28
+ DB_SUPPORT_USER_READONLY: 'products_support_readonly',
29
+ DB_SUPPORT_USER_READWRITE: 'products_support_readwrite',
30
+ DB_USER: 'products'
31
+ },
32
+ publicauth: {
33
+ DB_SUPPORT_USER_READONLY: 'publicauth_support_readonly',
34
+ DB_SUPPORT_USER_READWRITE: 'publicauth_support_readwrite',
35
+ DB_USER: 'publicauth1'
36
+ },
37
+ toolbox: {
38
+ AUTH_GITHUB_ADMIN_TEAM_ID: '3304536',
39
+ AUTH_GITHUB_USER_SUPPORT_TEAM_ID: '3304536',
40
+ AUTH_GITHUB_VIEW_ONLY_TEAM_ID: '3304536'
41
+ },
42
+ webhooks: {
43
+ DB_SUPPORT_USER_READONLY: 'webhooks_support_readonly',
44
+ DB_SUPPORT_USER_READWRITE: 'webhooks_support_readwrite',
45
+ DB_USER: 'webhooks'
46
+ }
47
+ };
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TEST_PERF_1_CONFIG = void 0;
4
+ exports.TEST_PERF_1_CONFIG = {
5
+ adminusers: {
6
+ DB_SUPPORT_USER_READONLY: 'adminusers_support_readonly',
7
+ DB_SUPPORT_USER_READWRITE: 'adminusers_support_readwrite',
8
+ DB_USER: 'adminusers',
9
+ NOTIFY_SECRET: ''
10
+ },
11
+ connector: {
12
+ DB_SUPPORT_USER_READONLY: 'connector_support_readonly',
13
+ DB_SUPPORT_USER_READWRITE: 'connector_support_readwrite',
14
+ DB_USER: 'connector',
15
+ NOTIFY_SECRET: ''
16
+ },
17
+ frontend: {
18
+ AB_TEST_THRESHOLD: '50',
19
+ GOOGLE_PAY_MERCHANT_ID: 'value-not-set',
20
+ GOOGLE_PAY_MERCHANT_ID_2: 'value-not-set'
21
+ },
22
+ ledger: {
23
+ DB_SUPPORT_USER_READONLY: 'ledger_support_readonly',
24
+ DB_SUPPORT_USER_READWRITE: 'ledger_support_readwrite',
25
+ DB_USER: 'ledger'
26
+ },
27
+ publicauth: {
28
+ DB_SUPPORT_USER_READONLY: 'publicauth_support_readonly',
29
+ DB_SUPPORT_USER_READWRITE: 'publicauth_support_readwrite',
30
+ DB_USER: 'publicauth'
31
+ },
32
+ products: {
33
+ DB_SUPPORT_USER_READONLY: 'products_support_readonly',
34
+ DB_SUPPORT_USER_READWRITE: 'products_support_readwrite',
35
+ DB_USER: 'products'
36
+ },
37
+ toolbox: {
38
+ AUTH_GITHUB_ADMIN_TEAM_ID: '3304536',
39
+ AUTH_GITHUB_CLIENT_ID: '',
40
+ AUTH_GITHUB_CLIENT_SECRET: '',
41
+ AUTH_GITHUB_USER_SUPPORT_TEAM_ID: '3304536',
42
+ AUTH_GITHUB_VIEW_ONLY_TEAM_ID: '3304536'
43
+ },
44
+ webhooks: {
45
+ DB_SUPPORT_USER_READONLY: 'webhooks_support_readonly',
46
+ DB_SUPPORT_USER_READWRITE: 'webhooks_support_readwrite',
47
+ DB_USER: 'webhooks'
48
+ }
49
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VALUE_CONFIG = void 0;
4
+ const deploy_1 = require("./value/deploy");
5
+ const deploy_tooling_1 = require("./value/deploy-tooling");
6
+ const production_2_1 = require("./value/production-2");
7
+ const staging_2_1 = require("./value/staging-2");
8
+ const test_12_1 = require("./value/test-12");
9
+ const test_perf_1_1 = require("./value/test-perf-1");
10
+ exports.VALUE_CONFIG = {
11
+ deploy: deploy_1.DEPLOY_CONFIG,
12
+ 'deploy-tooling': deploy_tooling_1.DEPLOY_TOOLING_CONFIG,
13
+ 'production-2': production_2_1.PRODUCTION_2_CONFIG,
14
+ 'staging-2': staging_2_1.STAGING_2_CONFIG,
15
+ 'test-12': test_12_1.TEST_12_CONFIG,
16
+ 'test-perf-1': test_perf_1_1.TEST_PERF_1_CONFIG
17
+ };
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSecretConfig = exports.configuredSecretsForServiceInEnv = exports.SECRET_SOURCE_PRECEDENCE = exports.SECRETS = void 0;
4
+ const pay_low_pass_1 = require("./secrets/pay_low_pass");
5
+ const config_types_1 = require("./config.types");
6
+ const service_secrets_1 = require("./service_secrets");
7
+ const ssm_1 = require("./secrets/ssm");
8
+ const value_1 = require("./secrets/value");
9
+ exports.SECRETS = {
10
+ ssm: ssm_1.SSM_CONFIG,
11
+ 'pay-low-pass': pay_low_pass_1.PAY_LOW_PASS_CONFIG,
12
+ value: value_1.VALUE_CONFIG
13
+ };
14
+ /* This precedence will define the order which secrets should be loaded
15
+ * The earlier in the array the higher precendence. This allows easy
16
+ * overridding using a value temporarily while developing or testing
17
+ */
18
+ exports.SECRET_SOURCE_PRECEDENCE = [
19
+ 'value',
20
+ 'pay-low-pass',
21
+ 'ssm'
22
+ ];
23
+ if (exports.SECRET_SOURCE_PRECEDENCE.length !== Object.keys(exports.SECRETS).length) {
24
+ console.error(`There are a different number of secrets sources in ${__filename} than there are sources contained in the SECRET_SOURCE_PRECEDENCE list`);
25
+ process.exit(1);
26
+ }
27
+ for (const secretSource of config_types_1.SECRET_SOURCES) {
28
+ if (!exports.SECRET_SOURCE_PRECEDENCE.includes(secretSource)) {
29
+ console.error(`The secret source ${secretSource} is not configured in the SECRET_SOURCE_PRECEDENCE in ${__filename}`);
30
+ process.exit(1);
31
+ }
32
+ }
33
+ function configuredSecretsForServiceInEnv(env, service) {
34
+ const serviceSecrets = service_secrets_1.SERVICE_SECRETS[service];
35
+ return serviceSecrets.map((secretName) => {
36
+ return getSecretConfig(env, service, secretName);
37
+ });
38
+ }
39
+ exports.configuredSecretsForServiceInEnv = configuredSecretsForServiceInEnv;
40
+ function getSecretConfig(env, service, secretName) {
41
+ if (!service_secrets_1.SERVICE_SECRETS[service].includes(secretName)) {
42
+ console.error(`The secret ${secretName} is not configured for the service ${service} in service_secrets.ts`);
43
+ process.exit(1);
44
+ }
45
+ const providersWithValidConfigs = [];
46
+ for (const [secretSource, environmentConfig] of Object.entries(exports.SECRETS)) {
47
+ if (environmentConfig[env]?.[service]?.[secretName] !== undefined) {
48
+ providersWithValidConfigs.push(secretSource);
49
+ }
50
+ }
51
+ if (providersWithValidConfigs.length === 0) {
52
+ console.error(`The secret ${secretName} was not found for the environment ${env} in any secret source within secrets.ts`);
53
+ process.exit(1);
54
+ }
55
+ if (providersWithValidConfigs.length > 1) {
56
+ console.warn(`The secret ${secretName} is configured in multiple secrets sources for the environment ${env} in secrets.ts. It was found for ${providersWithValidConfigs.join(',')}`);
57
+ console.warn(`Continuing and selecting the secret from providers with this precendence (earlier is higher precendence): ${exports.SECRET_SOURCE_PRECEDENCE.join(',')}`);
58
+ }
59
+ const selectedSource = highestPrecedenceSecretSourceOf(providersWithValidConfigs);
60
+ if (selectedSource === undefined) {
61
+ throw new Error(`Resolution of source provider for secret ${secretName} for ${service} in ${env} failed in an unexpected way`);
62
+ }
63
+ const secretSourceValue = exports.SECRETS[selectedSource]?.[env]?.[service]?.[secretName];
64
+ if (secretSourceValue === undefined) {
65
+ throw new Error(`After a secret secret ${secretName} was determined to exist in ${selectedSource} for ${service} in ${env} it failed to be loaded.`);
66
+ }
67
+ return {
68
+ environment: env,
69
+ name: secretName,
70
+ secretSourceValue,
71
+ service,
72
+ source: selectedSource
73
+ };
74
+ }
75
+ exports.getSecretConfig = getSecretConfig;
76
+ function highestPrecedenceSecretSourceOf(sources) {
77
+ for (const source of exports.SECRET_SOURCE_PRECEDENCE) {
78
+ if (sources.includes(source)) {
79
+ return source;
80
+ }
81
+ }
82
+ return undefined;
83
+ }
@@ -0,0 +1,238 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SECRET_NAMES = exports.SERVICE_SECRETS = void 0;
4
+ exports.SERVICE_SECRETS = {
5
+ adminusers: [
6
+ 'DB_PASSWORD',
7
+ 'DB_SUPPORT_PASSWORD_READONLY',
8
+ 'DB_SUPPORT_PASSWORD_READWRITE',
9
+ 'DB_SUPPORT_USER_READONLY',
10
+ 'DB_SUPPORT_USER_READWRITE',
11
+ 'DB_USER',
12
+ 'NOTIFY_API_KEY',
13
+ 'NOTIFY_SECRET',
14
+ 'SENTRY_DSN'
15
+ ],
16
+ alb_and_s3_logging_pipeline: [
17
+ 'firehose_hec_token'
18
+ ],
19
+ 'amazon-managed-prometheus': [
20
+ 'pager_duty_cloudwatch_integration_url_24_7_p1',
21
+ 'pager_duty_cloudwatch_integration_url_in_hours_only'
22
+ ],
23
+ cardid: [
24
+ 'SENTRY_DSN'
25
+ ],
26
+ 'cd-main': [
27
+ 'docker-access-token',
28
+ 'docker-email',
29
+ 'docker-password',
30
+ 'docker-username',
31
+ 'slack-notification-secret'
32
+ ],
33
+ 'cd-pay-deploy': [
34
+ 'docker-access-token',
35
+ 'docker-email',
36
+ 'docker-password',
37
+ 'docker-username',
38
+ 'end-to-end/docker-access-token',
39
+ 'end-to-end/docker-email',
40
+ 'end-to-end/docker-password',
41
+ 'end-to-end/docker-username',
42
+ 'github-access-token',
43
+ 'grafana-annotations-password',
44
+ 'internal-vulnerability-scan/jira-api-token',
45
+ 'internal-vulnerability-scan/jira-api-username',
46
+ 'internal-vulnerability-scan/jira-base-url',
47
+ 'pact-broker-password',
48
+ 'pact-broker-username',
49
+ 'pact-broker/pact-broker-password',
50
+ 'pact-broker/pact-broker-username',
51
+ 'pay_aws_deploy_account_id',
52
+ 'pay_aws_prod_account_id',
53
+ 'pay_aws_production_account_id',
54
+ 'pay_aws_staging_account_id',
55
+ 'pay_aws_test_account_id',
56
+ 'slack-notification-secret'
57
+ ],
58
+ 'cd-pay-dev': [
59
+ 'docker-access-token',
60
+ 'docker-email',
61
+ 'docker-password',
62
+ 'docker-username',
63
+ 'github-access-token',
64
+ 'grafana-annotations-password',
65
+ 'pact-broker-password',
66
+ 'pact-broker-username',
67
+ 'pay-js-commons/github-access-token',
68
+ 'pay_aws_deploy_account_id',
69
+ 'pay_aws_dev_account_id',
70
+ 'pay_aws_staging_account_id',
71
+ 'pay_aws_test_account_id',
72
+ 'pr-ci/github-access-token',
73
+ 'slack-notification-secret',
74
+ 'smartpay-expected-password',
75
+ 'smartpay-expected-user',
76
+ 'worldpay-expected-password',
77
+ 'worldpay-expected-user'
78
+ ],
79
+ codebuild: [
80
+ 'docker-access-token',
81
+ 'docker-username',
82
+ 'github-access-token'
83
+ ],
84
+ connector: [
85
+ 'DB_PASSWORD',
86
+ 'DB_SUPPORT_PASSWORD_READONLY',
87
+ 'DB_SUPPORT_PASSWORD_READWRITE',
88
+ 'DB_SUPPORT_USER_READONLY',
89
+ 'DB_SUPPORT_USER_READWRITE',
90
+ 'DB_USER',
91
+ 'GDS_CONNECTOR_STRIPE_AUTH_LIVE_TOKEN',
92
+ 'GDS_CONNECTOR_STRIPE_AUTH_TOKEN',
93
+ 'GDS_CONNECTOR_STRIPE_CONNECT_APPLICATION_WEBHOOK_LIVE_SIGN_SECRET',
94
+ 'GDS_CONNECTOR_STRIPE_CONNECT_APPLICATION_WEBHOOK_TEST_SIGN_SECRET',
95
+ 'GDS_CONNECTOR_STRIPE_WEBHOOK_LIVE_SIGN_SECRET',
96
+ 'GDS_CONNECTOR_STRIPE_WEBHOOK_SIGN_SECRET',
97
+ 'NOTIFY_API_KEY',
98
+ 'NOTIFY_SECRET',
99
+ 'SANDBOX_AUTH_TOKEN',
100
+ 'SENTRY_DSN',
101
+ 'WORLDPAY_APPLE_PAY_PAYMENT_PROCESSING_CERTIFICATE',
102
+ 'WORLDPAY_APPLE_PAY_PAYMENT_PROCESSING_CERTIFICATE_SECONDARY',
103
+ 'WORLDPAY_APPLE_PAY_PAYMENT_PROCESSING_PRIVATE_KEY',
104
+ 'WORLDPAY_APPLE_PAY_PAYMENT_PROCESSING_PRIVATE_KEY_SECONDARY'
105
+ ],
106
+ deploy: [
107
+ 'PAGER_DUTY_CLOUDWATCH_INTEGRATION_URL',
108
+ 'PAGER_DUTY_CLOUDWATCH_INTEGRATION_URL_STAGING'
109
+ ],
110
+ frontend: [
111
+ 'AB_TEST_THRESHOLD',
112
+ 'GOOGLE_PAY_MERCHANT_ID',
113
+ 'GOOGLE_PAY_MERCHANT_ID_2',
114
+ 'SENTRY_CSP_REPORT_URI',
115
+ 'SENTRY_DSN',
116
+ 'SESSION_ENCRYPTION_KEY',
117
+ 'SESSION_ENCRYPTION_KEY_2',
118
+ 'STRIPE_APPLE_PAY_MERCHANT_ID',
119
+ 'STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE',
120
+ 'STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY',
121
+ 'STRIPE_LIVE_PUBLISHABLE_API_KEY',
122
+ 'STRIPE_TEST_PUBLISHABLE_API_KEY',
123
+ 'WORLDPAY_APPLE_PAY_MERCHANT_ID',
124
+ 'WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE',
125
+ 'WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY'
126
+ ],
127
+ ledger: [
128
+ 'DB_PASSWORD',
129
+ 'DB_SUPPORT_PASSWORD_READONLY',
130
+ 'DB_SUPPORT_PASSWORD_READWRITE',
131
+ 'DB_SUPPORT_USER_READONLY',
132
+ 'DB_SUPPORT_USER_READWRITE',
133
+ 'DB_USER',
134
+ 'SENTRY_DSN'
135
+ ],
136
+ network: [
137
+ 'PAGER_DUTY_CLOUDWATCH_ALB_INTEGRATION_URL'
138
+ ],
139
+ 'pact-broker': [
140
+ 'DB_PASSWORD',
141
+ 'DB_SUPPORT_PASSWORD_READONLY',
142
+ 'DB_SUPPORT_PASSWORD_READWRITE',
143
+ 'DB_SUPPORT_USER_READONLY',
144
+ 'DB_SUPPORT_USER_READWRITE',
145
+ 'DB_USER',
146
+ 'master_db_password',
147
+ 'master_db_user'
148
+ ],
149
+ 'pact-broker-auth': [
150
+ 'pact-broker-basic-auth-password',
151
+ 'pact-broker-basic-auth-username'
152
+ ],
153
+ 'product-page': [
154
+ 'pager_duty_cloudwatch_integration_url'
155
+ ],
156
+ products: [
157
+ 'DB_PASSWORD',
158
+ 'DB_SUPPORT_PASSWORD_READONLY',
159
+ 'DB_SUPPORT_PASSWORD_READWRITE',
160
+ 'DB_SUPPORT_USER_READONLY',
161
+ 'DB_SUPPORT_USER_READWRITE',
162
+ 'DB_USER',
163
+ 'SENTRY_DSN'
164
+ ],
165
+ 'products-ui': [
166
+ 'GOOGLE_RECAPTCHA_ENTERPRISE_PROJECT_ID',
167
+ 'GOOGLE_RECAPTCHA_SECRET_KEY',
168
+ 'GOOGLE_RECAPTCHA_SITE_KEY',
169
+ 'SENTRY_DSN',
170
+ 'SESSION_ENCRYPTION_KEY'
171
+ ],
172
+ publicapi: [
173
+ 'SENTRY_DSN'
174
+ /*
175
+ These secrets are used by the app, but having them set to an empty string tries to overwrite working secrets with
176
+ the words 'Password Store'. They are not in pay-low-pass, so for now to stop them being overwritten I'm commenting them out
177
+ 'TOKEN_API_HMAC_SECRET',
178
+ */
179
+ ],
180
+ publicauth: [
181
+ 'DB_PASSWORD',
182
+ 'DB_SUPPORT_PASSWORD_READONLY',
183
+ 'DB_SUPPORT_PASSWORD_READWRITE',
184
+ 'DB_SUPPORT_USER_READONLY',
185
+ 'DB_SUPPORT_USER_READWRITE',
186
+ 'DB_USER',
187
+ 'SENTRY_DSN'
188
+ /*
189
+ These secrets are used by the app, but having them set to an empty string tries to overwrite working secrets with
190
+ the words 'Password Store'. They are not in pay-low-pass, so for now to stop them being overwritten I'm commenting them out
191
+ 'TOKEN_API_HMAC_SECRET',
192
+ 'TOKEN_DB_BCRYPT_SALT',
193
+ */
194
+ ],
195
+ selfservice: [
196
+ 'SENTRY_DSN',
197
+ 'SESSION_ENCRYPTION_KEY',
198
+ 'STRIPE_ACCOUNT_API_KEY',
199
+ 'ZENDESK_API_KEY',
200
+ 'ZENDESK_USER'
201
+ ],
202
+ stubs: [
203
+ 'smartpay-expected-password',
204
+ 'smartpay-expected-user',
205
+ 'worldpay-expected-password',
206
+ 'worldpay-expected-user'
207
+ ],
208
+ toolbox: [
209
+ 'AUTH_GITHUB_ADMIN_TEAM_ID',
210
+ 'AUTH_GITHUB_CLIENT_ID',
211
+ 'AUTH_GITHUB_CLIENT_SECRET',
212
+ 'AUTH_GITHUB_USER_SUPPORT_TEAM_ID',
213
+ 'AUTH_GITHUB_VIEW_ONLY_TEAM_ID',
214
+ 'SENTRY_DSN',
215
+ 'STRIPE_ACCOUNT_API_KEY',
216
+ 'STRIPE_ACCOUNT_TEST_API_KEY',
217
+ 'ZENDESK_API_KEY',
218
+ 'ZENDESK_USER'
219
+ ],
220
+ webhooks: [
221
+ 'DB_PASSWORD',
222
+ 'DB_SUPPORT_PASSWORD_READONLY',
223
+ 'DB_SUPPORT_PASSWORD_READWRITE',
224
+ 'DB_SUPPORT_USER_READONLY',
225
+ 'DB_SUPPORT_USER_READWRITE',
226
+ 'DB_USER',
227
+ 'SENTRY_DSN'
228
+ ],
229
+ webhooks_intrusion_monitoring: [
230
+ 'pager_duty_cloudwatch_integration_url'
231
+ ],
232
+ worldpay_secure_file_gateway: [
233
+ 'passphrase',
234
+ 'private-key',
235
+ 'public-key'
236
+ ]
237
+ };
238
+ exports.SECRET_NAMES = Object.values(exports.SERVICE_SECRETS).flat();
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.providerFor = void 0;
4
+ const pass_repo_1 = require("./pass_repo");
5
+ const ssm_1 = require("./ssm");
6
+ const value_1 = require("./value");
7
+ const providers = {
8
+ ssm: {},
9
+ 'pay-low-pass': {},
10
+ value: {}
11
+ };
12
+ function providerFor(secretConfig) {
13
+ let memoisedProvider = providers[secretConfig.source][secretConfig.environment];
14
+ if (memoisedProvider === undefined) {
15
+ switch (secretConfig.source) {
16
+ case 'pay-low-pass': {
17
+ memoisedProvider = new pass_repo_1.PassRepoProvider(secretConfig.environment, secretConfig.source);
18
+ break;
19
+ }
20
+ case 'value': {
21
+ memoisedProvider = new value_1.ValueProvider(secretConfig.environment, secretConfig.source);
22
+ break;
23
+ }
24
+ case 'ssm': {
25
+ memoisedProvider = new ssm_1.SSMProvider(secretConfig.environment, secretConfig.source);
26
+ break;
27
+ }
28
+ }
29
+ providers[secretConfig.source][secretConfig.environment] = memoisedProvider;
30
+ }
31
+ if (memoisedProvider === undefined) {
32
+ throw new Error(`Failed to retrieve, or create a provider for the secret ${secretConfig.secretSourceValue} in ${secretConfig.environment} from the ${secretConfig.source} provider`);
33
+ }
34
+ return memoisedProvider;
35
+ }
36
+ exports.providerFor = providerFor;