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[];
},
>
-
Parameters
- value: any
- publicKey: any
- run: any
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
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).