kuzzle 2.19.11 → 2.20.0
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/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/api/controllers/authController.d.ts +164 -0
- package/lib/api/controllers/authController.js +469 -654
- package/lib/api/controllers/baseController.d.ts +74 -0
- package/lib/api/controllers/baseController.js +169 -221
- package/lib/api/httpRoutes.js +6 -0
- package/lib/api/openapi/openApiGenerator.js +2 -2
- package/lib/api/request/kuzzleRequest.d.ts +1 -1
- package/lib/core/backend/backendController.js +2 -2
- package/lib/core/backend/backendPlugin.js +2 -2
- package/lib/core/plugin/pluginRepository.js +1 -1
- package/lib/core/plugin/pluginsManager.js +1 -1
- package/lib/core/security/index.js +1 -1
- package/lib/core/security/profileRepository.d.ts +14 -4
- package/lib/core/security/profileRepository.js +2 -2
- package/lib/core/security/roleRepository.js +1 -1
- package/lib/core/security/tokenRepository.d.ts +73 -0
- package/lib/core/security/tokenRepository.js +359 -460
- package/lib/core/security/userRepository.js +1 -1
- package/lib/core/shared/repository.d.ts +178 -0
- package/lib/core/shared/repository.js +365 -450
- package/lib/kerror/codes/7-security.json +6 -0
- package/lib/model/security/token.d.ts +2 -0
- package/lib/model/security/token.js +1 -0
- package/lib/service/storage/elasticsearch.js +4 -0
- package/lib/types/ProfileDefinition.d.ts +1 -1
- package/lib/util/{inflector.d.ts → Inflector.d.ts} +5 -0
- package/lib/util/{inflector.js → Inflector.js} +12 -1
- package/package.json +3 -2
|
@@ -51,6 +51,12 @@
|
|
|
51
51
|
"code": 8,
|
|
52
52
|
"message": "%s cannot be refreshed.",
|
|
53
53
|
"class": "UnauthorizedError"
|
|
54
|
+
},
|
|
55
|
+
"invalid_expiration": {
|
|
56
|
+
"description": "The specified expiration time is invalid",
|
|
57
|
+
"code": 9,
|
|
58
|
+
"message": "Token can not be created with this expiration time: %s",
|
|
59
|
+
"class": "BadRequestError"
|
|
54
60
|
}
|
|
55
61
|
}
|
|
56
62
|
},
|
|
@@ -11,6 +11,7 @@ export interface TokenContent {
|
|
|
11
11
|
connectionIds?: string[];
|
|
12
12
|
jwt?: string;
|
|
13
13
|
refreshed?: boolean;
|
|
14
|
+
singleUse?: boolean;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Represents a token that identify an user.
|
|
@@ -22,6 +23,7 @@ export declare class Token implements TokenContent {
|
|
|
22
23
|
userId: string;
|
|
23
24
|
jwt: string;
|
|
24
25
|
refreshed: boolean;
|
|
26
|
+
singleUse: boolean;
|
|
25
27
|
constructor(data?: TokenContent);
|
|
26
28
|
get type(): "apiKey" | "authToken";
|
|
27
29
|
static get AUTH_PREFIX(): string;
|
|
@@ -2010,6 +2010,10 @@ class ElasticSearch extends Service {
|
|
|
2010
2010
|
{ index: [] }
|
|
2011
2011
|
);
|
|
2012
2012
|
|
|
2013
|
+
if (esRequest.index.length === 0) {
|
|
2014
|
+
return [];
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2013
2017
|
debug("Delete indexes: %o", esRequest);
|
|
2014
2018
|
|
|
2015
2019
|
await this._client.indices.delete(esRequest);
|
|
@@ -62,6 +62,17 @@ class Inflector {
|
|
|
62
62
|
static camelCase(string) {
|
|
63
63
|
return lodash_1.default.camelCase(string);
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Converts a string to snake_case
|
|
67
|
+
* https://stackoverflow.com/a/52964182
|
|
68
|
+
*/
|
|
69
|
+
static snakeCase(str) {
|
|
70
|
+
return str
|
|
71
|
+
.replace(/\W+/g, " ")
|
|
72
|
+
.split(/ |\B(?=[A-Z])/)
|
|
73
|
+
.map((word) => word.toLowerCase())
|
|
74
|
+
.join("_");
|
|
75
|
+
}
|
|
65
76
|
}
|
|
66
77
|
exports.Inflector = Inflector;
|
|
67
|
-
//# sourceMappingURL=
|
|
78
|
+
//# sourceMappingURL=Inflector.js.map
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kuzzle",
|
|
3
3
|
"author": "The Kuzzle Team <support@kuzzle.io>",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.20.0",
|
|
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": "bin/start-kuzzle-server",
|
|
7
7
|
"scripts": {
|
|
8
|
+
"docker": "docker-compose run kuzzle_node_1 ",
|
|
8
9
|
"file": "npx ergol docker/scripts/start-kuzzle-dev.ts -c ./config/ergol.config.json",
|
|
9
10
|
"start:dev": "npx ergol docker/scripts/start-kuzzle-dev.ts -c ./config/ergol.config.json --script-args=--enable-plugins functional-test-plugin",
|
|
10
11
|
"prepublishOnly": "npm run build",
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
"ms": "^2.1.3",
|
|
70
71
|
"murmurhash-native": "^3.5.0",
|
|
71
72
|
"ndjson": "^2.0.0",
|
|
72
|
-
"node-segfault-handler": "^1.
|
|
73
|
+
"node-segfault-handler": "^1.4.2",
|
|
73
74
|
"passport": "^0.6.0",
|
|
74
75
|
"protobufjs": "~7.1.2",
|
|
75
76
|
"rc": "1.2.8",
|