@mimik/configuration 6.0.8 → 6.0.10
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 +2 -2
- package/index.js +4 -3
- package/package.json +11 -10
- package/.claude/settings.local.json +0 -15
- package/.husky/pre-commit +0 -2
- package/.husky/pre-push +0 -2
- package/eslint.config.js +0 -87
- package/manual-test/test-config.js +0 -48
- package/manual-test/testEnv.js +0 -21
- package/test/configuration.spec.js +0 -1038
- package/test/testEnv.js +0 -46
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ The following environment variables are being used for the configuration:
|
|
|
84
84
|
| OAUTH_GENERIC_PREVIOUS_KEY | key for the token signature before change the public key | | security.generic.previousKey | [2]
|
|
85
85
|
| OAUTH_GENERIC_AUDIENCE | url representing the generic of the service type to mST | noGeneric | security.generic.audience | [2]
|
|
86
86
|
| API_KEYS | list of API Keys which are tested against in case of APIKey security | [] |
|
|
87
|
-
| LOG_MODE | collector to be used to log events | sumologic | logInfo.mode | can be `sumologic`, `awsS3`, `all`,
|
|
87
|
+
| LOG_MODE | collector to be used to log events | sumologic | logInfo.mode | can be `sumologic`, `awsS3`, `all`, `awsKinesis`, `none`
|
|
88
88
|
| NO_STACK | disable the inclusion of the stack in all logs | yes | logInfo.noStack
|
|
89
89
|
| FILTER_FILE | path for the filter file definition | null | logInfo.filterFile |
|
|
90
90
|
| USER_DEFINITIONS_FILE | path for the custom user definitions | null | userDefinitions.file |
|
|
@@ -100,7 +100,7 @@ The following environment variables are being used for the configuration:
|
|
|
100
100
|
| MIT_AUDIENCE | audience of mIT | | dependencies.mIT.audience | [2]
|
|
101
101
|
| REGISTRATION_SET | switch to enable use of registration | on | registration.set | can be `on` or `off`
|
|
102
102
|
| REGISTRATION_RETRY | retry time for registering to mIT | 3000 | registration.retry | in milliseconds
|
|
103
|
-
| REGISTRATION_AFTER_POSTOPS_SET | switch to set the registration
|
|
103
|
+
| REGISTRATION_AFTER_POSTOPS_SET | switch to set the registration after the execution of the postOps | off | registration.afterPostOpsSet | can be `on` or `off`
|
|
104
104
|
| `$_URL`.toUpperCase() | cluster information | self | dependencies.`(SERVER_TYPE)`.url | should not be used
|
|
105
105
|
| `${configuration.serverSettings.type}_AUDIENCE`.toUpperCase() | cluster information | | dependencies.`(SERVER_TYPE)`.audience | [2], but should not be used
|
|
106
106
|
|
package/index.js
CHANGED
|
@@ -496,7 +496,7 @@ configuration.locationProvider = setupLocationProvider();
|
|
|
496
496
|
* | OAUTH_GENERIC_PREVIOUS_KEY | key for the token signature before change the public key | | security.generic.previousKey | [2]
|
|
497
497
|
* | OAUTH_GENERIC_AUDIENCE | url representing the generic of the service type to mST | noGeneric | security.generic.audience | [2]
|
|
498
498
|
* | API_KEYS | list of API Keys which are tested against in case of APIKey security | [] |
|
|
499
|
-
* | LOG_MODE | collector to be used to log events | sumologic | logInfo.mode | can be `sumologic`, `awsS3`, `all`,
|
|
499
|
+
* | LOG_MODE | collector to be used to log events | sumologic | logInfo.mode | can be `sumologic`, `awsS3`, `all`, `awsKinesis`, `none`
|
|
500
500
|
* | NO_STACK | disable the inclusion of the stack in all logs | yes | logInfo.noStack
|
|
501
501
|
* | FILTER_FILE | path for the filter file definition | null | logInfo.filterFile |
|
|
502
502
|
* | USER_DEFINITIONS_FILE | path for the custom user definitions | null | userDefinitions.file |
|
|
@@ -512,7 +512,7 @@ configuration.locationProvider = setupLocationProvider();
|
|
|
512
512
|
* | MIT_AUDIENCE | audience of mIT | | dependencies.mIT.audience | [2]
|
|
513
513
|
* | REGISTRATION_SET | switch to enable use of registration | on | registration.set | can be `on` or `off`
|
|
514
514
|
* | REGISTRATION_RETRY | retry time for registering to mIT | 3000 | registration.retry | in milliseconds
|
|
515
|
-
* | REGISTRATION_AFTER_POSTOPS_SET | switch to set the registration
|
|
515
|
+
* | REGISTRATION_AFTER_POSTOPS_SET | switch to set the registration after the execution of the postOps | off | registration.afterPostOpsSet | can be `on` or `off`
|
|
516
516
|
* | `${configuration.serverSettings.type}_URL`.toUpperCase() | cluster information | self | dependencies.`(SERVER_TYPE)`.url | should not be used
|
|
517
517
|
* | `${configuration.serverSettings.type}_AUDIENCE`.toUpperCase() | cluster information | | dependencies.`(SERVER_TYPE)`.audience | [2], but should not be used
|
|
518
518
|
*
|
|
@@ -647,7 +647,8 @@ export const setConfig = (pack, options) => {
|
|
|
647
647
|
else process.env.SWAGGER_FILE_PROVIDER = 'bitbucket';
|
|
648
648
|
}
|
|
649
649
|
|
|
650
|
-
const apiFilename = `${process.env.SWAGGER_FILE_ACCOUNT}${SWAGGER_SEP}
|
|
650
|
+
const apiFilename = `${process.env.SWAGGER_FILE_ACCOUNT}${SWAGGER_SEP}`
|
|
651
|
+
+ `${process.env.SWAGGER_FILE_NAME}${SWAGGER_SEP}${process.env.SWAGGER_FILE_VERSION}${SWAGGER_SEP}${SWAGGER_EXT}`;
|
|
651
652
|
|
|
652
653
|
configuration.serverSettings.name = process.env.SERVER_NAME;
|
|
653
654
|
configuration.serverSettings.type = process.env.SERVER_TYPE;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mimik/configuration",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.10",
|
|
4
4
|
"description": "Common configuration for mimik services",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"exports": "./index.js",
|
|
@@ -21,32 +21,33 @@
|
|
|
21
21
|
"author": "mimik technology inc <support@mimik.com> (https://developer.mimik.com/)",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": ">=24"
|
|
24
|
+
"node": ">=24.0.0"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
28
|
"url": "https://bitbucket.org/mimiktech/configuration"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@mimik/request-helper": "^2.0.
|
|
32
|
-
"@mimik/sumologic-winston-logger": "^2.
|
|
31
|
+
"@mimik/request-helper": "^2.0.6",
|
|
32
|
+
"@mimik/sumologic-winston-logger": "^2.2.2",
|
|
33
33
|
"@mimik/user-filters": "^2.0.4",
|
|
34
34
|
"ip": "2.0.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@eslint/js": "9.39.
|
|
38
|
-
"@mimik/eslint-plugin-document-env": "^2.0.
|
|
39
|
-
"@
|
|
37
|
+
"@eslint/js": "9.39.4",
|
|
38
|
+
"@mimik/eslint-plugin-document-env": "^2.0.9",
|
|
39
|
+
"@mimik/eslint-plugin-logger": "^1.0.3",
|
|
40
|
+
"@stylistic/eslint-plugin": "5.10.0",
|
|
40
41
|
"c8": "11.0.0",
|
|
41
42
|
"chai": "6.2.2",
|
|
42
|
-
"eslint": "9.39.
|
|
43
|
+
"eslint": "9.39.4",
|
|
43
44
|
"eslint-plugin-import": "2.32.0",
|
|
44
45
|
"esmock": "2.7.3",
|
|
45
|
-
"globals": "17.
|
|
46
|
+
"globals": "17.4.0",
|
|
46
47
|
"husky": "9.1.7",
|
|
47
48
|
"mocha": "11.7.5",
|
|
48
49
|
"mochawesome": "7.1.4",
|
|
49
50
|
"jsdoc-to-markdown": "9.1.3",
|
|
50
|
-
"sinon": "21.0.
|
|
51
|
+
"sinon": "21.0.3"
|
|
51
52
|
}
|
|
52
53
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(npm run lint)",
|
|
5
|
-
"Bash(cat /Users/niburger/Projects/mimik/common/response-helper-145/test/*.js)",
|
|
6
|
-
"Bash(ls -d /Users/niburger/Projects/mimik/common/*/test/)",
|
|
7
|
-
"Bash(grep -rl \"esmock\" /Users/niburger/Projects/mimik/common/*/package.json)",
|
|
8
|
-
"Bash(npm install)",
|
|
9
|
-
"Bash(npm test)",
|
|
10
|
-
"Bash(npx eslint test/)",
|
|
11
|
-
"Bash(npx eslint test/ --fix)",
|
|
12
|
-
"Bash(git status -u)"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
15
|
-
}
|
package/.husky/pre-commit
DELETED
package/.husky/pre-push
DELETED
package/eslint.config.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import globals from 'globals';
|
|
2
|
-
import importPlugin from 'eslint-plugin-import';
|
|
3
|
-
import js from '@eslint/js';
|
|
4
|
-
import processDoc from '@mimik/eslint-plugin-document-env';
|
|
5
|
-
import stylistic from '@stylistic/eslint-plugin';
|
|
6
|
-
|
|
7
|
-
const MAX_LENGTH_LINE = 180;
|
|
8
|
-
const MAX_FUNCTION_PARAMETERS = 6;
|
|
9
|
-
const MAX_LINES_IN_FILES = 600;
|
|
10
|
-
const MAX_LINES_IN_FUNCTION = 150;
|
|
11
|
-
const MAX_STATEMENTS_IN_FUNCTION = 45;
|
|
12
|
-
const MIN_KEYS_IN_OBJECT = 10;
|
|
13
|
-
const MAX_COMPLEXITY = 30;
|
|
14
|
-
const ECMA_VERSION = 'latest';
|
|
15
|
-
const MAX_DEPTH = 6;
|
|
16
|
-
const ALLOWED_CONSTANTS = [0, 1, -1];
|
|
17
|
-
|
|
18
|
-
export default [
|
|
19
|
-
{
|
|
20
|
-
ignores: ['mochawesome-report/**', 'node_modules/**', 'dist/**'],
|
|
21
|
-
},
|
|
22
|
-
importPlugin.flatConfigs.recommended,
|
|
23
|
-
stylistic.configs.recommended,
|
|
24
|
-
js.configs.all,
|
|
25
|
-
{
|
|
26
|
-
plugins: {
|
|
27
|
-
processDoc,
|
|
28
|
-
},
|
|
29
|
-
languageOptions: {
|
|
30
|
-
ecmaVersion: ECMA_VERSION,
|
|
31
|
-
globals: {
|
|
32
|
-
...globals.nodeBuiltin,
|
|
33
|
-
},
|
|
34
|
-
sourceType: 'module',
|
|
35
|
-
},
|
|
36
|
-
rules: {
|
|
37
|
-
'@stylistic/brace-style': ['warn', 'stroustrup', { allowSingleLine: true }],
|
|
38
|
-
'@stylistic/line-comment-position': ['off'],
|
|
39
|
-
'@stylistic/max-len': ['warn', MAX_LENGTH_LINE, { ignoreComments: true, ignoreStrings: true, ignoreRegExpLiterals: true }],
|
|
40
|
-
'@stylistic/quotes': ['warn', 'single'],
|
|
41
|
-
'@stylistic/semi': ['error', 'always'],
|
|
42
|
-
'capitalized-comments': ['off'],
|
|
43
|
-
'complexity': ['error', MAX_COMPLEXITY],
|
|
44
|
-
'curly': ['off'],
|
|
45
|
-
'id-length': ['error', { exceptions: ['x', 'y', 'z', 'i', 'j', 'k'] }],
|
|
46
|
-
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
|
|
47
|
-
'import/no-unresolved': ['error', { amd: true, caseSensitiveStrict: true, commonjs: true }],
|
|
48
|
-
'init-declarations': ['off'],
|
|
49
|
-
'linebreak-style': ['off'],
|
|
50
|
-
'max-depth': ['error', MAX_DEPTH],
|
|
51
|
-
'max-len': ['off'],
|
|
52
|
-
'max-lines': ['warn', { max: MAX_LINES_IN_FILES, skipComments: true, skipBlankLines: true }],
|
|
53
|
-
'max-lines-per-function': ['warn', { max: MAX_LINES_IN_FUNCTION, skipComments: true, skipBlankLines: true }],
|
|
54
|
-
'max-params': ['error', MAX_FUNCTION_PARAMETERS],
|
|
55
|
-
'max-statements': ['warn', MAX_STATEMENTS_IN_FUNCTION],
|
|
56
|
-
'no-confusing-arrow': ['off'],
|
|
57
|
-
'no-inline-comments': ['off'],
|
|
58
|
-
'no-magic-numbers': ['error', { ignore: ALLOWED_CONSTANTS, enforceConst: true, detectObjects: true }],
|
|
59
|
-
'no-process-env': ['error'],
|
|
60
|
-
'no-ternary': ['off'],
|
|
61
|
-
'no-undefined': ['off'],
|
|
62
|
-
'one-var': ['error', 'never'],
|
|
63
|
-
'processDoc/validate-document-env': ['error'],
|
|
64
|
-
'quotes': ['off'],
|
|
65
|
-
'sort-imports': ['error', { allowSeparatedGroups: true }],
|
|
66
|
-
'sort-keys': ['error', 'asc', { caseSensitive: true, minKeys: MIN_KEYS_IN_OBJECT, natural: false, allowLineSeparatedGroups: true }],
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
files: ['test/**/*.js'],
|
|
71
|
-
languageOptions: {
|
|
72
|
-
globals: {
|
|
73
|
-
...globals.mocha,
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
rules: {
|
|
77
|
-
'class-methods-use-this': ['off'],
|
|
78
|
-
'max-classes-per-file': ['off'],
|
|
79
|
-
'max-lines': ['off'],
|
|
80
|
-
'max-lines-per-function': ['off'],
|
|
81
|
-
'max-statements': ['off'],
|
|
82
|
-
'no-empty-function': ['off'],
|
|
83
|
-
'no-magic-numbers': ['off'],
|
|
84
|
-
'processDoc/validate-document-env': ['off'],
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
];
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import './testEnv.js';
|
|
3
|
-
import { setConfig } from '../index.js';
|
|
4
|
-
// import Config from '../index.js';
|
|
5
|
-
|
|
6
|
-
const pack = {
|
|
7
|
-
swaggerFile: {
|
|
8
|
-
version: '2.0.6',
|
|
9
|
-
account: 'mimiktech',
|
|
10
|
-
name: 'swagger-mds',
|
|
11
|
-
},
|
|
12
|
-
mimik: {
|
|
13
|
-
type: 'test-pack-type',
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
const config = {
|
|
17
|
-
database: {
|
|
18
|
-
type: 'mongodb',
|
|
19
|
-
table: {
|
|
20
|
-
itResource: 'itResource',
|
|
21
|
-
lease: 'lease',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
dependencies: {
|
|
25
|
-
'mIT': {
|
|
26
|
-
audience: 'test-audience',
|
|
27
|
-
url: 'test-url',
|
|
28
|
-
},
|
|
29
|
-
'test-pack-type': {
|
|
30
|
-
audience: 'test-pack-type-audience',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
security: {
|
|
34
|
-
server: {
|
|
35
|
-
id: 'test-security-id',
|
|
36
|
-
secret: 'test-security-secret',
|
|
37
|
-
accessKey: 'test-security-access-key',
|
|
38
|
-
audience: 'test-security-audience',
|
|
39
|
-
issuer: 'test-security-issuer',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
serverSettings: {
|
|
43
|
-
type: 'test-type',
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const configuration = setConfig(pack, config);
|
|
48
|
-
console.log(configuration);
|
package/manual-test/testEnv.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/* eslint no-process-env: "off" */
|
|
2
|
-
import process from 'process';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* Test configuration Configuration.
|
|
7
|
-
*
|
|
8
|
-
* @description The following environment variables are needed to configure configuration:
|
|
9
|
-
*
|
|
10
|
-
* | Env variable name | Description | Default | Comments |
|
|
11
|
-
* | ----------------- | ----------- | ------- | -------- |
|
|
12
|
-
* | DATABASE_NAME | name of the database to use for mongodb
|
|
13
|
-
* | MONGO_REPLICAT_SET | set to a value for Boolean()
|
|
14
|
-
* | SUMO_LOGIC_ENDPOINT | dummy endpoint for sumologic
|
|
15
|
-
* | SUMO_LOGIC_COLLECTOR_CODE | dummy collector code for sumologic
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
process.env.DATABASE_NAME = 'test-database-name';
|
|
19
|
-
process.env.MONGO_REPLICAT_SET = 'test-mongo-replicat-set';
|
|
20
|
-
process.env.SUMO_LOGIC_ENDPOINT = 'test-logInfo-sumologic-endpoint';
|
|
21
|
-
process.env.SUMO_LOGIC_COLLECTOR_CODE = 'test-logInfo-sumologic-code';
|