kuzzle 2.16.4 → 2.16.8

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 (44) hide show
  1. package/lib/api/controllers/authController.js +2 -2
  2. package/lib/api/controllers/collectionController.js +2 -8
  3. package/lib/api/controllers/serverController.js +27 -14
  4. package/lib/config/default.config.d.ts +13 -0
  5. package/lib/config/default.config.js +363 -362
  6. package/lib/config/index.js +7 -5
  7. package/lib/core/backend/backendConfig.d.ts +3 -3
  8. package/lib/core/backend/backendConfig.js +2 -2
  9. package/lib/model/security/profile.js +10 -10
  10. package/lib/model/security/role.js +3 -3
  11. package/lib/service/cache/redis.js +33 -0
  12. package/lib/service/storage/elasticsearch.js +6 -0
  13. package/lib/types/PasswordPolicy.d.ts +77 -0
  14. package/lib/types/PasswordPolicy.js +3 -0
  15. package/lib/types/ProfileDefinition.d.ts +48 -0
  16. package/lib/types/ProfileDefinition.js +3 -0
  17. package/lib/types/RoleDefinition.d.ts +27 -0
  18. package/lib/types/RoleDefinition.js +3 -0
  19. package/lib/types/config/DumpConfiguration.d.ts +42 -0
  20. package/lib/types/config/DumpConfiguration.js +3 -0
  21. package/lib/types/config/HttpConfiguration.d.ts +43 -0
  22. package/lib/types/config/HttpConfiguration.js +9 -0
  23. package/lib/types/config/KuzzleConfiguration.d.ts +123 -0
  24. package/lib/types/config/KuzzleConfiguration.js +3 -0
  25. package/lib/types/config/LimitsConfiguration.d.ts +111 -0
  26. package/lib/types/config/LimitsConfiguration.js +3 -0
  27. package/lib/types/config/PluginsConfiguration.d.ts +177 -0
  28. package/lib/types/config/PluginsConfiguration.js +3 -0
  29. package/lib/types/config/SecurityConfiguration.d.ts +182 -0
  30. package/lib/types/config/SecurityConfiguration.js +3 -0
  31. package/lib/types/config/ServerConfiguration.d.ts +195 -0
  32. package/lib/types/config/ServerConfiguration.js +3 -0
  33. package/lib/types/config/ServicesConfiguration.d.ts +41 -0
  34. package/lib/types/config/ServicesConfiguration.js +3 -0
  35. package/lib/types/config/StorageService/StorageServiceElasticsearchConfiguration.d.ts +217 -0
  36. package/lib/types/config/StorageService/StorageServiceElasticsearchConfiguration.js +3 -0
  37. package/lib/types/config/internalCache/InternalCacheRedisConfiguration.d.ts +111 -0
  38. package/lib/types/config/internalCache/InternalCacheRedisConfiguration.js +3 -0
  39. package/lib/types/config/publicCache/PublicCacheRedisConfiguration.d.ts +31 -0
  40. package/lib/types/config/publicCache/PublicCacheRedisConfiguration.js +3 -0
  41. package/lib/types/index.d.ts +17 -0
  42. package/lib/types/index.js +17 -0
  43. package/package-lock.json +1 -1
  44. package/package.json +1 -1
@@ -1,7 +1,10 @@
1
- 'use strict';
2
-
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const httpRoutes_js_1 = __importDefault(require("../api/httpRoutes.js"));
3
7
  /* eslint-disable sort-keys */
4
-
5
8
  /**
6
9
  * /!\ DO NOT MODIFY THIS FILE
7
10
  *
@@ -12,388 +15,386 @@
12
15
  *
13
16
  * @class KuzzleConfiguration
14
17
  */
