import type { FetchLike } from "../handlers/HandlerRegistration.js"; import { SecretHandle } from "../secrets/SecretHandle.js"; import type { DownstreamCredential } from "./DownstreamCredential.js"; export type PrivateKeyJwtAlgorithm = "ES256" | "PS256"; export interface PrivateKeyJwtOptions { /** The token endpoint; a sealed egress destination under the downstream's anchor. */ readonly tokenUrl: string; readonly clientId: string; readonly keyId: string | null; readonly algorithm: PrivateKeyJwtAlgorithm; /** The assertion's audience; the token endpoint itself when null. */ readonly audience: string | null; readonly scope: string | null; readonly timeoutMs: number; } export declare const CLIENT_ASSERTION_TYPE = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"; /** * OAuth 2.0 client credentials with `private_key_jwt`, the FAPI baseline: * an assertion signed with this process's private key proves the client to * the token endpoint, and the access token it returns is held as a secret * handle until thirty seconds before it expires, one refresh in flight at a * time. A token that cannot be obtained is a failure before dispatch: the * handler asks for headers before `dispatch.run`, so the downstream never * sees a request this process could not authenticate. */ export declare class PrivateKeyJwtCredential implements DownstreamCredential { private readonly options; private readonly key; private readonly fetchImpl; private readonly clock; private cached; private pending; readonly kind: "PRIVATE_KEY_JWT"; constructor(options: PrivateKeyJwtOptions, key: () => SecretHandle, fetchImpl: FetchLike, clock?: () => number); /** The bearer header for any request; what is signed is the assertion to the token endpoint, not the request. */ readonly headersFor: DownstreamCredential["headersFor"]; /** Whether a token is held and still fresh; for status, never the value. */ get fresh(): boolean; close(): void; private token; private obtain; } //# sourceMappingURL=PrivateKeyJwtCredential.d.ts.map