Function
Static Public
public buildAuthorization(accessKeyId: string, credentialScope: string, signedHeaders: string, signature: string): string source
import {buildAuthorization} from 'aws-sigv4/src/index.js'
Creates the authorization string https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html
public async buildCanonicalRequest(httpRequestMethod: string, canonicalURI: string, canonicalQueryString: string, canonicalHeaders: string, signedHeaders: string, requestPayload: string): Promise<string> source
import {buildCanonicalRequest} from 'aws-sigv4/src/index.js'
Creates the canonical request https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
Params:
Name | Type | Attribute | Description |
httpRequestMethod | string |
|
The HTTP request method (e.g. |
canonicalURI | string |
|
The canonical URI |
canonicalQueryString | string |
|
The canonical query string |
canonicalHeaders | string |
|
The canonical headers |
signedHeaders | string |
|
The signed headers |
requestPayload | string |
|
The payload of the request |
public buildStringToSign(requestDate: string, credentialScope: string, hashedCanonicalRequest: string): string source
import {buildStringToSign} from 'aws-sigv4/src/index.js'
Creates the string to sign https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html
public formatDateTime(date: Date): string source
import {formatDateTime} from 'aws-sigv4/src/index.js'
Formats a Date object to an AWS date string
Params:
Name | Type | Attribute | Description |
date | Date |
|
The date |
public async preCalculateSigningKey(secretAccessKey: string, date: string, region: string, service: string): Promise<string> source
import {preCalculateSigningKey} from 'aws-sigv4/src/index.js'
Pre-calculates the signing key https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html
public preCalculatedSign(signingKey: string, stringToSign: string): Promise<string> source
import {preCalculatedSign} from 'aws-sigv4/src/index.js'
Pre-calculates the signature https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html
public async sign(secretAccessKey: string, date: string, region: string, service: string, stringToSign: string): Promise<string> source
import {sign} from 'aws-sigv4/src/index.js'
Calculates the signature https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html
Params:
Name | Type | Attribute | Description |
secretAccessKey | string |
|
The secret access key for the AWS account |
date | string |
|
The date in YYYYMMDD format |
region | string |
|
The AWS region (e.g. |
service | string |
|
The AWS service (e.g. |
stringToSign | string |
|
The string to sign |