iya-sts
    Preparing search index...

    Variable biscuitAuthorize

    biscuitAuthorize: (
        value: any,
        publicKey: any,
        run: any,
    ) => Promise<
        | { error?: undefined; ok: boolean; stage?: undefined; token: any }
        | { error: any; ok: boolean; stage: string; token?: undefined }
        | {
            authorizeError: any;
            blocks: any;
            ok: boolean;
            queryError: any;
            rows: any[];
        },
    > = biscuitAuthorize

    Type Declaration

      • (
            value: any,
            publicKey: any,
            run: any,
        ): Promise<
            | { error?: undefined; ok: boolean; stage?: undefined; token: any }
            | { error: any; ok: boolean; stage: string; token?: undefined }
            | {
                authorizeError: any;
                blocks: any;
                ok: boolean;
                queryError: any;
                rows: any[];
            },
        >
      • Verifies a biscuit under its root public key and runs an authorizer over it: the caller's Datalog facts and policies, then each query in order, then the authorization itself, every evaluation bounded by limits.

        A query that throws stops the run (the queries after it and the authorization are not run). The library's errors come back as they were thrown, for the caller to read (RunLimit, FailedLogic).

        Parameters

        • value: any

          the token, URL-safe base64

        • publicKey: any

          an Ed25519 public KeyObject

        • run: any

          { authorizer, queries, limits }: authorizer() builds { source, params } (called inside the build step), queries the rule texts, limits the run limits

        Returns Promise<
            | { error?: undefined; ok: boolean; stage?: undefined; token: any }
            | { error: any; ok: boolean; stage: string; token?: undefined }
            | {
                authorizeError: any;
                blocks: any;
                ok: boolean;
                queryError: any;
                rows: any[];
            },
        >

        a promise of { ok: false, stage, error } — stage key, load, parse or build — or { ok: true, rows, queryError, authorizeError, blocks }: rows[i] the terms of each fact query i produced; authorizeError undefined when authorization was not run, null when it passed