Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "src/caveat"

Index

Variables

Macaroon

Macaroon: any

MacaroonsBuilder

MacaroonsBuilder: any

MacaroonsVerifier

MacaroonsVerifier: any

Const validComp

validComp: Set<string> = new Set(['<', '>', '='])

Functions

hasCaveat

  • description

    hasCaveat will take a macaroon and a caveat and evaluate whether or not that caveat exists on the macaroon

    Parameters

    • rawMac: string

      raw macaroon to determine caveats from

    • c: Caveat | string

      Caveat to test against macaroon

    Returns string | boolean | ErrInvalidCaveat

verifyCaveats

  • description

    A function that verifies the caveats on a macaroon. The functionality mimics that of loop's lsat utilities.

    Parameters

    • caveats: Caveat[]

      a list of caveats to verify

    • satisfiers: Satisfier | Satisfier[]

      a single satisfier or list of satisfiers used to verify caveats

    • Default value options: object = {}

    Returns boolean

verifyFirstPartyMacaroon

  • verifyFirstPartyMacaroon(rawMac: string, secret: string, satisfiers?: Satisfier | Satisfier[], options?: any): boolean
  • description

    verifyFirstPartyMacaroon will check if a macaroon is valid or not based on a set of satisfiers to pass as general caveat verifiers. This will also run against caveat.verityCaveats to ensure that satisfyPrevious will validate

    Parameters

    • rawMac: string
    • secret: string

      The secret key used to sign the macaroon

    • Optional satisfiers: Satisfier | Satisfier[]

      a single satisfier or list of satisfiers used to verify caveats

    • Default value options: any = {}

    Returns boolean

Generated using TypeDoc