/** * AWS Signature Version 4 (SigV4) Request Signing Utility * * This is a minimal, focused implementation for signing AWS API requests. * It uses only Node.js native `crypto` module — no AWS SDK dependencies. * * Reference: https://docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html */ export interface AwsCredentials { accessKeyId: string; secretAccessKey: string; sessionToken?: string; } export interface SignRequestOptions { method: "POST" | "GET"; url: string; body: string; credentials: AwsCredentials; region: string; service: string; timestamp?: Date; } export interface SignedHeaders { host: string; "x-amz-date": string; "x-amz-content-sha256": string; authorization: string; "x-amz-security-token"?: string; } /** * Sign an AWS API request using SigV4. * * @param options - The request details and credentials * @returns Headers to include in the HTTP request * * @example * ```ts * const headers = signRequest({ * method: "POST", * url: "https://bedrock-runtime.us-east-1.amazonaws.com/model/.../converse", * body: JSON.stringify({ messages: [...] }), * credentials: { accessKeyId: "...", secretAccessKey: "..." }, * region: "us-east-1", * service: "bedrock" * }); * * fetch(url, { headers: { ...headers, "Content-Type": "application/json" }, body }); * ``` */ export declare function signRequest(options: SignRequestOptions): SignedHeaders; //# sourceMappingURL=AwsSigV4.d.ts.map