@mimik/configuration 4.4.13 → 5.0.1

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.
package/README.md CHANGED
@@ -63,7 +63,8 @@ The following environement variables are being used for the configuration:
63
63
  | SERVER_ID | service id | uuid.v4() | serverSettings.id |
64
64
  | CUSTOMER_CODE | customer code associated with the service instance | '' | serverSettings.customerCode | empty string
65
65
  | SWAGGER_FILE_DIRECTORY | directory where the api definition is located | ./api | serverSettings.api | [1]
66
- | SWAGGER_API_KEY | key on swagger hub for provate api access | | serverSettings.apiKey
66
+ | BITBUCKET_USERNAME | username to access bitbucket read access on the swagger repos | ' ' | serverSettings.apiBasicAuth.username
67
+ | BITBUCKET_PASSWORD | password to access bitbucket read access on the swagger repos | ' ' | serverSettings.apiBasicAuth.password
67
68
  | SERVER_SECURITY_SET | switch to enable or disable the token interpretation | on | serverSettings.securitySet | only active if environment is `local`
68
69
  | INTERCEPT_ERROR | switch to use or not the errorIntercept option | on | serverSettings.interceptError | must be set to off for mID
69
70
  | SERVER_PORT | port of the server | | serverSettings.port |
package/index.js CHANGED
@@ -88,6 +88,8 @@ const {
88
88
  DEFAULT_ADMIN_EXTERNAL_ID,
89
89
  DEFAULT_SWAGGER_DIR,
90
90
  DEFAULT_INTERCEPT_ERROR,
91
+ DEFAULT_BITBUCKET_USERNAME,
92
+ DEFAULT_BITBUCKET_PASSWORD,
91
93
  } = require('./lib/common');
92
94
 
93
95
  let display = true;
@@ -442,7 +444,12 @@ if (!isMSTSet) {
442
444
  configuration.dependencies = {};
443
445
  }
444
446
  if (process.env.OAUTH_GENERIC_PREVIOUS_KEY) configuration.security.generic.previousKey = process.env.OAUTH_GENERIC_PREVIOUS_KEY;
445
- if (process.env.SWAGGER_API_KEY) configuration.serverSettings.apiKey = process.env.SWAGGER_API_KEY;
447
+ if (process.env.BITBUCKET_USERNAME) {
448
+ configuration.serverSettings.apiBasicAuth = {
449
+ username: process.env.BITBUCKET_USERNAME || DEFAULT_BITBUCKET_USERNAME,
450
+ password: process.env.BITBUCKET_PASSWORD || DEFAULT_BITBUCKET_PASSWORD,
451
+ };
452
+ }
446
453
  configuration.logInfo = setupLog();
447
454
  configuration.locationProvider = setupLocationProvider();
448
455
 
@@ -485,7 +492,8 @@ configuration.locationProvider = setupLocationProvider();
485
492
  * | SERVER_ID | service id | uuid.v4() | serverSettings.id |
486
493
  * | CUSTOMER_CODE | customer code associated with the service instance | '' | serverSettings.customerCode | empty string
487
494
  * | SWAGGER_FILE_DIRECTORY | directory where the api definition is located | ./api | serverSettings.api | [1]
488
- * | SWAGGER_API_KEY | key on swagger hub for provate api access | | serverSettings.apiKey
495
+ * | BITBUCKET_USERNAME | username to access bitbucket read access on the swagger repos | ' ' | serverSettings.apiBasicAuth.username
496
+ * | BITBUCKET_PASSWORD | password to access bitbucket read access on the swagger repos | ' ' | serverSettings.apiBasicAuth.password
489
497
  * | SERVER_SECURITY_SET | switch to enable or disable the token interpretation | on | serverSettings.securitySet | only active if environment is `local`
490
498
  * | INTERCEPT_ERROR | switch to use or not the errorIntercept option | on | serverSettings.interceptError | must be set to off for mID
491
499
  * | SERVER_PORT | port of the server | | serverSettings.port |
package/lib/common.js CHANGED
@@ -89,6 +89,9 @@ const DEFAULT_ADMIN_EXTERNAL_ID = 'admin';
89
89
 
90
90
  const DEFAULT_SWAGGER_DIR = '../api';
91
91
 
92
+ const DEFAULT_BITBUCKET_USERNAME = ' ';
93
+ const DEFAULT_BITBUCKET_PASSWORD = ' ';
94
+
92
95
  module.exports = {
93
96
  SUMOLOGIC,
94
97
  AWS_S3,
@@ -163,4 +166,6 @@ module.exports = {
163
166
  DEFAULT_ADMIN_EXTERNAL_ID,
164
167
  DEFAULT_SWAGGER_DIR,
165
168
  DEFAULT_INTERCEPT_ERROR,
169
+ DEFAULT_BITBUCKET_USERNAME,
170
+ DEFAULT_BITBUCKET_PASSWORD,
166
171
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mimik/configuration",
3
- "version": "4.4.13",
3
+ "version": "5.0.1",
4
4
  "description": "Common configuration for mimik services",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@mimik/request-helper": "^1.7.8",
34
- "@mimik/sumologic-winston-logger": "^1.6.14",
34
+ "@mimik/sumologic-winston-logger": "^1.6.15",
35
35
  "@mimik/user-filters": "1.3.6",
36
36
  "ip": "2.0.0",
37
37
  "lodash": "4.17.21",
@@ -40,7 +40,7 @@
40
40
  "devDependencies": {
41
41
  "@mimik/eslint-plugin-dependencies": "^2.4.5",
42
42
  "@mimik/eslint-plugin-document-env": "^1.0.5",
43
- "eslint": "8.36.0",
43
+ "eslint": "8.38.0",
44
44
  "eslint-config-airbnb": "19.0.4",
45
45
  "eslint-plugin-import": "2.27.5",
46
46
  "eslint-plugin-jsx-a11y": "6.7.1",