INNER CODE UNIT · TypeScript
verify
cloudflare/web-bot-auth · packages/web-bot-auth/src/index.ts:358
export async function verify<V extends WebBotVerifier>(
request: Request | RequestDescriptor,
options: VerifyOptions<V>
): Promise<VerifiedWebBotSignature<V>> {
const algorithms = options.algorithms ?? ["ed25519", "rsa-pss-sha512"];
const now = seconds(options.now ?? new Date(), "now");
let selected: UntrustedWebBotSignatureCandidate | undefined;
const verified = await verifySignature(request, {
label: options.label,
policy: {
algorithms,
requiredComponents: [],
requiredParameters: ["created", "expires", "keyid", "alg", "tag"],
maxAge: options.maxAge ?? 86_400,
clockSkew: options.clockSkew ?? 0,
now,
},
async resolveVerifier(candidate) {