@riocrypto/common-server 1.0.2221 → 1.0.2222
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.
|
@@ -22,11 +22,6 @@ const secret_manager_client_1 = require("../clients/secret-manager-client");
|
|
|
22
22
|
const admin_auth_1 = require("../models/admin-auth");
|
|
23
23
|
const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
24
|
var _a, _b;
|
|
25
|
-
// Early return for public routes
|
|
26
|
-
if (authorizationTypes.includes(common_1.AuthorizationType.Public)) {
|
|
27
|
-
next();
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
25
|
// Prepare promises for parallel execution
|
|
31
26
|
const promises = [];
|
|
32
27
|
// Check for cluster API key - only if needed
|
|
@@ -165,8 +160,9 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
165
160
|
// Wait for all promises to complete
|
|
166
161
|
yield Promise.all(promises);
|
|
167
162
|
// Check authorization results and proceed if authorized
|
|
168
|
-
if (
|
|
169
|
-
|
|
163
|
+
if (authorizationTypes.includes(common_1.AuthorizationType.Public) ||
|
|
164
|
+
(authorizationTypes.includes(common_1.AuthorizationType.Cluster) &&
|
|
165
|
+
req.validClusterApiKey) ||
|
|
170
166
|
(authorizationTypes.includes(common_1.AuthorizationType.GenesisAdmin) &&
|
|
171
167
|
req.validGenisisAdminKey) ||
|
|
172
168
|
(authorizationTypes.includes(common_1.AuthorizationType.Auth) && req.auth) ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2222",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
29
29
|
"@google-cloud/storage": "^6.9.5",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.7.0",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.1953",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|