@aikidosec/firewall
Version:
Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks
25 lines (24 loc) • 567 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isHTTPAuthScheme = isHTTPAuthScheme;
const AUTH_SCHEMES = [
"basic",
"bearer",
"digest",
"dpop",
"gnap",
"hoba",
"mutal",
"negotiate",
"privatetoken",
"scram-sha-1",
"scram-sha-256",
"vapid",
];
/**
* Checks if a string is a valid HTTP authentication scheme.
* https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml
*/
function isHTTPAuthScheme(scheme) {
return AUTH_SCHEMES.includes(scheme.toLowerCase());
}