import { Schema } from "effect"; /** The list's JWT `typ`, so neither a list nor an access token can pass for the other. */ export declare const type = "key-list+jwt"; /** Every API key the issuer creates begins with this, which tells it apart from a JWT. */ export declare const keyPrefix = "clankerauth_"; /** * How long a list decides, in seconds from its `iat`: for as long as a resource server * cannot read a newer one, it keeps accepting the keys this one grants. So it is also the * longest a revoked key stays usable during an issuer outage. */ export declare const lifetime: number; export declare const Entry: Schema.Struct<{ readonly id: Schema.String; readonly sealed: Schema.String; }>; export type Entry = typeof Entry.Type; /** The claims a list carries besides `iss`, `aud`, `iat` and `exp`. */ export declare const Claims: Schema.Struct<{ readonly keys: Schema.$Array>; }>; /** What one key may do on the list's resource. */ export declare const Grant: Schema.Struct<{ readonly keyId: Schema.NonEmptyString; readonly ownerId: Schema.NonEmptyString; readonly scopes: Schema.$Array; /** Epoch milliseconds; `null` for a key that does not expire. */ readonly expiresAt: Schema.NullOr; }>; export type Grant = typeof Grant.Type; /** The digest an issuer stores for a key: SHA-256 of the whole key, prefix included. */ export declare const digest: (key: string) => Promise>; /** One key's entry on one resource, from the digest the issuer stores. */ export declare const seal: (keyDigest: Uint8Array, resource: string, grant: Grant) => Promise; /** * What a list grants this key on its resource, or `undefined` when the list has no entry * for it. Rejects only for an entry that does not open, which the issuer never writes. */ export declare const open: (key: string, resource: string, entries: ReadonlyMap) => Promise;