INNER CODE UNIT · TypeScript
signingOptions
cloudflare/web-bot-auth · packages/web-bot-auth/src/index.ts:254
function signingOptions(
request: Request | RequestDescriptor,
options: Omit<SignOptions, "signer"> & {
readonly signer: Pick<WebBotSigner, "algorithm" | "keyid">;
}
) {
if (
options.signer.algorithm !== "ed25519" &&
options.signer.algorithm !== "rsa-pss-sha512"
) {
return policyError("signer algorithm is unsupported");
}
if (options.signer.keyid === "") {
return policyError("signer keyid must not be empty");
}
const label = options.label ?? "sig1";
const created = seconds(options.created ?? new Date(), "created");
const expires = seconds(options.expires, "expires");