@mimik/configuration 4.4.3 → 4.4.4

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 +1 -1
  2. package/index.js +8 -8
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -50,7 +50,7 @@ The following environment variables are being setup:
50
50
  | CONSOLE_LEVEL | log level for console output | debug | logInfo.consoleLevel
51
51
  | LOG_LEVEL | log level for console output | debug | logInfo.logLevel
52
52
  | AWS_LOCAL_PROPERTIES | internal ip address to access aws instance properties | 169.254.169.254
53
- | DISABLE_MST | to setup configuration without mST and oauth token setup | no | yes/no
53
+ | MST_SET | to setup configuration without mST and oauth token setup | on | on/off
54
54
 
55
55
  The following environement variables are being used for the configuration:
56
56
 
package/index.js CHANGED
@@ -89,7 +89,7 @@ const {
89
89
  let display = true;
90
90
  const locParams = [NO_PUBLIC_PROVIDER, ENV_VARIABLE];
91
91
  const correlationIdStart = getCorrelationId('config-start');
92
- const isMSTDisabled = process.env.DISABLE_MST === 'yes';
92
+ const isMSTSet = process.env.MST_SET !== 'off';
93
93
 
94
94
  const setupRedis = () => {
95
95
  const domain = process.env.CACHE_IP || DEFAULT_CACHE_IP;
@@ -134,7 +134,7 @@ const setupRedis = () => {
134
134
  idTTL: parseInt(process.env.CACHE_API_ID_TTL, 10) || DEFAULT_CACHE_API_ID_TTL,
135
135
  optionTTL: parseInt(process.env.CACHE_API_OPTION_TTL, 10) || DEFAULT_CACHE_API_OPTION_TTL,
136
136
  },
137
- isMSTDisabled,
137
+ isMSTSet,
138
138
  };
139
139
  };
140
140
 
@@ -370,7 +370,7 @@ const configuration = {
370
370
  admin: {
371
371
  externalId: process.env.ADMIN_EXTERNAL_ID || DEFAULT_ADMIN_EXTERNAL_ID,
372
372
  },
373
- server: isMSTDisabled ? {} : {
373
+ server: !isMSTSet ? {} : {
374
374
  id: process.env.OAUTH_CLIENT_ID,
375
375
  secret: process.env.OAUTH_CLIENT_SECRET,
376
376
  accessKey: process.env.OAUTH_CLIENT_ACCESS_KEY,
@@ -396,7 +396,7 @@ const configuration = {
396
396
  topic: {
397
397
  set: process.env.TOPIC_SET || DEFAULT_TOPIC_SET,
398
398
  },
399
- dependencies: isMSTDisabled ? {} : { // everyserver will resport to mIT unless mST setup is disabled
399
+ dependencies: !isMSTSet ? {} : { // every server will report to mIT unless mST setup is disabled
400
400
  mIT: {
401
401
  url: process.env.MIT_URL,
402
402
  audience: process.env.MIT_AUDIENCE,
@@ -439,7 +439,7 @@ configuration.locationProvider = setupLocationProvider();
439
439
  * | CONSOLE_LEVEL | log level for console output | debug | logInfo.consoleLevel
440
440
  * | LOG_LEVEL | log level for console output | debug | logInfo.logLevel
441
441
  * | AWS_LOCAL_PROPERTIES | internal ip address to access aws instance properties | 169.254.169.254
442
- * | DISABLE_MST | to setup configuration without mST and oauth token setup | no | yes/no
442
+ * | MST_SET | to setup configuration without mST and oauth token setup | on | on/off
443
443
  *
444
444
  * The following environement variables are being used for the configuration:
445
445
  *
@@ -615,7 +615,7 @@ const setConfig = (pack, options) => {
615
615
  url: process.env[`${configuration.serverSettings.type}_URL`.toUpperCase()] || 'self', // this url should never be needed
616
616
  };
617
617
 
618
- if (!isMSTDisabled) configuration.dependencies[configuration.serverSettings.type].audience = process.env[`${configuration.serverSettings.type}_AUDIENCE`.toUpperCase()];
618
+ if (isMSTSet) configuration.dependencies[configuration.serverSettings.type].audience = process.env[`${configuration.serverSettings.type}_AUDIENCE`.toUpperCase()];
619
619
 
620
620
  if (options.database) {
621
621
  if (options.database.type === 'mongodb') {
@@ -650,8 +650,8 @@ const setConfig = (pack, options) => {
650
650
  }
651
651
  if (options.dependencies) {
652
652
  Object.keys(options.dependencies).forEach((dependency) => {
653
- if (!isMSTDisabled) {
654
- configuration.dependencies[dependency] = options.dependencies[dependency].apiKey;
653
+ if (isMSTSet) {
654
+ configuration.dependencies[dependency] = options.dependencies[dependency];
655
655
  }
656
656
  else if (options.dependencies[dependency].apiKey) {
657
657
  configuration.dependencies[dependency] = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mimik/configuration",
3
- "version": "4.4.3",
3
+ "version": "4.4.4",
4
4
  "description": "Common configuration for mimik services",
5
5
  "main": "index.js",
6
6
  "scripts": {