/** * Lifecycle-owned authorization boundary for React Server Actions. * * Core never supplies an allow-all implementation. Applications that expose * Server Actions must compose one provider through the extension contract * registry for the active server generation. * * @module extensions/auth/rsc-action-authorization-provider */ import type { ApplicationIdentity } from "../../security/application-auth/types.js"; /** Generation-owned contract name registered by an application-selected authorization extension. */ export declare const RscActionAuthorizationProviderName: "RscActionAuthorizationProvider"; /** Default deadline for one asynchronous authorization decision: 30 seconds. */ export declare const RSC_ACTION_AUTHORIZATION_TIMEOUT_MS = 30000; /** Cooperative-cancellation grace: 1,000 ms before a non-settling generation is quarantined. */ export declare const RSC_ACTION_AUTHORIZATION_TERMINATION_GRACE_MS = 1000; /** Maximum top-level arguments in one Server Action request: 50. */ export declare const RSC_ACTION_MAX_TOP_LEVEL_ARGUMENTS = 50; /** Maximum nested container depth in the detached authorization argument graph: 64. */ export declare const RSC_ACTION_AUTHORIZATION_MAX_ARGUMENT_DEPTH = 64; /** Maximum values in the complete detached authorization argument graph: 50,000. */ export declare const RSC_ACTION_AUTHORIZATION_MAX_ARGUMENT_NODES = 50000; /** Maximum aggregate array elements and record properties in the argument graph: 100,000. */ export declare const RSC_ACTION_AUTHORIZATION_MAX_ARGUMENT_PROPERTIES = 100000; /** Maximum length of any one dense argument array: 50,000. */ export declare const RSC_ACTION_AUTHORIZATION_MAX_ARGUMENT_ARRAY_LENGTH = 50000; /** JSON-compatible, data-only value domain; numbers are always finite. */ export type RscActionAuthorizationValue = string | number | boolean | null | Readonly | Readonly; /** Immutable dense data-only array with stable index and iteration semantics. */ export interface RscActionAuthorizationArray extends Iterable { readonly length: number; readonly [index: number]: RscActionAuthorizationValue; } /** Immutable null-prototype data-only record; absent properties resolve to `undefined`. */ export interface RscActionAuthorizationRecord { readonly [key: string]: RscActionAuthorizationValue | undefined; } /** Detached immutable action metadata and bounded JSON-compatible arguments. */ export interface RscActionAuthorizationContext { readonly id: string; readonly args: Readonly; readonly projectId?: string; readonly projectSlug?: string; readonly contentSourceId?: string; readonly releaseId?: string; readonly branch?: string | null; readonly isLocalProject?: boolean; readonly mode?: "development" | "production"; } /** Immutable null-prototype lowercase header snapshot; it contains no request body. */ export interface RscActionAuthorizationHeaders { /** Absent lowercase names resolve to `undefined`. */ readonly [lowercaseName: string]: string | undefined; } /** Immutable, bodyless request metadata detached from the mutable request object. */ export interface RscActionAuthorizationRequest { readonly url: string; readonly method: string; /** Detached authenticated application identity, when application auth admitted the request. */ readonly identity?: ApplicationIdentity; /** Lowercase header names mapped to their normalized combined values. */ readonly headers: Readonly; /** * Core-owned cancellation capability. It is aborted when the client * disconnects, the authorization deadline expires, or the provider's * extension generation begins retirement. */ readonly signal: AbortSignal; } /** * Decide one Server Action invocation. `true` invokes the action and `false` * returns 403. Throwing, rejecting, timing out, or returning a non-boolean * fails closed with 503; the action is never loaded before authorization. */ export type RscActionAuthorize = (request: Readonly, context: Readonly) => boolean | Promise; /** * Required generation-owned Server Action authorization contract. An absent, * malformed, retiring, failed, or non-cooperative provider returns 503 with * `Cache-Control: no-store`; core has no allow-all fallback. */ export interface RscActionAuthorizationProvider { /** * Return `true` only when this request may invoke the selected action. * The function must not depend on a receiver. Throwing or returning any * value other than a boolean fails closed at the request boundary. */ readonly authorize: RscActionAuthorize; } /** * Capture an exact `{ authorize }` extension registration without invoking * accessors or retaining mutable provider metadata. */ export declare function snapshotRscActionAuthorizationProvider(value: unknown): Readonly; /** Create immutable provider registration metadata from a standalone authorizer. */ export declare function createRscActionAuthorizationProvider(authorize: RscActionAuthorize): Readonly; //# sourceMappingURL=rsc-action-authorization-provider.d.ts.map