kinetex - v1.0.0-rc.1
    Preparing search index...

    Class SigV4Signer

    Stateful SigV4 signer with credential caching and automatic clock skew correction. Convenience wrapper around the stateless functions.

    const signer = new SigV4Signer({
    credentials: envCredentials(),
    region: "us-east-1",
    service: "s3",
    });
    const signed = await signer.sign({ method: "GET", url: "https://s3.amazonaws.com/...", headers: {}, body: null });
    Index

    Constructors

    Methods

    • Sign a request with the current configuration and accumulated clock skew.

      Parameters

      • request: SignableRequest

        The request to sign

      Returns Promise<SignedRequest>

      Signed request with Authorization and x-amz-* headers populated

    • Generate a presigned URL for a request.

      Parameters

      • request: SignableRequest

        The request to presign

      • Optionaloptions: PresignOptions

        Presigning options (expiry, extra params)

      Returns Promise<string>

      Presigned URL string with query-string auth params

    • Sign an S3 POST policy for browser-based uploads.

      Parameters

      • policy: S3PostPolicy

        The POST policy (expiration + conditions)

      Returns Promise<S3PostSignature>

      Form fields to include in the multipart POST

    • Initialize state for a chunked/streaming upload.

      Parameters

      • request: SignableRequest

        The base request (body will be replaced with chunks)

      Returns Promise<{ signedRequest: SignedRequest; state: ChunkedSigningState }>

      An object containing signedRequest (the seed request with chunked headers) and state (the initial chunked signing state for subsequent signChunk calls).

    • Update the clock skew correction based on a server response. Call this whenever you receive a clock skew error.

      Parameters

      • responseHeaders: Record<string, string>

      Returns void

    • Check if a response is a clock skew error and auto-correct. Returns true if the skew was detected and updated (caller should retry).

      Parameters

      • status: number
      • body: string
      • responseHeaders: Record<string, string>

      Returns boolean