addons-scanner-utils 10.1.0 → 10.2.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/dist/functions.js +3 -2
- package/package.json +2 -2
package/dist/functions.js
CHANGED
|
@@ -57,6 +57,7 @@ const createExpressApp = ({ _console = console, _fetch = node_fetch_1.default, _
|
|
|
57
57
|
// error that will be converted to an API error by the error handler
|
|
58
58
|
// middleware declared at the bottom of the middleware chain.
|
|
59
59
|
app.use((req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
+
var _a;
|
|
60
61
|
const allowedMethods = ['POST'];
|
|
61
62
|
if (req.headers['content-type'] !== 'application/json') {
|
|
62
63
|
// We do not throw because we are inside a callback, so we pass an error
|
|
@@ -75,14 +76,14 @@ const createExpressApp = ({ _console = console, _fetch = node_fetch_1.default, _
|
|
|
75
76
|
}));
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
|
-
|
|
79
|
+
const authorization = (_a = req.get('X-Forwarded-Authorization')) !== null && _a !== void 0 ? _a : req.get('Authorization');
|
|
80
|
+
if (!authorization) {
|
|
79
81
|
next((0, exports.createApiError)({
|
|
80
82
|
message: `missing authorization header`,
|
|
81
83
|
status: 400,
|
|
82
84
|
}));
|
|
83
85
|
return;
|
|
84
86
|
}
|
|
85
|
-
const authorization = String(req.get('authorization'));
|
|
86
87
|
if (authorization.startsWith('HMAC-SHA256 ') && req.rawBody) {
|
|
87
88
|
const digest = node_crypto_1.default
|
|
88
89
|
.createHmac('sha256', apiKey)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "addons-scanner-utils",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"description": "Various addons related helpers to build CLIs.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"express": "5.2.1",
|
|
57
57
|
"jest": "^30.2.0",
|
|
58
58
|
"node-fetch": "2.6.11",
|
|
59
|
-
"prettier": "3.8.
|
|
59
|
+
"prettier": "3.8.1",
|
|
60
60
|
"pretty-quick": "4.2.2",
|
|
61
61
|
"rimraf": "^6.1.0",
|
|
62
62
|
"safe-compare": "1.1.4",
|