HoppRESTAuthHAWK (12/auth.ts)

hoppscotch · packages/hoppscotch-data/src/rest/v/12/auth.ts · typescript · MIT
auth, tag:embed-classified

Defines Zod schemas for various REST authentication methods.

// Source: https://github.com/hoppscotch/hoppscotch | License: MIT | Copyright 2022
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from "zod"
import {
  HoppRESTAuthBasic,
  HoppRESTAuthBearer,
  HoppRESTAuthInherit,
  HoppRESTAuthNone,
} from "../1"
import { HoppRESTAuthAPIKey } from "../4"
import { HoppRESTAuthAWSSignature } from "../7"
import { HoppRESTAuthDigest } from "../8/auth"
import { HoppRESTAuthOAuth2 } from "../11/auth"

export const HoppRESTAuthHAWK = z.object({
  authType: z.literal("hawk"),
  authId: z.string().catch(""),
  authKey: z.string().catch(""),
  algorithm: z.enum(["sha256", "sha1"]).catch("sha256"),
  includePayloadHash: z.boolean().catch(false),

  // Optional fields
  user: z.string().optional(),
  nonce: z.string().optional(),
  e

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key