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
@@ -0,0 +1,41 @@
1
+ import { PublicCacheRedisConfiguration, InternalCacheConfiguration, StorageServiceElasticsearch } from '../index';
2
+ export declare type ServicesConfiguration = {
3
+ common: {
4
+ /**
5
+ * Time in ms after which a service is considered failing if
6
+ * it has not init.
7
+ *
8
+ * @default 120000
9
+ */
10
+ defaultInitTimeout: number;
11
+ /**
12
+ * Default interval in ms between Kuzzle tries to init
13
+ * the service again on first failure.
14
+ *
15
+ * @default 1000
16
+ */
17
+ retryInterval: number;
18
+ };
19
+ /**
20
+ * The database engine used for Kuzzle internal index
21
+ */
22
+ internalCache: InternalCacheConfiguration;
23
+ memoryStorage: PublicCacheRedisConfiguration;
24
+ /**
25
+ * The database engine used for Kuzzle internal index
26
+ */
27
+ internalIndex: {
28
+ /**
29
+ * Maximum amount of time (in milliseconds)
30
+ * to wait for a concurrent database bootstrap
31
+ *
32
+ * @default 60000
33
+ */
34
+ bootstrapLockTimeout: number;
35
+ };
36
+ /**
37
+ * The default storage layer is Elasticsearch and it is
38
+ * currently the only storage layer we support.
39
+ */
40
+ storageEngine: StorageServiceElasticsearch;
41
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ServicesConfiguration.js.map
@@ -0,0 +1,217 @@
1
+ import { JSONObject } from '../../../../index';
2
+ export declare type StorageServiceElasticsearch = {
3
+ /**
4
+ * @default ['storageEngine']
5
+ */
6
+ aliases: string[];
7
+ /**
8
+ * @default "elasticsearch"
9
+ */
10
+ backend: 'elasticsearch';
11
+ /**
12
+ * Elasticsearch constructor options. Use this field to specify your
13
+ * Elasticsearch config options, this object is passed through to the
14
+ * Elasticsearch constructor and can contain all options/keys outlined here:
15
+ * @see https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-configuration.html
16
+ *
17
+ */
18
+ client: JSONObject;
19
+ /**
20
+ * Default policy against new fields that are not referenced in the
21
+ * collection mapping.
22
+ * The value of this configuration will change Elasticsearch behavior
23
+ * on fields that are not declared in the collection mapping.
24
+ * - "true": Stores document and update the collection mapping with
25
+ * inferred type
26
+ * - "false": Stores document and does not update the collection
27
+ * mapping (field are not indexed)
28
+ * - "strict": Rejects document
29
+ * @see https://www.elastic.co/guide/en/elasticsearch/reference/7.4/dynamic-mapping.html
30
+ */
31
+ commonMapping: {
32
+ /**
33
+ * @default "false"
34
+ */
35
+ dynamic: 'true' | 'false' | 'strict';
36
+ properties: {
37
+ _kuzzle_info: {
38
+ properties: {
39
+ /**
40
+ * @default
41
+ *
42
+ * [
43
+ * {
44
+ * type: 'keyword',
45
+ * }
46
+ * ]
47
+ */
48
+ author: {
49
+ type: string;
50
+ };
51
+ /**
52
+ * @default
53
+ *
54
+ * [
55
+ * {
56
+ * type: 'date',
57
+ * }
58
+ * ]
59
+ */
60
+ createdAt: {
61
+ type: string;
62
+ };
63
+ /**
64
+ * @default
65
+ *
66
+ * [
67
+ * {
68
+ * type: 'keyword',
69
+ * }
70
+ * ]
71
+ */
72
+ updater: {
73
+ type: string;
74
+ };
75
+ /**
76
+ * @default
77
+ *
78
+ * [
79
+ * {
80
+ * type: 'date',
81
+ * }
82
+ * ]
83
+ */
84
+ updatedAt: {
85
+ type: string;
86
+ };
87
+ };
88
+ };
89
+ };
90
+ };
91
+ internalIndex: {
92
+ /**
93
+ * @default "kuzzle"
94
+ */
95
+ name: string;
96
+ collections: {
97
+ users: {
98
+ /**
99
+ * @default 'false'
100
+ */
101
+ dynamic: 'true' | 'false' | 'strict';
102
+ properties: {
103
+ /**
104
+ * @default
105
+ *
106
+ * [
107
+ * {
108
+ * type: 'keyword',
109
+ * }
110
+ * ]
111
+ */
112
+ profileIds: {
113
+ type: string;
114
+ };
115
+ };
116
+ };
117
+ profiles: {
118
+ dynamic: 'false';
119
+ properties: {
120
+ tags: {
121
+ type: 'keyword';
122
+ };
123
+ policies: {
124
+ properties: {
125
+ roleId: {
126
+ type: 'keyword';
127
+ };
128
+ restrictedTo: {
129
+ type: 'nested';
130
+ properties: {
131
+ index: {
132
+ type: 'keyword';
133
+ };
134
+ collections: {
135
+ type: 'keyword';
136
+ };
137
+ };
138
+ };
139
+ };
140
+ };
141
+ };
142
+ };
143
+ roles: {
144
+ dynamic: 'false';
145
+ properties: {
146
+ tags: {
147
+ type: 'keyword';
148
+ };
149
+ controllers: {
150
+ dynamic: 'false';
151
+ properties: Record<string, unknown>;
152
+ };
153
+ };
154
+ };
155
+ validations: {
156
+ properties: {
157
+ index: {
158
+ type: 'keyword';
159
+ };
160
+ collection: {
161
+ type: 'keyword';
162
+ };
163
+ validations: {
164
+ dynamic: 'false';
165
+ properties: Record<string, unknown>;
166
+ };
167
+ };
168
+ };
169
+ config: {
170
+ dynamic: 'false';
171
+ properties: Record<string, unknown>;
172
+ };
173
+ 'api-keys': {
174
+ dynamic: 'false';
175
+ properties: {
176
+ userId: {
177
+ type: 'keyword';
178
+ };
179
+ hash: {
180
+ type: 'keyword';
181
+ };
182
+ description: {
183
+ type: 'text';
184
+ };
185
+ expiresAt: {
186
+ type: 'long';
187
+ };
188
+ ttl: {
189
+ type: 'keyword';
190
+ };
191
+ token: {
192
+ type: 'keyword';
193
+ };
194
+ };
195
+ };
196
+ installations: {
197
+ dynamic: 'strict';
198
+ properties: {
199
+ description: {
200
+ type: 'text';
201
+ };
202
+ handler: {
203
+ type: 'text';
204
+ };
205
+ installedAt: {
206
+ type: 'date';
207
+ };
208
+ };
209
+ };
210
+ };
211
+ };
212
+ maxScrollDuration: '1m';
213
+ defaults: {
214
+ onUpdateConflictRetries: 0;
215
+ scrollTTL: '15s';
216
+ };
217
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=StorageServiceElasticsearchConfiguration.js.map
@@ -0,0 +1,111 @@
1
+ export declare type InternalCacheConfiguration = {
2
+ /**
3
+ * The cache service relies on Redis sample settings for Redis service (see also https://github.com/luin/ioredis)
4
+ *
5
+ * 1. using a single Redis database:
6
+ * * node:
7
+ * * host:
8
+ * The host on which Redis can be reached.
9
+ * Can take an IP address, an URI or a hostname
10
+ * * port:
11
+ * The port on which Redis is running its database:
12
+ * * (optional, deprecated) database:
13
+ * ID of the redis database (default: 0)
14
+ * NOTE: this option is deprecated and will be removed in Kuzzle v3.
15
+ * Use 'options.db' instead. If both options are set, then
16
+ * "options.db" will take precedence.
17
+ * * (optional) options:
18
+ * Redis specific options compatible with IORedis.
19
+ * See Redis client constructor available options:
20
+ * https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options
21
+ *
22
+ * 2. using a master/slaves Redis instance with Redis sentinels
23
+ * (cf. http://redis.io/topics/sentinel):
24
+ * * node:
25
+ * * sentinels:
26
+ * array of sentinels instances:
27
+ * * host:
28
+ * Host name/address of the sentinel server
29
+ * Can be an IP address, an URI or a hostname
30
+ * * port:
31
+ * Network port opened by Redis on the sentinel server
32
+ * * name:
33
+ * Group of Redis instances composed of a master and one
34
+ * or more slaves
35
+ * * (optional, deprecated) database:
36
+ * ID of the redis database (default: 0)
37
+ * NOTE: this option is deprecated and will be removed in Kuzzle v3.
38
+ * Use 'options.db' instead. If both options are set, then
39
+ * "options.db" will take precedence.
40
+ * * (optional) options:
41
+ * Redis specific options compatible with IORedis.
42
+ * See Redis client constructor available options:
43
+ * https://github.com/luin/ioredis/blob/master/API.md#redis--eventemitter
44
+ *
45
+ * 3. using a redis cluster (cf. http://redis.io/topics/cluster-spec):
46
+ * * nodes: array of master nodes of the cluster
47
+ * * host:
48
+ * Host name/address of a redis cluster node
49
+ * Can be an IP address, an URI or a hostname
50
+ * * port:
51
+ * Network port opened by the redis cluster node
52
+ * * (optional, deprecated) database:
53
+ * ID of the redis database (default: 0)
54
+ * NOTE: this option is deprecated and will be removed in Kuzzle v3.
55
+ * Use 'options.db' instead. If both options are set, then
56
+ * "options.db" will take precedence.
57
+ * * (optional) options:
58
+ * Redis specific options compatible with IORedis.
59
+ * See Redis client constructor available options:
60
+ * https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options
61
+ * * (optional) clusterOptions:
62
+ * Redis Cluster specific options compatible with IORedis.
63
+ * See Redis Cluster client constructor available options:
64
+ * https://github.com/luin/ioredis/blob/master/API.md#new-clusterstartupnodes-options
65
+ * * (optional) overrideDnsLookup:
66
+ * Only available when using a Redis Cluster config.
67
+ * Use with caution: if set to true, it makes Kuzzle skip DNS validation for TLS certificates
68
+ * This is the only way to connect to an AWS Elasticache Cluster with TLS encryption.
69
+ * See: https://github.com/luin/ioredis#special-note-aws-elasticache-clusters-with-tls
70
+ */
71
+ /**
72
+ * @default 'redis'
73
+ */
74
+ backend: 'redis';
75
+ clusterOptions: {
76
+ /**
77
+ * @default true
78
+ */
79
+ enableReadyCheck: boolean;
80
+ };
81
+ /**
82
+ * @default 0
83
+ */
84
+ database: number;
85
+ node: {
86
+ /**
87
+ * @default "localhost"
88
+ */
89
+ host: string;
90
+ /**
91
+ * @default 6379
92
+ */
93
+ port: number;
94
+ };
95
+ /**
96
+ * * (optional) options:
97
+ * Redis specific options compatible with IORedis.
98
+ * See Redis client constructor available options:
99
+ * https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options
100
+ *
101
+ */
102
+ options?: Record<string, unknown>;
103
+ /**
104
+ * Only available when using a Redis Cluster config.
105
+ * Use with caution: if set to true, it makes Kuzzle skip DNS validation for TLS certificates
106
+ * This is the only way to connect to an AWS Elasticache Cluster with TLS encryption.
107
+ * See: https://github.com/luin/ioredis#special-note-aws-elasticache-clusters-with-tls
108
+ * @default false
109
+ */
110
+ overrideDnsLookup: boolean;
111
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=InternalCacheRedisConfiguration.js.map
@@ -0,0 +1,31 @@
1
+ export declare type PublicCacheRedisConfiguration = {
2
+ /**
3
+ * @default 'redis'
4
+ */
5
+ backend: 'redis';
6
+ clusterOptions: {
7
+ /**
8
+ * @default true
9
+ */
10
+ enableReadyCheck: boolean;
11
+ };
12
+ /**
13
+ * @default 5
14
+ */
15
+ database: number;
16
+ node: {
17
+ /**
18
+ * @default 'localhost'
19
+ */
20
+ host: string;
21
+ /**
22
+ * @default 6379
23
+ */
24
+ port: number;
25
+ };
26
+ options?: Record<string, unknown>;
27
+ /**
28
+ * @default false
29
+ */
30
+ overrideDnsLookup: boolean;
31
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=PublicCacheRedisConfiguration.js.map
@@ -8,7 +8,24 @@ export * from './EventHandler';
8
8
  export * from './User';
9
9
  export * from './Token';
10
10
  export * from './Global';
11
+ export * from './PasswordPolicy';
12
+ export * from './config/KuzzleConfiguration';
13
+ export * from './config/ServerConfiguration';
14
+ export * from './config/ServicesConfiguration';
15
+ export * from './config/SecurityConfiguration';
16
+ export * from './config/HttpConfiguration';
17
+ export * from './config/PluginsConfiguration';
18
+ export * from './RoleDefinition';
19
+ export * from './ProfileDefinition';
20
+ export * from './Plugin';
21
+ export * from './config/LimitsConfiguration';
22
+ export * from './RoleDefinition';
23
+ export * from './ProfileDefinition';
11
24
  export * from './realtime/RealtimeScope';
12
25
  export * from './realtime/RealtimeUsers';
13
26
  export * from './realtime/RoomList';
14
27
  export * from './KuzzleDocument';
28
+ export * from './config/publicCache/PublicCacheRedisConfiguration';
29
+ export * from './config/internalCache/InternalCacheRedisConfiguration';
30
+ export * from './config/StorageService/StorageServiceElasticsearchConfiguration';
31
+ export * from './config/DumpConfiguration';
@@ -40,8 +40,25 @@ __exportStar(require("./EventHandler"), exports);
40
40
  __exportStar(require("./User"), exports);
41
41
  __exportStar(require("./Token"), exports);
42
42
  __exportStar(require("./Global"), exports);
43
+ __exportStar(require("./PasswordPolicy"), exports);
44
+ __exportStar(require("./config/KuzzleConfiguration"), exports);
45
+ __exportStar(require("./config/ServerConfiguration"), exports);
46
+ __exportStar(require("./config/ServicesConfiguration"), exports);
47
+ __exportStar(require("./config/SecurityConfiguration"), exports);
48
+ __exportStar(require("./config/HttpConfiguration"), exports);
49
+ __exportStar(require("./config/PluginsConfiguration"), exports);
50
+ __exportStar(require("./RoleDefinition"), exports);
51
+ __exportStar(require("./ProfileDefinition"), exports);
52
+ __exportStar(require("./Plugin"), exports);
53
+ __exportStar(require("./config/LimitsConfiguration"), exports);
54
+ __exportStar(require("./RoleDefinition"), exports);
55
+ __exportStar(require("./ProfileDefinition"), exports);
43
56
  __exportStar(require("./realtime/RealtimeScope"), exports);
44
57
  __exportStar(require("./realtime/RealtimeUsers"), exports);
45
58
  __exportStar(require("./realtime/RoomList"), exports);
46
59
  __exportStar(require("./KuzzleDocument"), exports);
60
+ __exportStar(require("./config/publicCache/PublicCacheRedisConfiguration"), exports);
61
+ __exportStar(require("./config/internalCache/InternalCacheRedisConfiguration"), exports);
62
+ __exportStar(require("./config/StorageService/StorageServiceElasticsearchConfiguration"), exports);
63
+ __exportStar(require("./config/DumpConfiguration"), exports);
47
64
  //# sourceMappingURL=index.js.map
package/package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kuzzle",
3
- "version": "2.16.4",
3
+ "version": "2.16.8",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kuzzle",
3
3
  "author": "The Kuzzle Team <support@kuzzle.io>",
4
- "version": "2.16.4",
4
+ "version": "2.16.8",
5
5
  "description": "Kuzzle is an open-source solution that handles all the data management through a secured API, with a large choice of protocols.",
6
6
  "bin": {
7
7
  "kuzzle": "bin/start-kuzzle-server"