iya-sts
    Preparing search index...

    Variable biscuitAttenuate

    biscuitAttenuate: (
        value: any,
        publicKey: any,
        prepare: any,
    ) => Promise<
        | { error?: undefined; ok: boolean; stage?: undefined; token: any }
        | { error: any; ok: boolean; stage: string; token?: undefined }
        | { ok: boolean; refusal: any; stage: string; value?: undefined }
        | { ok: boolean; refusal?: undefined; stage?: undefined; value: any },
    > = biscuitAttenuate

    Type Declaration

      • (
            value: any,
            publicKey: any,
            prepare: any,
        ): Promise<
            | { error?: undefined; ok: boolean; stage?: undefined; token: any }
            | { error: any; ok: boolean; stage: string; token?: undefined }
            | { ok: boolean; refusal: any; stage: string; value?: undefined }
            | { ok: boolean; refusal?: undefined; stage?: undefined; value: any },
        >
      • Appends a block to a biscuit — the attenuation a resource server makes without the authorization server. The token is verified first: the library will not open one it has not verified.

        prepare() is called once the token has parsed, and answers the block ({ source, params }) or { refusal }, which is passed back untouched.

        Parameters

        • value: any

          the token, URL-safe base64

        • publicKey: any

          an Ed25519 public KeyObject

        • prepare: any

          builds the block, or refuses

        Returns Promise<
            | { error?: undefined; ok: boolean; stage?: undefined; token: any }
            | { error: any; ok: boolean; stage: string; token?: undefined }
            | { ok: boolean; refusal: any; stage: string; value?: undefined }
            | { ok: boolean; refusal?: undefined; stage?: undefined; value: any },
        >

        a promise of { ok: true, value }, or { ok: false, stage, error } — stage key, load, parse or library — or { ok: false, stage: 'prepare', refusal }