kuzzle 2.16.5 → 2.16.9
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 +11 -0
- package/lib/api/controllers/adminController.js +4 -3
- package/lib/api/controllers/authController.js +2 -2
- package/lib/api/controllers/collectionController.js +2 -8
- package/lib/api/request/kuzzleRequest.d.ts +11 -11
- package/lib/api/request/kuzzleRequest.js +34 -48
- package/lib/cluster/workers/IDCardRenewer.js +11 -2
- package/lib/config/default.config.d.ts +13 -0
- package/lib/config/default.config.js +363 -362
- package/lib/config/index.js +7 -5
- package/lib/core/backend/backendConfig.d.ts +3 -3
- package/lib/core/backend/backendConfig.js +2 -2
- package/lib/core/plugin/pluginContext.d.ts +10 -1
- package/lib/core/plugin/pluginContext.js +2 -0
- package/lib/core/security/securityLoader.js +1 -1
- package/lib/core/shared/repository.js +1 -1
- package/lib/model/security/profile.js +10 -10
- package/lib/model/security/role.js +3 -3
- package/lib/service/cache/redis.js +33 -0
- package/lib/service/storage/elasticsearch.js +6 -0
- package/lib/types/PasswordPolicy.d.ts +77 -0
- package/lib/types/PasswordPolicy.js +3 -0
- package/lib/types/ProfileDefinition.d.ts +48 -0
- package/lib/types/ProfileDefinition.js +3 -0
- package/lib/types/RoleDefinition.d.ts +27 -0
- package/lib/types/RoleDefinition.js +3 -0
- package/lib/types/config/DumpConfiguration.d.ts +42 -0
- package/lib/types/config/DumpConfiguration.js +3 -0
- package/lib/types/config/HttpConfiguration.d.ts +43 -0
- package/lib/types/config/HttpConfiguration.js +9 -0
- package/lib/types/config/KuzzleConfiguration.d.ts +123 -0
- package/lib/types/config/KuzzleConfiguration.js +3 -0
- package/lib/types/config/LimitsConfiguration.d.ts +111 -0
- package/lib/types/config/LimitsConfiguration.js +3 -0
- package/lib/types/config/PluginsConfiguration.d.ts +177 -0
- package/lib/types/config/PluginsConfiguration.js +3 -0
- package/lib/types/config/SecurityConfiguration.d.ts +182 -0
- package/lib/types/config/SecurityConfiguration.js +3 -0
- package/lib/types/config/ServerConfiguration.d.ts +195 -0
- package/lib/types/config/ServerConfiguration.js +3 -0
- package/lib/types/config/ServicesConfiguration.d.ts +41 -0
- package/lib/types/config/ServicesConfiguration.js +3 -0
- package/lib/types/config/StorageService/StorageServiceElasticsearchConfiguration.d.ts +217 -0
- package/lib/types/config/StorageService/StorageServiceElasticsearchConfiguration.js +3 -0
- package/lib/types/config/internalCache/InternalCacheRedisConfiguration.d.ts +111 -0
- package/lib/types/config/internalCache/InternalCacheRedisConfiguration.js +3 -0
- package/lib/types/config/publicCache/PublicCacheRedisConfiguration.d.ts +31 -0
- package/lib/types/config/publicCache/PublicCacheRedisConfiguration.js +3 -0
- package/lib/types/index.d.ts +17 -0
- package/lib/types/index.js +17 -0
- package/package-lock.json +368 -360
- package/package.json +20 -19
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { ServerConfiguration, ServicesConfiguration, SecurityConfiguration, HttpConfiguration, PluginsConfiguration, LimitsConfiguration, DumpConfiguration } from '../index';
|
|
2
|
+
export interface IKuzzleConfiguration {
|
|
3
|
+
realtime: {
|
|
4
|
+
/**
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
pcreSupport: boolean;
|
|
8
|
+
};
|
|
9
|
+
dump: DumpConfiguration;
|
|
10
|
+
/**
|
|
11
|
+
* The HTTP section lets you configure how Kuzzle should
|
|
12
|
+
* handle HTTP requests.
|
|
13
|
+
*/
|
|
14
|
+
http: HttpConfiguration;
|
|
15
|
+
/**
|
|
16
|
+
* Kuzzle configured limits.
|
|
17
|
+
*/
|
|
18
|
+
limits: LimitsConfiguration;
|
|
19
|
+
/**
|
|
20
|
+
* The application section lets you configure your application.
|
|
21
|
+
*/
|
|
22
|
+
application: Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* The plugins section lets you define plugins behaviors.
|
|
25
|
+
*
|
|
26
|
+
* @see https://docs.kuzzle.io/core/2/guides/write-plugins
|
|
27
|
+
*/
|
|
28
|
+
plugins: PluginsConfiguration;
|
|
29
|
+
/**
|
|
30
|
+
* The repositories are used internally by Kuzzle to store its data (users,
|
|
31
|
+
* permissions, configuration etc.)
|
|
32
|
+
*/
|
|
33
|
+
repositories: {
|
|
34
|
+
common: {
|
|
35
|
+
/**
|
|
36
|
+
* Time to live (in seconds) of cached objects.
|
|
37
|
+
*
|
|
38
|
+
* Decreasing this value will lower Redis memory and disk consumption,
|
|
39
|
+
* at the cost of increasing queries rate to the database and response times.
|
|
40
|
+
*
|
|
41
|
+
* @default 1440000
|
|
42
|
+
*/
|
|
43
|
+
cacheTTL: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* The security section contains the configuration for Kuzzle permissions
|
|
48
|
+
* system.
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
security: SecurityConfiguration;
|
|
52
|
+
/**
|
|
53
|
+
* Kuzzle server is the entry point for incoming requests.
|
|
54
|
+
*/
|
|
55
|
+
server: ServerConfiguration;
|
|
56
|
+
/**
|
|
57
|
+
* Services are the external components Kuzzle relies on.
|
|
58
|
+
*/
|
|
59
|
+
services: ServicesConfiguration;
|
|
60
|
+
stats: {
|
|
61
|
+
/**
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
64
|
+
enabled: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* @default 3600
|
|
67
|
+
*/
|
|
68
|
+
ttl: number;
|
|
69
|
+
/**
|
|
70
|
+
* @default 10
|
|
71
|
+
*/
|
|
72
|
+
statsInterval: number;
|
|
73
|
+
};
|
|
74
|
+
cluster: {
|
|
75
|
+
/**
|
|
76
|
+
* @default 50
|
|
77
|
+
*/
|
|
78
|
+
activityDepth: number;
|
|
79
|
+
/**
|
|
80
|
+
* @default 2000
|
|
81
|
+
*/
|
|
82
|
+
heartbeat: number;
|
|
83
|
+
/**
|
|
84
|
+
* @default null
|
|
85
|
+
*/
|
|
86
|
+
interface: any;
|
|
87
|
+
/**
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
90
|
+
ipv6: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* @default 'private'
|
|
93
|
+
*/
|
|
94
|
+
ip: string;
|
|
95
|
+
/**
|
|
96
|
+
* @default 60000
|
|
97
|
+
*/
|
|
98
|
+
joinTimeout: number;
|
|
99
|
+
/**
|
|
100
|
+
* @default 1
|
|
101
|
+
*/
|
|
102
|
+
minimumNodes: number;
|
|
103
|
+
ports: {
|
|
104
|
+
/**
|
|
105
|
+
* @default 7510
|
|
106
|
+
*/
|
|
107
|
+
command: number;
|
|
108
|
+
/**
|
|
109
|
+
* @default 7511
|
|
110
|
+
*/
|
|
111
|
+
sync: number;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* @default 5000
|
|
115
|
+
*/
|
|
116
|
+
syncTimeout: number;
|
|
117
|
+
};
|
|
118
|
+
internal: {
|
|
119
|
+
hash: any;
|
|
120
|
+
};
|
|
121
|
+
validation: Record<string, unknown>;
|
|
122
|
+
}
|
|
123
|
+
export declare type KuzzleConfiguration = Partial<IKuzzleConfiguration>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export declare type LimitsConfiguration = {
|
|
2
|
+
/**
|
|
3
|
+
* Number of requests Kuzzle processes simultaneously.
|
|
4
|
+
*
|
|
5
|
+
* Requests received above this limit are buffered until a slot is freed
|
|
6
|
+
*
|
|
7
|
+
* This value should be kept low to avoid overloading Kuzzle's event loop.
|
|
8
|
+
*
|
|
9
|
+
* @default 100
|
|
10
|
+
*/
|
|
11
|
+
concurrentRequests: number;
|
|
12
|
+
/**
|
|
13
|
+
* Maximum number of documents that can be fetched by a single API
|
|
14
|
+
* request. The minimum value to this limit is 1.
|
|
15
|
+
*
|
|
16
|
+
* This limits is applied to any route returning multiple documents,
|
|
17
|
+
* such as document:mGet or document:search
|
|
18
|
+
*
|
|
19
|
+
* You may have to configure ElasticSearch as well if you need
|
|
20
|
+
* to set this value higher than 10000
|
|
21
|
+
*
|
|
22
|
+
* @default 10000
|
|
23
|
+
*/
|
|
24
|
+
documentsFetchCount: number;
|
|
25
|
+
/**
|
|
26
|
+
* Maximum number of documents that can be written by a single API
|
|
27
|
+
* request. The minimum value to this limit is 1.
|
|
28
|
+
*
|
|
29
|
+
* There is no higher limit to this value, but you may
|
|
30
|
+
* also have to change the value of the `maxRequestSize` parameter
|
|
31
|
+
* (in the `server` section) to make Kuzzle accept larger requests.
|
|
32
|
+
*
|
|
33
|
+
* @default 200
|
|
34
|
+
*/
|
|
35
|
+
documentsWriteCount: number;
|
|
36
|
+
/**
|
|
37
|
+
* Maximum number of logins per second and per network connection.
|
|
38
|
+
*
|
|
39
|
+
* @default 1
|
|
40
|
+
*/
|
|
41
|
+
loginsPerSecond: number;
|
|
42
|
+
/**
|
|
43
|
+
* Maximum number of requests that can be buffered.
|
|
44
|
+
*
|
|
45
|
+
* Requests received above this limit are discarded with a 503 error
|
|
46
|
+
*
|
|
47
|
+
* @default 50000
|
|
48
|
+
*/
|
|
49
|
+
requestsBufferSize: number;
|
|
50
|
+
/**
|
|
51
|
+
* Number of buffered requests after which Kuzzle
|
|
52
|
+
* will throw `core:overload` events.
|
|
53
|
+
*
|
|
54
|
+
* @see https://docs.kuzzle.io/core/2/framework/events/core/#core-overload
|
|
55
|
+
*
|
|
56
|
+
* @default 5000
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
requestsBufferWarningThreshold: number;
|
|
60
|
+
/**
|
|
61
|
+
* Maximum number of conditions a subscription filter can contain.
|
|
62
|
+
*
|
|
63
|
+
* NB: A condition is either a "simple" operator (anything but "and",
|
|
64
|
+
* "or" and "bool"), or a boolean condition that contains only
|
|
65
|
+
* simple operators.
|
|
66
|
+
*
|
|
67
|
+
* @default 100
|
|
68
|
+
*/
|
|
69
|
+
subscriptionConditionsCount: number;
|
|
70
|
+
/**
|
|
71
|
+
* Maximum number of minterms (AND) clauses after the filters are
|
|
72
|
+
* transformed in their Canonical Disjunctive Normal Form (CDNF).
|
|
73
|
+
*
|
|
74
|
+
* Set to 0 for no limit.
|
|
75
|
+
*
|
|
76
|
+
* @default 0
|
|
77
|
+
*/
|
|
78
|
+
subscriptionMinterms: number;
|
|
79
|
+
/**
|
|
80
|
+
* Maximum number of different subscription rooms.
|
|
81
|
+
* (i.e. different index+collection+filters subscription configurations)
|
|
82
|
+
*
|
|
83
|
+
* Depends primarily on available memory.
|
|
84
|
+
*
|
|
85
|
+
* If set to 0, an unlimited number of rooms can be created.
|
|
86
|
+
*
|
|
87
|
+
* @default 1000000
|
|
88
|
+
*/
|
|
89
|
+
subscriptionRooms: number;
|
|
90
|
+
/**
|
|
91
|
+
* Maximum time (in seconds) a document will be kept in cache for
|
|
92
|
+
* real-time subscriptions.
|
|
93
|
+
*
|
|
94
|
+
* This cache is used to notify subscriber when a document enters or
|
|
95
|
+
* leaves a scope after an update.
|
|
96
|
+
*
|
|
97
|
+
* By default, subscriptions will be kept 72 hours.
|
|
98
|
+
*
|
|
99
|
+
* Please note that keeping subscriptions over a long period of
|
|
100
|
+
* time may result in memory overuse.
|
|
101
|
+
*
|
|
102
|
+
* If set to 0, the subscription will be kept in cache forever.
|
|
103
|
+
*
|
|
104
|
+
* Setting the property to 0 will lead to a memory leak if
|
|
105
|
+
* documents enter a real-time subscription scope and never exit
|
|
106
|
+
* that scope.
|
|
107
|
+
*
|
|
108
|
+
* @default 259200000 (72 * 60 * 60)
|
|
109
|
+
*/
|
|
110
|
+
subscriptionDocumentTTL: number;
|
|
111
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { JSONObject } from '../../../index';
|
|
2
|
+
import { PasswordPolicy } from '../index';
|
|
3
|
+
export declare type PluginsConfiguration = {
|
|
4
|
+
/**
|
|
5
|
+
* Common configuration for all plugins.
|
|
6
|
+
*/
|
|
7
|
+
common: {
|
|
8
|
+
/**
|
|
9
|
+
* If true, Kuzzle will not load custom plugin and features (including
|
|
10
|
+
* the ones defined in the application).
|
|
11
|
+
* The API will only be available to administrators ("admin" profile)
|
|
12
|
+
* during failsafe mode.
|
|
13
|
+
*
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
failsafeMode: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Maximum amount of time (in milliseconds) to wait
|
|
19
|
+
* for a concurrent plugin bootstrap.
|
|
20
|
+
*
|
|
21
|
+
* @default 30000
|
|
22
|
+
*/
|
|
23
|
+
bootstrapLockTimeout: number;
|
|
24
|
+
/**
|
|
25
|
+
* List of Kuzzle's embedded plugins to be activated.
|
|
26
|
+
*
|
|
27
|
+
* Edit this list to deactivate one or more of those plugins.
|
|
28
|
+
* NOTE: this list does not control plugins installed manually.
|
|
29
|
+
*
|
|
30
|
+
* @default ["kuzzle-plugin-logger","kuzzle-plugin-auth-passport-local"]
|
|
31
|
+
*/
|
|
32
|
+
include: string[];
|
|
33
|
+
/**
|
|
34
|
+
* Warning time threshold on a pipe plugin action (in milliseconds).
|
|
35
|
+
*
|
|
36
|
+
* @default 500
|
|
37
|
+
*/
|
|
38
|
+
pipeWarnTime: number;
|
|
39
|
+
/**
|
|
40
|
+
* Maximum execution time of a plugin init method (in milliseconds).
|
|
41
|
+
*
|
|
42
|
+
* @default 10000
|
|
43
|
+
*/
|
|
44
|
+
initTimeout: number;
|
|
45
|
+
/**
|
|
46
|
+
* Maximum number of pipes that can be executed in parallel.
|
|
47
|
+
*
|
|
48
|
+
* New pipes submitted while the maximum number of pipes is met are
|
|
49
|
+
* delayed for later execution.
|
|
50
|
+
*
|
|
51
|
+
* This parameter controls is used to limit the stress put on the
|
|
52
|
+
* event loop, allowing for Kuzzle to process pipes faster, and to
|
|
53
|
+
* protect it from performances degradation if an abnormal number of
|
|
54
|
+
* pipes are submitted.
|
|
55
|
+
*
|
|
56
|
+
* (timers do not start while a pipe is hold back)
|
|
57
|
+
*
|
|
58
|
+
* @default 50
|
|
59
|
+
*/
|
|
60
|
+
maxConcurrentPipes: number;
|
|
61
|
+
/**
|
|
62
|
+
* Maximum number of pipes that can be delayed. If full, new pipes
|
|
63
|
+
* are rejected.
|
|
64
|
+
*
|
|
65
|
+
* @default 50000
|
|
66
|
+
*/
|
|
67
|
+
pipesBufferSize: number;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Default logger plugin configuration.
|
|
71
|
+
*
|
|
72
|
+
* This plugin use Winston to transport the logs.
|
|
73
|
+
*
|
|
74
|
+
* @see https://github.com/kuzzleio/kuzzle-plugin-logger
|
|
75
|
+
*/
|
|
76
|
+
'kuzzle-plugin-logger': {
|
|
77
|
+
/**
|
|
78
|
+
* Winston transport services declaration
|
|
79
|
+
*/
|
|
80
|
+
services: {
|
|
81
|
+
/**
|
|
82
|
+
* Print logs to STDOUT
|
|
83
|
+
*
|
|
84
|
+
* @default
|
|
85
|
+
*
|
|
86
|
+
* @see https://github.com/winstonjs/winston/blob/master/docs/transports.md#console-transport
|
|
87
|
+
*/
|
|
88
|
+
stdout: {
|
|
89
|
+
/**
|
|
90
|
+
* Level of messages that transport should log
|
|
91
|
+
*
|
|
92
|
+
* @default "info"
|
|
93
|
+
*/
|
|
94
|
+
level: string;
|
|
95
|
+
/**
|
|
96
|
+
* Add the date to log lines
|
|
97
|
+
*
|
|
98
|
+
* @default true
|
|
99
|
+
*/
|
|
100
|
+
addDate: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Date format
|
|
103
|
+
*
|
|
104
|
+
* @default "YYYY-MM-DD HH-mm-ss"
|
|
105
|
+
*/
|
|
106
|
+
dateFormat: string;
|
|
107
|
+
};
|
|
108
|
+
[transport: string]: JSONObject;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Default local auth strategy plugin.
|
|
113
|
+
*
|
|
114
|
+
* @see https://github.com/kuzzleio/kuzzle-plugin-auth-passport-local/
|
|
115
|
+
*/
|
|
116
|
+
'kuzzle-plugin-auth-passport-local': {
|
|
117
|
+
/**
|
|
118
|
+
* One of the supported encryption algorithms
|
|
119
|
+
* (run crypto.getHashes() to get the complete list).
|
|
120
|
+
*
|
|
121
|
+
* Examples: sha256, sha512, blake2b512, whirlpool, ...
|
|
122
|
+
*
|
|
123
|
+
* @default "sha512"
|
|
124
|
+
*/
|
|
125
|
+
algorithm: string;
|
|
126
|
+
/**
|
|
127
|
+
* Boolean and controlling if the password is stretched or not.
|
|
128
|
+
*
|
|
129
|
+
* @default true
|
|
130
|
+
*/
|
|
131
|
+
stretching: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Describes how the hashed password is stored in the database
|
|
134
|
+
*
|
|
135
|
+
* @see https://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end
|
|
136
|
+
*
|
|
137
|
+
* @default "hex"
|
|
138
|
+
*/
|
|
139
|
+
digest: string;
|
|
140
|
+
/**
|
|
141
|
+
* Determines whether the hashing algorithm uses crypto.createHash (hash)
|
|
142
|
+
* or crypto.createHmac (hmac).
|
|
143
|
+
*
|
|
144
|
+
* @see https://nodejs.org/api/crypto.html
|
|
145
|
+
*
|
|
146
|
+
* @default "hmac"
|
|
147
|
+
*/
|
|
148
|
+
encryption: string;
|
|
149
|
+
/**
|
|
150
|
+
* If true, Kuzzle will refuse any credentials update or deletion,
|
|
151
|
+
* unless the currently valid password is provided
|
|
152
|
+
* or if the change is performed via the security controller.
|
|
153
|
+
*
|
|
154
|
+
* @default false
|
|
155
|
+
*/
|
|
156
|
+
requirePassword: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* A positive time representation of the delay after which a
|
|
159
|
+
* reset password token expires.
|
|
160
|
+
*
|
|
161
|
+
* @see https://www.npmjs.com/package/ms
|
|
162
|
+
*
|
|
163
|
+
* Users with expired passwords are given a resetPasswordToken when
|
|
164
|
+
* logging in and must change their password to be allowed to log in again.
|
|
165
|
+
*
|
|
166
|
+
* @default -1
|
|
167
|
+
*/
|
|
168
|
+
resetPasswordExpiresIn: number;
|
|
169
|
+
/**
|
|
170
|
+
* Set of additional rules to apply to users, or to groups of users.
|
|
171
|
+
*
|
|
172
|
+
* @see https://docs.kuzzle.io/core/2/guides/main-concepts/authentication#password-policies
|
|
173
|
+
*/
|
|
174
|
+
passwordPolicies: PasswordPolicy[];
|
|
175
|
+
};
|
|
176
|
+
[pluginName: string]: JSONObject;
|
|
177
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { JSONObject } from '../../../index';
|
|
3
|
+
import { RoleDefinition, ProfileDefinition } from '../index';
|
|
4
|
+
export declare type SecurityConfiguration = {
|
|
5
|
+
/**
|
|
6
|
+
* The profileIds applied to a user created with the API action
|
|
7
|
+
* `security:createRestrictedUser`.
|
|
8
|
+
*
|
|
9
|
+
* @default ["default"]
|
|
10
|
+
*/
|
|
11
|
+
restrictedProfileIds: string[];
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `security.authToken` instead.
|
|
14
|
+
*/
|
|
15
|
+
jwt?: JSONObject;
|
|
16
|
+
/**
|
|
17
|
+
* Configuration for the npm package jsonwebtoken
|
|
18
|
+
* who handle Kuzzle Authentication Token.
|
|
19
|
+
*
|
|
20
|
+
* @see https://github.com/auth0/node-jsonwebtoken
|
|
21
|
+
*/
|
|
22
|
+
authToken: {
|
|
23
|
+
/**
|
|
24
|
+
* Hash/encryption method used to sign the token.
|
|
25
|
+
*
|
|
26
|
+
* @default "HS256"
|
|
27
|
+
*/
|
|
28
|
+
algorithm: string;
|
|
29
|
+
/**
|
|
30
|
+
* Token default expiration time.
|
|
31
|
+
*
|
|
32
|
+
* @see https://www.npmjs.com/package/ms
|
|
33
|
+
*
|
|
34
|
+
* @default "1h"
|
|
35
|
+
*/
|
|
36
|
+
expiresIn: string;
|
|
37
|
+
/**
|
|
38
|
+
* Duration in ms during which a renewed token is still considered valid.
|
|
39
|
+
*
|
|
40
|
+
* @default 1000
|
|
41
|
+
*/
|
|
42
|
+
gracePeriod: number;
|
|
43
|
+
/**
|
|
44
|
+
* Maximum duration in milliseconds a token can be requested to be valid.
|
|
45
|
+
*
|
|
46
|
+
* If set to -1, no maximum duration is set.
|
|
47
|
+
*
|
|
48
|
+
* @default -1
|
|
49
|
+
*/
|
|
50
|
+
maxTTL: number;
|
|
51
|
+
/**
|
|
52
|
+
* String or buffer data containing either the secret for HMAC
|
|
53
|
+
* algorithms, or the PEM encoded private key for RSA and ECDSA.
|
|
54
|
+
*
|
|
55
|
+
* If left to null, Kuzzle will autogenerate a random
|
|
56
|
+
* seed (can only be used with HMAC algorithms).
|
|
57
|
+
*
|
|
58
|
+
* @default null
|
|
59
|
+
*/
|
|
60
|
+
secret: string | Buffer;
|
|
61
|
+
};
|
|
62
|
+
apiKey: {
|
|
63
|
+
/**
|
|
64
|
+
* Maximum duration in milliseconds a token can be requested to be valid.
|
|
65
|
+
*
|
|
66
|
+
* If set to -1, no maximum duration is set.
|
|
67
|
+
*
|
|
68
|
+
* @default -1
|
|
69
|
+
*/
|
|
70
|
+
maxTTL: number;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* The default role defines permissions for all users,
|
|
74
|
+
* until an administrator configures the backend rights.
|
|
75
|
+
*
|
|
76
|
+
* By default, all users are granted all permissions.
|
|
77
|
+
*
|
|
78
|
+
* @default
|
|
79
|
+
*
|
|
80
|
+
* {
|
|
81
|
+
* "role": {
|
|
82
|
+
* "controllers": {
|
|
83
|
+
* "*": {
|
|
84
|
+
* "actions": {
|
|
85
|
+
* "*": true
|
|
86
|
+
* }
|
|
87
|
+
* }
|
|
88
|
+
* }
|
|
89
|
+
* }
|
|
90
|
+
* }
|
|
91
|
+
*/
|
|
92
|
+
default: {
|
|
93
|
+
role: RoleDefinition;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Permissions used when creating an administrator user.
|
|
97
|
+
*
|
|
98
|
+
* By default, the admin user is granted all permissions.
|
|
99
|
+
*
|
|
100
|
+
* Anonymous and non-administrator users have their rights restricted.
|
|
101
|
+
*
|
|
102
|
+
* @default
|
|
103
|
+
*
|
|
104
|
+
* {
|
|
105
|
+
"roles": {
|
|
106
|
+
"admin": {
|
|
107
|
+
"controllers": {
|
|
108
|
+
"*": {
|
|
109
|
+
"actions": {
|
|
110
|
+
"*": true
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"default": {
|
|
116
|
+
"controllers": {
|
|
117
|
+
"auth": {
|
|
118
|
+
"actions": {
|
|
119
|
+
"checkToken": true,
|
|
120
|
+
"getCurrentUser": true,
|
|
121
|
+
"getMyRights": true,
|
|
122
|
+
"logout": true,
|
|
123
|
+
"updateSelf": true
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"server": {
|
|
127
|
+
"actions": {
|
|
128
|
+
"publicApi": true
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"anonymous": {
|
|
134
|
+
"controllers": {
|
|
135
|
+
"auth": {
|
|
136
|
+
"actions": {
|
|
137
|
+
"checkToken": true,
|
|
138
|
+
"getCurrentUser": true,
|
|
139
|
+
"getMyRights": true,
|
|
140
|
+
"login": true
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"server": {
|
|
144
|
+
"actions": {
|
|
145
|
+
"publicApi": true,
|
|
146
|
+
"openapi": true
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"profiles": {
|
|
153
|
+
"admin": {
|
|
154
|
+
"rateLimit": 0,
|
|
155
|
+
"policies": [ {"roleId": "admin"} ]
|
|
156
|
+
},
|
|
157
|
+
"default": {
|
|
158
|
+
"rateLimit": 10,
|
|
159
|
+
"policies": [ {"roleId": "default"} ]
|
|
160
|
+
},
|
|
161
|
+
"anonymous": {
|
|
162
|
+
"rateLimit": 200,
|
|
163
|
+
"policies": [ {"roleId": "anonymous"} ]
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
*/
|
|
168
|
+
standard: {
|
|
169
|
+
roles: {
|
|
170
|
+
admin: RoleDefinition;
|
|
171
|
+
default: RoleDefinition;
|
|
172
|
+
anonymous: RoleDefinition;
|
|
173
|
+
[roleName: string]: RoleDefinition;
|
|
174
|
+
};
|
|
175
|
+
profiles: {
|
|
176
|
+
admin: ProfileDefinition;
|
|
177
|
+
default: ProfileDefinition;
|
|
178
|
+
anonymous: ProfileDefinition;
|
|
179
|
+
[profileName: string]: ProfileDefinition;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
};
|