Add telemetry support from via Judd

This commit is contained in:
kittentm 2026-02-22 19:48:25 +01:00
commit 227002a9ef
19 changed files with 4110 additions and 4 deletions

View file

@ -0,0 +1,14 @@
const crypto = require('crypto');
function validateBOSSDigestMiddleware(request, response, next) {
const calculatedHash = crypto.createHash('sha1').update(request.rawBody).digest('hex');
const expectedHash = request.headers['x-boss-digest'];
if (calculatedHash !== expectedHash) {
return next('Provided BOSS digest does not match the calculated hash');
}
next();
}
module.exports = validateBOSSDigestMiddleware;