-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcore.js
More file actions
129 lines (116 loc) · 2.24 KB
/
core.js
File metadata and controls
129 lines (116 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
const path = require('path');
/**
* Default name of the service
* @type {String}
*/
exports.name = 'ms-users';
/**
* Seconds to keep inactive accounts in the database
* @type {Number} seconds - defaults to 30 days;
*/
exports.deleteInactiveAccounts = 30 * 24 * 60 * 60;
/**
* Flake ids - sequential unique 64 bit ids
* NOTE: this is used for JWT issue id & should be used for the
* internal ids in the future
* @type {Object}
*/
exports.flake = {
workerID: 0,
outputType: 'base10',
};
/**
* Fill this with []<User>
* @type {Array}
*/
exports.admins = [];
/**
* To make some room for bringing up parts of services
* @type {Number}
*/
exports.initAdminAccountsDelay = {
$filter: 'env',
test: 0,
production: 1000,
};
/**
* Enables plugins. This is a minimum list
* @type {Array}
*/
exports.plugins = [
'validator',
'logger',
'router',
'amqp',
'redisCluster',
'http',
'prometheus',
];
/**
* Bunyan logger configuration
* by default only ringBuffer logger is enabled in prod
* @type {Boolean}
*/
exports.logger = {
defaultLogger: process.env.NODE_ENV === 'development',
debug: process.env.NODE_ENV === 'development',
options: {
redact: {
paths: [
'headers.cookie',
'headers.authentication',
'params.password',
'params.token',
],
},
},
};
exports.passwordValidator = {
enabled: false,
minStrength: 4, // 0..4
forceCheckFieldNames: ['checkPassword'],
skipCheckFieldNames: ['skipPassword'],
inputFieldNames: [
'username',
],
};
/**
* Local schemas for validation
* @type {Array}
*/
exports.validator = {
schemas: [path.resolve(__dirname, '../../schemas')],
ajv: {
$meta: 'ms-validation AJV schema validator options',
},
};
/**
* Default hooks
* @type {Object}
*/
exports.hooks = {};
/**
* @type {Object}
*/
exports.accessTokens = {
secret: {
$filter: 'env',
$default: 'dajskd12r1987das071241d-ar-01248120d7as-d98ays',
// NOTE: MAKE SURE TO SET THIS IN PRODUCTION
production: '',
},
};
/**
* Multi-Factor Authentication Settings
*/
exports.mfa = {
serviceName: 'microfleet.io',
length: 40,
check: {
window: 10,
},
};
exports.temporaryActivation = {
enabled: false,
validTimeMs: 10 * 24 * 60 * 60 * 1000,
};