@mimik/configuration 4.4.4 → 4.4.5

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 (3) hide show
  1. package/README.md +2 -0
  2. package/index.js +9 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -99,6 +99,8 @@ The following environement variables are being used for the configuration:
99
99
 
100
100
  [2]: defined when registering to mST
101
101
 
102
+ When MST_SET is `off`, registration and cluster should not be enabled, so configuration.cluster.management and configuration.registration.set will be set to `off``
103
+
102
104
  When `sumologic` or `all` is used for `LOG_MODE` the following environment variables are used for the configuration:
103
105
 
104
106
  | Env variable name | Description | Default | Comments |
package/index.js CHANGED
@@ -17,6 +17,7 @@ const {
17
17
  AWS_S3,
18
18
  ALL,
19
19
  SET_ON,
20
+ SET_OFF,
20
21
  NO_PUBLIC_PROVIDER,
21
22
  NO_GENERIC,
22
23
  ENV_VARIABLE,
@@ -89,7 +90,7 @@ const {
89
90
  let display = true;
90
91
  const locParams = [NO_PUBLIC_PROVIDER, ENV_VARIABLE];
91
92
  const correlationIdStart = getCorrelationId('config-start');
92
- const isMSTSet = process.env.MST_SET !== 'off';
93
+ const isMSTSet = process.env.MST_SET !== SET_OFF;
93
94
 
94
95
  const setupRedis = () => {
95
96
  const domain = process.env.CACHE_IP || DEFAULT_CACHE_IP;
@@ -356,6 +357,7 @@ const configuration = {
356
357
  customerCode: process.env.CUSTOMER_CODE || DEFAULT_CUSTOMER_CODE,
357
358
  customerCodeSep: process.env.CUSTOMER_CODE ? CUSTOMER_CODE_SEP : '',
358
359
  securitySet: process.env.SERVER_SECURITY_SET || DEFAULT_SERVER_SECURITY_SET,
360
+ isMSTSet,
359
361
  port: process.env.SERVER_PORT,
360
362
  interceptError: process.env.INTERCEPT_ERROR || DEFAULT_INTERCEPT_ERROR,
361
363
  ip: {
@@ -408,6 +410,10 @@ const configuration = {
408
410
  },
409
411
  };
410
412
 
413
+ if (!isMSTSet) {
414
+ configuration.registration.set = SET_OFF;
415
+ configuration.cluster.management = SET_OFF;
416
+ }
411
417
  if (process.env.OAUTH_GENERIC_PREVIOUS_KEY) configuration.security.generic.previousKey = process.env.OAUTH_GENERIC_PREVIOUS_KEY;
412
418
  if (process.env.SWAGGER_API_KEY) configuration.serverSettings.apiKey = process.env.SWAGGER_API_KEY;
413
419
  configuration.logInfo = setupLog();
@@ -488,6 +494,8 @@ configuration.locationProvider = setupLocationProvider();
488
494
  *
489
495
  * [2]: defined when registering to mST
490
496
  *
497
+ * When MST_SET is `off`, registration and cluster should not be enabled, so configuration.cluster.management and configuration.registration.set will be set to `off``
498
+ *
491
499
  * When `sumologic` or `all` is used for `LOG_MODE` the following environment variables are used for the configuration:
492
500
  *
493
501
  * | Env variable name | Description | Default | Comments |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mimik/configuration",
3
- "version": "4.4.4",
3
+ "version": "4.4.5",
4
4
  "description": "Common configuration for mimik services",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -38,7 +38,7 @@
38
38
  "devDependencies": {
39
39
  "@mimik/eslint-plugin-dependencies": "^2.4.1",
40
40
  "@mimik/eslint-plugin-document-env": "^1.0.1",
41
- "eslint": "8.6.0",
41
+ "eslint": "8.7.0",
42
42
  "eslint-config-airbnb": "18.2.1",
43
43
  "eslint-plugin-import": "2.25.4",
44
44
  "eslint-plugin-jsx-a11y": "6.5.1",