Function
Static Public Summary | ||
public |
addAuthorization(request: *, authorization: *): string |
|
public |
authorization(algorithm: *, accessKeyId: *, credentialScope: *, signedHeaders: *, signature: *): string Creates the authorization string https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html |
|
public |
canonicalRequest(httpRequestMethod: string, canonicalURI: string, canonicalQueryString: string, canonicalHeaders: string, signedHeaders: string, requestPayload: string): string Creates the canonical request https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html |
|
public |
formatDateTime(date: Date): string Formats a Date object to an AWS date string |
|
public |
Computes the hash |
|
public |
parseHead(head: *): {method: string, requestURI: string, httpVersion: string, headers: Array<string>} |
|
public |
parseRequest(request: *): {head: *, body: *} |
|
public |
querystringify(action: *, algorithm: *, accessKeyId: *, credentialScope: *, date: *, timeoutInterval: *, signedHeaders: *, signature: *): * |
|
public |
requestToCanonicalRequest(request: *): string |
|
public |
sign(secretAccessKey: string, date: string, region: string, service: string, stringToSign: string): string Calculates the signature https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html |
|
public |
stringToSign(algorithm: string, requestDate: string, credentialScope: string, hashedCanonicalRequest: string): string Creates the string to sign https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html |
Static Public
public addAuthorization(request: *, authorization: *): string source
import {addAuthorization} from 'aws-sigv4/src/index.es6'
Params:
Name | Type | Attribute | Description |
request | * | ||
authorization | * |
public authorization(algorithm: *, accessKeyId: *, credentialScope: *, signedHeaders: *, signature: *): string source
import {authorization} from 'aws-sigv4/src/index.es6'
Creates the authorization string https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html
Params:
Name | Type | Attribute | Description |
algorithm | * | ||
accessKeyId | * | ||
credentialScope | * | ||
signedHeaders | * | ||
signature | * |
public canonicalRequest(httpRequestMethod: string, canonicalURI: string, canonicalQueryString: string, canonicalHeaders: string, signedHeaders: string, requestPayload: string): string source
import {canonicalRequest} from 'aws-sigv4/src/index.es6'
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 formatDateTime(date: Date): string source
import {formatDateTime} from 'aws-sigv4/src/index.es6'
Formats a Date object to an AWS date string
Params:
Name | Type | Attribute | Description |
date | Date |
|
The date |
public hash(data: string): string source
import {hash} from 'aws-sigv4/src/index.es6'
Computes the hash
Params:
Name | Type | Attribute | Description |
data | string |
|
The data to hash |
public parseHead(head: *): {method: string, requestURI: string, httpVersion: string, headers: Array<string>} source
import {parseHead} from 'aws-sigv4/src/index.es6'
Params:
Name | Type | Attribute | Description |
head | * |
public parseRequest(request: *): {head: *, body: *} source
import {parseRequest} from 'aws-sigv4/src/index.es6'
Params:
Name | Type | Attribute | Description |
request | * |
Return:
{head: *, body: *} |
public querystringify(action: *, algorithm: *, accessKeyId: *, credentialScope: *, date: *, timeoutInterval: *, signedHeaders: *, signature: *): * source
import {querystringify} from 'aws-sigv4/src/index.es6'
Params:
Name | Type | Attribute | Description |
action | * | ||
algorithm | * | ||
accessKeyId | * | ||
credentialScope | * | ||
date | * | ||
timeoutInterval | * | ||
signedHeaders | * | ||
signature | * |
Return:
* |
public requestToCanonicalRequest(request: *): string source
import {requestToCanonicalRequest} from 'aws-sigv4/src/index.es6'
Params:
Name | Type | Attribute | Description |
request | * |
public sign(secretAccessKey: string, date: string, region: string, service: string, stringToSign: string): string source
import {sign} from 'aws-sigv4/src/index.es6'
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 |
public stringToSign(algorithm: string, requestDate: string, credentialScope: string, hashedCanonicalRequest: string): string source
import {stringToSign} from 'aws-sigv4/src/index.es6'
Creates the string to sign https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html
Params:
Name | Type | Attribute | Description |
algorithm | string |
|
The algorithm ( |
requestDate | string |
|
The request date ( |
credentialScope | string |
|
the credential scope (formatted as |
hashedCanonicalRequest | string |
|