@aeriajs/core 0.0.94 → 0.0.95
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/dist/accessControl.js +4 -4
- package/dist/accessControl.mjs +4 -4
- package/package.json +3 -3
package/dist/accessControl.js
CHANGED
|
@@ -14,20 +14,20 @@ const isFunctionExposed = async (collection, fnName, token) => {
|
|
|
14
14
|
if (!collection.functions) {
|
|
15
15
|
return FunctionExposedStatus.FunctionNotExposed;
|
|
16
16
|
}
|
|
17
|
-
if (!token) {
|
|
18
|
-
return FunctionExposedStatus.FunctionAccessible;
|
|
19
|
-
}
|
|
20
17
|
if (collection.exposedFunctions && fnName in collection.exposedFunctions) {
|
|
21
18
|
const exposed = collection.exposedFunctions[fnName];
|
|
22
19
|
if (exposed === false) {
|
|
23
20
|
return FunctionExposedStatus.FunctionNotExposed;
|
|
24
21
|
}
|
|
22
|
+
if (!token) {
|
|
23
|
+
return FunctionExposedStatus.FunctionAccessible;
|
|
24
|
+
}
|
|
25
25
|
return (0, common_1.isGranted)(exposed, token)
|
|
26
26
|
? FunctionExposedStatus.FunctionAccessible
|
|
27
27
|
: FunctionExposedStatus.FunctionNotGranted;
|
|
28
28
|
}
|
|
29
29
|
if (config.security.exposeFunctionsByDefault) {
|
|
30
|
-
if (config.security.exposeFunctionsByDefault !== 'unauthenticated' && !token.authenticated) {
|
|
30
|
+
if (config.security.exposeFunctionsByDefault !== 'unauthenticated' && (!token || !token.authenticated)) {
|
|
31
31
|
return FunctionExposedStatus.FunctionNotGranted;
|
|
32
32
|
}
|
|
33
33
|
return FunctionExposedStatus.FunctionAccessible;
|
package/dist/accessControl.mjs
CHANGED
|
@@ -12,18 +12,18 @@ export const isFunctionExposed = async (collection, fnName, token) => {
|
|
|
12
12
|
if (!collection.functions) {
|
|
13
13
|
return "FUNCTION_NOT_EXPOSED" /* FunctionNotExposed */;
|
|
14
14
|
}
|
|
15
|
-
if (!token) {
|
|
16
|
-
return "FUNCTION_ACCESSIBLE" /* FunctionAccessible */;
|
|
17
|
-
}
|
|
18
15
|
if (collection.exposedFunctions && fnName in collection.exposedFunctions) {
|
|
19
16
|
const exposed = collection.exposedFunctions[fnName];
|
|
20
17
|
if (exposed === false) {
|
|
21
18
|
return "FUNCTION_NOT_EXPOSED" /* FunctionNotExposed */;
|
|
22
19
|
}
|
|
20
|
+
if (!token) {
|
|
21
|
+
return "FUNCTION_ACCESSIBLE" /* FunctionAccessible */;
|
|
22
|
+
}
|
|
23
23
|
return isGranted(exposed, token) ? "FUNCTION_ACCESSIBLE" /* FunctionAccessible */ : "FUNCTION_NOT_GRANTED" /* FunctionNotGranted */;
|
|
24
24
|
}
|
|
25
25
|
if (config.security.exposeFunctionsByDefault) {
|
|
26
|
-
if (config.security.exposeFunctionsByDefault !== "unauthenticated" && !token.authenticated) {
|
|
26
|
+
if (config.security.exposeFunctionsByDefault !== "unauthenticated" && (!token || !token.authenticated)) {
|
|
27
27
|
return "FUNCTION_NOT_GRANTED" /* FunctionNotGranted */;
|
|
28
28
|
}
|
|
29
29
|
return "FUNCTION_ACCESSIBLE" /* FunctionAccessible */;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.95",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"mongodb-memory-server": "^9.2.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@aeriajs/builtins": "^0.0.
|
|
44
|
+
"@aeriajs/builtins": "^0.0.95",
|
|
45
45
|
"@aeriajs/common": "^0.0.59",
|
|
46
46
|
"@aeriajs/entrypoint": "^0.0.60",
|
|
47
47
|
"@aeriajs/http": "^0.0.68",
|
|
48
|
-
"@aeriajs/security": "^0.0.
|
|
48
|
+
"@aeriajs/security": "^0.0.95",
|
|
49
49
|
"@aeriajs/types": "^0.0.55",
|
|
50
50
|
"@aeriajs/validation": "^0.0.62"
|
|
51
51
|
},
|