import type { FetchLike } from "../handlers/HandlerRegistration.js"; import { type EntitlementState } from "./EntitlementEvaluation.js"; /** Where Decionis publishes the keys that sign policy bundles and the entitlement. */ export declare const ENTITLEMENT_JWKS_PATH = "/.well-known/decionis-policy-bundle-jwks.json"; export declare const ENTITLEMENT_PATH = "/v1/edge/entitlement"; /** The signed entitlement and the keys to check it with, as a source read them. */ export interface EntitlementMaterial { /** The compact JWS, or null when there is none to read. */ readonly token: string | null; /** The JWKS document's text, or null when it could not be read. */ readonly jwks: string | null; } export interface EntitlementSource { read(): Promise; } /** A base URL without its trailing slashes, trimmed in one pass. */ export declare function withoutTrailingSlash(url: string): string; /** * The compact JWS out of what a source returned: the JWS on its own, or a * JSON object carrying it as `entitlement` or `signed_entitlement`. */ export declare function entitlementTokenOf(text: string): string | null; /** * Checks the entitlement's signature against the JWKS: `alg` EdDSA, the * entitlement's `typ`, a `kid` the JWKS holds. Its claims are evaluated * elsewhere (`licenceWarnings`), so an expired entitlement is still read. */ export declare function verifyEntitlement(material: EntitlementMaterial): Promise; /** * `GET /v1/edge/entitlement` with the organisation's key, and the JWKS from * its well-known path on the same origin, both through the guarded fetch. * A failure of either is a missing entitlement or keys, never an error: the * entitlement only ever warns. */ export declare class UrlEntitlementSource implements EntitlementSource { private readonly options; constructor(options: { readonly baseUrl: string; readonly apiKey: () => string; readonly fetch: FetchLike; readonly timeoutMs?: number; }); read(): Promise; private get; } /** * The air-gapped form: the entitlement an operator downloaded and placed on * disk, and the Decionis JWKS pinned beside it. Either file missing is a * missing entitlement or keys. */ export declare class FileEntitlementSource implements EntitlementSource { private readonly entitlementFile; private readonly jwksFile; constructor(entitlementFile: string | null, jwksFile: string | null); read(): Promise; } //# sourceMappingURL=Entitlement.d.ts.map