INNER CODE UNIT · TypeScript

hasExactBareTarget

cloudflare/web-bot-auth · packages/web-bot-auth/src/index.ts:205

function hasExactBareTarget(
  components: readonly ComponentDescriptor[]
): boolean {
  return components.some(
    ({ name, parameters }) =>
      (name === "@authority" || name === "@target-uri") &&
      Object.keys(parameters).length === 0
  );
}

function verifiedSignatureAgent(
  request: Request | RequestDescriptor,
  components: readonly ComponentDescriptor[]
): SignatureAgentEntry | undefined {
  const header = requestHeader(request, SIGNATURE_AGENT_HEADER);
  if (header === undefined) return undefined;
  const parsed = parseSignatureAgentHeader(header);
  if (parsed.kind === "legacy") {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…