@oazmi/kitchensink - v0.10.1
    Preparing search index...

    Interface S3PresignUrlV4Config<T>

    configuration options for the s3PresignUrlV4 function. it has all of the options available to S3SignHeadersV4Config, in addition to a few more.

    interface S3PresignUrlV4Config<T = Record<string, string>> {
        query?: string;
        headers?: HttpHeaderObject | T;
        date?: string | number;
        service?: string;
        method?: "GET" | "POST" | "HEAD" | "PUT";
        region?: string;
        expires?: number;
        scheme?: "http" | "https";
        payload?: { unsigned: true };
    }

    Type Parameters

    • T = Record<string, string>

    Hierarchy (View Summary)

    Index

    Properties

    query?: string

    query strings should go here instead of being part of the pathname. moreover, it should not include the leading "?" query character, and boolean query keys should always be followed with an "=" equals sign for instance, for the url "http://localhost:9000/default/temp/hello_world.txt?attributes&max-keys=20", the query string "attributes=&max-keys=20"

    [!note]

    amazon requires you to sort the query parameters by their key names, according to: link. so the s3 signer functions perform the query-parameter sorting automatically.

    undefined

    headers?: HttpHeaderObject | T

    additional headers to include in your request. you can use these headers to overwrite some of the following default/computed header fields (which are required to be part of the final header):

    • "host": the domain name/host server (without the http uri scheme).
    • "x-amz-date": the date and time the request was made (example: "20240920T000000Z"). also see the date field for setting a custom amazon formatted date and time.
    • "x-amz-content-sha256": the sha256 hash of the request's body. since a GET request cannot have a body, this is the sha256 of and empty string during a get request (default).

    undefined

    date?: string | number

    use a custom date, based on what you provide:

    • number: use a specific epoch time in milliseconds. for example: 1726790400000 (this comes from new Date("2024-09-20T00:00:00Z").getTime()).
    • "now": use Date.now() as the time.
    • string: use an amazon formatted string date. example: "20240920T000000Z".

    any of the value that you provide here is internally converted into an amazon formatted string date, which is required when signing.

    "now" - derived from the javascript runtime's Date.now().

    service?: string

    name of the service being used. typically it is "s3"

    "s3"

    method?: "GET" | "POST" | "HEAD" | "PUT"

    which http method will you be using?

    "GET"

    region?: string

    what is the region of the server? for locally hosted minio, use the default value.

    "us-east-1"

    expires?: number

    specify how long, in seconds, the pre-signed url will be valid for.

    3600 (i.e. 1 hour expiration time)

    scheme?: "http" | "https"

    specify which url-scheme to use for the finalized url.

    "https"

    payload?: { unsigned: true }

    don't attach a payload to your canonical presigned-url request, because they are meant to accept arbitrary payloads (unlike header-based singer, which can optionally use a signed payload).

    { unsigned: true } (equivalent to undefined, and later equivalent to "UNSIGNED-PAYLOAD")