@lucid-softworks/http-auth-api-key
v0.1.0
Published
Header and query API key extraction with timing-safe comparison.
Maintainers
Readme
@lucid-softworks/http-auth-api-key
API key extraction and equal-length timing-safe comparison.
import { equalApiKeys, getApiKey } from "@lucid-softworks/http-auth-api-key";
const key = getApiKey(request, { header: "x-api-key" });
const valid = key !== undefined && equalApiKeys(key, expected);Keys can be read from one explicit header or query parameter. Empty values are treated as absent.