15
- module.exports = {
16
- // @deprecated
17
- realtime: {
18
- pcreSupport: false
19
- },
20
-
21
- dump: {
22
- enabled: false,
23
- history: {
24
- coredump: 3,
25
- reports: 5
26
- },
27
- path: './dump/',
28
- gcore: 'gcore',
29
- dateFormat: 'YYYYMMDD-HHmmss',
30
- handledErrors: {
31
- enabled: true,
32
- whitelist: [
33
- 'RangeError',
34
- 'TypeError',
35
- 'KuzzleError',
36
- 'InternalError'
37
- ],
38
- minInterval: 10 * 60 * 1000
39
- }
40
- },
41
-
42
- /*
43
- routes: list of Kuzzle API exposed HTTP routes
44
- accessControlAllowOrigin: sets the Access-Control-Allow-Origin header used to
45
- send responses to the client
46
- (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)
47
- */
48
- http: {
49
- routes: require('./../api/httpRoutes'),
50
- accessControlAllowOrigin: '*',
51
- accessControlAllowOriginUseRegExp: false,
52
- accessControlAllowMethods: 'GET,POST,PUT,PATCH,DELETE,OPTIONS,HEAD',
53
- accessControlAllowHeaders: 'Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With, Content-Encoding, Content-Length, X-Kuzzle-Volatile',
54
- cookieAuthentication: true
55
- },
56
-
57
- limits: {
58
- concurrentRequests: 100,
59
- documentsFetchCount: 10000,
60
- documentsWriteCount: 200,
61
- loginsPerSecond: 1,
62
- requestsBufferSize: 50000,
63
- requestsBufferWarningThreshold: 5000,
64
- subscriptionConditionsCount: 100,
65
- subscriptionRooms: 1000000,
66
- subscriptionDocumentTTL: 259200000
67
- },
68
-
69
- application: {},
70
-
71
- plugins: {
72
- common: {
73
- failsafeMode: false,
74
- bootstrapLockTimeout: 30000,
75
- pipeWarnTime: 500,
76
- initTimeout: 10000,
77
- maxConcurrentPipes: 50,
78
- pipesBufferSize: 50000,
79
- include: [
80
- 'kuzzle-plugin-logger',
81
- 'kuzzle-plugin-auth-passport-local',
82
- ]
18
+ const defaultConfig = {
19
+ // @deprecated
20
+ realtime: {
21
+ pcreSupport: false
83
22
  },
84
- 'kuzzle-plugin-logger': {
85
- services: {
86
- stdout: {
87
- level: 'info'
23
+ dump: {
24
+ enabled: false,
25
+ history: {
26
+ coredump: 3,
27
+ reports: 5
28
+ },
29
+ path: './dump/',
30
+ gcore: 'gcore',
31
+ dateFormat: 'YYYYMMDD-HHmmss',
32
+ handledErrors: {
33
+ enabled: true,
34
+ whitelist: [
35
+ 'RangeError',
36
+ 'TypeError',
37
+ 'KuzzleError',
38
+ 'InternalError'
39
+ ],
40
+ minInterval: 10 * 60 * 1000
88
41
  }
89
- }
90
42
  },
91
- 'kuzzle-plugin-auth-passport-local': {
92
- algorithm: 'sha512',
93
- stretching: true,
94
- digest: 'hex',
95
- encryption: 'hmac',
96
- requirePassword: false,
97
- resetPasswordExpiresIn: -1,
98
- passwordPolicies: []
99
- }
100
- },
101
-
102
- repositories: {
103
- common: {
104
- cacheTTL: 1440000
105
- }
106
- },
107
-
108
- security: {
109
- restrictedProfileIds: ['default'],
110
- jwt: {
111
- algorithm: 'HS256',
112
- expiresIn: '1h',
113
- gracePeriod: 1000,
114
- maxTTL: -1,
115
- secret: null
43
+ /*
44
+ routes: list of Kuzzle API exposed HTTP routes
45
+ accessControlAllowOrigin: sets the Access-Control-Allow-Origin header used to
46
+ send responses to the client
47
+ (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)
48
+ */
49
+ http: {
50
+ routes: httpRoutes_js_1.default,
51
+ accessControlAllowOrigin: '*',
52
+ accessControlAllowOriginUseRegExp: false,
53
+ accessControlAllowMethods: 'GET,POST,PUT,PATCH,DELETE,OPTIONS,HEAD',
54
+ accessControlAllowHeaders: 'Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With, Content-Encoding, Content-Length, X-Kuzzle-Volatile',
55
+ cookieAuthentication: true
116
56
  },
117
- apiKey: {
118
- maxTTL: -1
57
+ limits: {
58
+ concurrentRequests: 100,
59
+ documentsFetchCount: 10000,
60
+ documentsWriteCount: 200,
61
+ loginsPerSecond: 1,
62
+ requestsBufferSize: 50000,
63
+ requestsBufferWarningThreshold: 5000,
64
+ subscriptionConditionsCount: 100,
65
+ subscriptionMinterms: 0,
66
+ subscriptionRooms: 1000000,
67
+ subscriptionDocumentTTL: 259200000
119
68
  },
120
- default: {
121
- role: {
122
- controllers: {
123
- '*': {
124
- actions: {
125
- '*': true
69
+ application: {},
70
+ plugins: {
71
+ common: {
72
+ failsafeMode: false,
73
+ bootstrapLockTimeout: 30000,
74
+ pipeWarnTime: 500,
75
+ initTimeout: 10000,
76
+ maxConcurrentPipes: 50,
77
+ pipesBufferSize: 50000,
78
+ include: [
79
+ 'kuzzle-plugin-logger',
80
+ 'kuzzle-plugin-auth-passport-local',
81
+ ]
82
+ },
83
+ 'kuzzle-plugin-logger': {
84
+ services: {
85
+ stdout: {
86
+ level: 'info',
87
+ addDate: true,
88
+ dateFormat: 'YYYY-MM-DD HH-mm-ss'
89
+ }
126
90
  }
127
- }
91
+ },
92
+ 'kuzzle-plugin-auth-passport-local': {
93
+ algorithm: 'sha512',
94
+ stretching: true,
95
+ digest: 'hex',
96
+ encryption: 'hmac',
97
+ requirePassword: false,
98
+ resetPasswordExpiresIn: -1,
99
+ passwordPolicies: []
128
100
  }
129
- }
130
101
  },
131
- standard: {
132
- profiles: {
133
- admin: {
134
- rateLimit: 0,
135
- policies: [ { roleId: 'admin'} ]
102
+ repositories: {
103
+ common: {
104
+ cacheTTL: 1440000
105
+ }
106
+ },
107
+ security: {
108
+ restrictedProfileIds: ['default'],
109
+ jwt: {
110
+ algorithm: 'HS256',
111
+ expiresIn: '1h',
112
+ gracePeriod: 1000,
113
+ maxTTL: -1,
114
+ secret: null
136
115
  },
137
- default: {
138
- rateLimit: 10,
139
- policies: [ { roleId: 'default'} ]
116
+ authToken: {
117
+ algorithm: 'HS256',
118
+ expiresIn: '1h',
119
+ gracePeriod: 1000,
120
+ maxTTL: -1,
121
+ secret: null
140
122
  },
141
- anonymous: {
142
- rateLimit: 200,
143
- policies: [ { roleId: 'anonymous'} ]
144
- }
145
- },
146
- roles: {
147
- admin: {
148
- controllers: {
149
- '*': {
150
- actions: {
151
- '*': true
152
- }
153
- }
154
- }
123
+ apiKey: {
124
+ maxTTL: -1
155
125
  },
156
126
  default: {
157
- controllers: {
158
- auth: {
159
- actions: {
160
- checkToken: true,
161
- getCurrentUser: true,
162
- getMyRights: true,
163
- logout: true,
164
- updateSelf: true
165
- }
166
- },
167
- server: {
168
- actions: {
169
- publicApi: true
170
- }
127
+ role: {
128
+ controllers: {
129
+ '*': {
130
+ actions: {
131
+ '*': true
132
+ }
133
+ }
134
+ }
171
135
  }
172
- }
173
136
  },
174
- anonymous: {
175
- controllers: {
176
- auth: {
177
- actions: {
178
- checkToken: true,
179
- getCurrentUser: true,
180
- getMyRights: true,
181
- login: true
182
- }
137
+ standard: {
138
+ profiles: {
139
+ admin: {
140
+ rateLimit: 0,
141
+ policies: [{ roleId: 'admin' }]
142
+ },
143
+ default: {
144
+ rateLimit: 10,
145
+ policies: [{ roleId: 'default' }]
146
+ },
147
+ anonymous: {
148
+ rateLimit: 200,
149
+ policies: [{ roleId: 'anonymous' }]
150
+ }
183
151
  },
184
- server: {
185
- actions: {
186
- publicApi: true,
187
- openapi: true
188
- }
152
+ roles: {
153
+ admin: {
154
+ controllers: {
155
+ '*': {
156
+ actions: {
157
+ '*': true
158
+ }
159
+ }
160
+ }
161
+ },
162
+ default: {
163
+ controllers: {
164
+ auth: {
165
+ actions: {
166
+ checkToken: true,
167
+ getCurrentUser: true,
168
+ getMyRights: true,
169
+ logout: true,
170
+ updateSelf: true
171
+ }
172
+ },
173
+ server: {
174
+ actions: {
175
+ publicApi: true
176
+ }
177
+ }
178
+ }
179
+ },
180
+ anonymous: {
181
+ controllers: {
182
+ auth: {
183
+ actions: {
184
+ checkToken: true,
185
+ getCurrentUser: true,
186
+ getMyRights: true,
187
+ login: true
188
+ }
189
+ },
190
+ server: {
191
+ actions: {
192
+ publicApi: true,
193
+ openapi: true
194
+ }
195
+ }
196
+ }
197
+ }
189
198
  }
190
- }
191
- }
192
- }
193
- }
194
- },
195
-
196
- server: {
197
- logs: {
198
- transports: [
199
- {
200
- transport: 'console',
201
- level: 'info',
202
- stderrLevels: [],
203
- silent: true
204
199
  }
205
- ],
206
- accessLogFormat: 'combined',
207
- accessLogIpOffset: 0
208
200
  },
209
- maxRequestSize: '1MB',
210
- port: 7512,
211
- protocols: {
212
- http: {
213
- allowCompression: true,
214
- enabled: true,
215
- maxEncodingLayers: 3,
216
- maxFormFileSize: '1MB',
217
- },
218
- mqtt: {
219
- enabled: false,
220
- allowPubSub: false,
221
- developmentMode: false,
222
- disconnectDelay: 250,
223
- requestTopic: 'Kuzzle/request',
224
- responseTopic: 'Kuzzle/response',
225
- server: {
226
- port: 1883
201
+ server: {
202
+ logs: {
203
+ transports: [
204
+ {
205
+ transport: 'console',
206
+ level: 'info',
207
+ stderrLevels: [],
208
+ silent: true
209
+ }
210
+ ],
211
+ accessLogFormat: 'combined',
212
+ accessLogIpOffset: 0
227
213
  },
228
- realtimeNotifications: true,
229
- },
230
- websocket: {
231
- enabled: true,
232
- idleTimeout: 60000,
233
- compression: false,
234
- rateLimit: 0,
235
- realtimeNotifications: true,
236
- }
237
- },
238
- strictSdkVersion: true,
239
- },
240
-
241
- services: {
242
- common: {
243
- defaultInitTimeout: 120000,
244
- retryInterval: 1000
245
- },
246
- internalCache: {
247
- backend: 'redis',
248
- clusterOptions: {
249
- enableReadyCheck: true
250
- },
251
- database: 0,
252
- node: {
253
- host: 'localhost',
254
- port: 6379
255
- },
256
- options: {},
257
- overrideDnsLookup: false
258
- },
259
- memoryStorage: {
260
- backend: 'redis',
261
- clusterOptions: {
262
- enableReadyCheck: true
263
- },
264
- database: 5,
265
- node: {
266
- host: 'localhost',
267
- port: 6379
268
- },
269
- options: {},
270
- overrideDnsLookup: false
271
- },
272
- internalIndex: {
273
- bootstrapLockTimeout: 60000
274
- },
275
- storageEngine: {
276
- aliases: ['storageEngine'],
277
- backend: 'elasticsearch',
278
- client: {
279
- node: 'http://localhost:9200'
280
- },
281
- commonMapping: {
282
- dynamic: 'false',
283
- properties: {
284
- _kuzzle_info: {
285
- properties: {
286
- author: { type: 'keyword' },
287
- createdAt: { type: 'date' },
288
- updater: { type: 'keyword' },
289
- updatedAt: { type: 'date' }
290
- }
291
- }
292
- }
293
- },
294
- internalIndex: {
295
- name: 'kuzzle',
296
- collections: {
297
- users: {
298
- dynamic: 'false',
299
- properties: {
300
- profileIds: { type: 'keyword' }
214
+ maxRequestSize: '1MB',
215
+ port: 7512,
216
+ protocols: {
217
+ http: {
218
+ allowCompression: true,
219
+ enabled: true,
220
+ maxEncodingLayers: 3,
221
+ maxFormFileSize: '1MB',
222
+ },
223
+ mqtt: {
224
+ enabled: false,
225
+ allowPubSub: false,
226
+ developmentMode: false,
227
+ disconnectDelay: 250,
228
+ requestTopic: 'Kuzzle/request',
229
+ responseTopic: 'Kuzzle/response',
230
+ server: {
231
+ port: 1883
232
+ },
233
+ realtimeNotifications: true,
234
+ },
235
+ websocket: {
236
+ enabled: true,
237
+ idleTimeout: 60000,
238
+ compression: false,
239
+ rateLimit: 0,
240
+ realtimeNotifications: true,
301
241
  }
302
- },
303
- profiles: {
304
- dynamic: 'false',
305
- properties: {
306
- tags: { type: 'keyword' },
307
- policies: {
308
- properties: {
309
- roleId: { type: 'keyword' },
310
- restrictedTo: {
311
- type: 'nested',
312
- properties: {
313
- index: { type: 'keyword' },
314
- collections: { type: 'keyword' }
242
+ },
243
+ strictSdkVersion: true,
244
+ },
245
+ services: {
246
+ common: {
247
+ defaultInitTimeout: 120000,
248
+ retryInterval: 1000
249
+ },
250
+ internalCache: {
251
+ backend: 'redis',
252
+ clusterOptions: {
253
+ enableReadyCheck: true
254
+ },
255
+ database: 0,
256
+ node: {
257
+ host: 'localhost',
258
+ port: 6379
259
+ },
260
+ options: {},
261
+ overrideDnsLookup: false
262
+ },
263
+ memoryStorage: {
264
+ backend: 'redis',
265
+ clusterOptions: {
266
+ enableReadyCheck: true
267
+ },
268
+ database: 5,
269
+ node: {
270
+ host: 'localhost',
271
+ port: 6379
272
+ },
273
+ options: {},
274
+ overrideDnsLookup: false
275
+ },
276
+ internalIndex: {
277
+ bootstrapLockTimeout: 60000
278
+ },
279
+ storageEngine: {
280
+ aliases: ['storageEngine'],
281
+ backend: 'elasticsearch',
282
+ client: {
283
+ node: 'http://localhost:9200'
284
+ },
285
+ commonMapping: {
286
+ dynamic: 'false',
287
+ properties: {
288
+ _kuzzle_info: {
289
+ properties: {
290
+ author: { type: 'keyword' },
291
+ createdAt: { type: 'date' },
292
+ updater: { type: 'keyword' },
293
+ updatedAt: { type: 'date' }
294
+ }
315
295
  }
316
- }
317
296
  }
318
- }
319
- }
320
- },
321
- roles: {
322
- dynamic: 'false',
323
- properties: {
324
- tags: { type: 'keyword' },
325
- controllers: {
326
- dynamic: 'false',
327
- properties: {}
328
- }
329
- }
330
- },
331
- validations: {
332
- properties: {
333
- index: { type: 'keyword' },
334
- collection: { type: 'keyword' },
335
- validations: {
336
- dynamic: 'false',
337
- properties: {}
338
- }
339
- }
340
- },
341
- config: {
342
- dynamic: 'false',
343
- properties: {}
344
- },
345
- 'api-keys': {
346
- dynamic: 'false',
347
- properties: {
348
- userId: { type: 'keyword' },
349
- hash: { type: 'keyword' },
350
- description: { type: 'text' },
351
- expiresAt: { type: 'long' },
352
- ttl: { type: 'keyword' },
353
- token: { type: 'keyword' }
354
- }
355
- },
356
- installations: {
357
- dynamic: 'strict',
358
- properties: {
359
- description: { type: 'text' },
360
- handler: { type: 'text' },
361
- installedAt: { type: 'date' }
362
297
  },
363
- }
298
+ internalIndex: {
299
+ name: 'kuzzle',
300
+ collections: {
301
+ users: {
302
+ dynamic: 'false',
303
+ properties: {
304
+ profileIds: { type: 'keyword' }
305
+ }
306
+ },
307
+ profiles: {
308
+ dynamic: 'false',
309
+ properties: {
310
+ tags: { type: 'keyword' },
311
+ policies: {
312
+ properties: {
313
+ roleId: { type: 'keyword' },
314
+ restrictedTo: {
315
+ type: 'nested',
316
+ properties: {
317
+ index: { type: 'keyword' },
318
+ collections: { type: 'keyword' }
319
+ }
320
+ }
321
+ }
322
+ }
323
+ }
324
+ },
325
+ roles: {
326
+ dynamic: 'false',
327
+ properties: {
328
+ tags: { type: 'keyword' },
329
+ controllers: {
330
+ dynamic: 'false',
331
+ properties: {}
332
+ }
333
+ }
334
+ },
335
+ validations: {
336
+ properties: {
337
+ index: { type: 'keyword' },
338
+ collection: { type: 'keyword' },
339
+ validations: {
340
+ dynamic: 'false',
341
+ properties: {}
342
+ }
343
+ }
344
+ },
345
+ config: {
346
+ dynamic: 'false',
347
+ properties: {}
348
+ },
349
+ 'api-keys': {
350
+ dynamic: 'false',
351
+ properties: {
352
+ userId: { type: 'keyword' },
353
+ hash: { type: 'keyword' },
354
+ description: { type: 'text' },
355
+ expiresAt: { type: 'long' },
356
+ ttl: { type: 'keyword' },
357
+ token: { type: 'keyword' }
358
+ }
359
+ },
360
+ installations: {
361
+ dynamic: 'strict',
362
+ properties: {
363
+ description: { type: 'text' },
364
+ handler: { type: 'text' },
365
+ installedAt: { type: 'date' }
366
+ },
367
+ }
368
+ }
369
+ },
370
+ maxScrollDuration: '1m',
371
+ defaults: {
372
+ onUpdateConflictRetries: 0,
373
+ scrollTTL: '15s'
374
+ }
364
375
  }
365
- },
366
- maxScrollDuration: '1m',
367
- defaults: {
368
- onUpdateConflictRetries: 0,
369
- scrollTTL: '15s'
370
- }
371
- }
372
- },
373
-
374
- stats: {
375
- enabled: true,
376
- ttl: 3600,
377
- statsInterval: 10
378
- },
379
-
380
- cluster: {
381
- activityDepth: 50,
382
- heartbeat: 2000,
383
- interface: null,
384
- ipv6: false,
385
- ip: 'private',
386
- joinTimeout: 60000,
387
- minimumNodes: 1,
388
- ports: {
389
- command: 7510,
390
- sync: 7511,
391
376
  },
392
- syncTimeout: 5000,
393
- },
394
-
395
- /** @type {DocumentSpecification} */
396
- validation: {
397
- },
398
-
377
+ stats: {
378
+ enabled: true,
379
+ ttl: 3600,
380
+ statsInterval: 10
381
+ },
382
+ cluster: {
383
+ activityDepth: 50,
384
+ heartbeat: 2000,
385
+ interface: null,
386
+ ipv6: false,
387
+ ip: 'private',
388
+ joinTimeout: 60000,
389
+ minimumNodes: 1,
390
+ ports: {
391
+ command: 7510,
392
+ sync: 7511,
393
+ },
394
+ syncTimeout: 5000,
395
+ },
396
+ /** @type {DocumentSpecification} */
397
+ validation: {},
399
398
  };
399
+ exports.default = defaultConfig;
400
+ //# sourceMappingURL=default.config.js.map