export type SigV4Verdict = { ok: true; keyId: string; region: string; service: string; } | { ok: false; reason: 'unsigned' | 'malformed' | 'unknown_key' | 'bad_signature' | 'expired'; keyId?: string; }; /** The path a request arrived with, where the kernel routed it by another (a virtual-hosted bucket put in front of the * path: pack-fetch's `routed`); a client signed the path it sent. */ export declare const ORIGINAL_PATH_HEADER = "x-volter-original-path"; /** * Whether `request` is signed with SigV4 by a key `secretOf` knows (its secret, or undefined for a key the twin never * issued). `body` is the bytes it carries (the payload hash of * a service that sends no `x-amz-content-sha256`); `now` is the instant a presigned URL's expiry is checked at, in epoch * milliseconds, on the clock its signer signed by: the app's (`receiverNow()`, the default; ADR 0036 ยง4). The caller * decides what an unsigned request is (a public read, or a refusal). */ export declare function verifySigV4(request: Request, body: Uint8Array | string | undefined, secretOf: (keyId: string) => string | undefined | Promise, now?: number): Promise; /** * The SigV4 headers a client adds (`authorization`, `x-amz-date`, and for S3 `x-amz-content-sha256`), signed over the * request as it will be sent: its method, URL, the headers it carries (host, `x-amz-*` and the content type are signed) * and its body, at `at`. What a walk sends as an AWS SDK sends it; the verifier above is its other side. */ export declare function signSigV4(input: { method: string; url: string; headers?: Record; body?: string | Uint8Array; keyId: string; secret: string; region: string; service: string; at: Date; }): Record; /** * A presigned URL signed again with a key: its date, expiry, region, service and signed headers are the URL's own * (X-Amz-Date, X-Amz-Expires, X-Amz-Credential's scope, X-Amz-SignedHeaders, `host` when it names none), its key and * signature this key's. What an SDK's getSignedUrl makes, for a walk that wrote the URL as its client printed it. A * signed header other than `host` (a Content-Type the URL binds) is signed with the value the request sends (`headers`). */ export declare function presignSigV4(input: { method: string; url: string; keyId: string; secret: string; host?: string; headers?: Record; }): string;