An open API service indexing awesome lists of open source software.

https://github.com/joaomilho/mappersmith-aws

Mappersmith middleware for AWS Signature Version 4
https://github.com/joaomilho/mappersmith-aws

aws javascript mappersmith node sigv4 typescript

Last synced: 3 months ago
JSON representation

Mappersmith middleware for AWS Signature Version 4

Awesome Lists containing this project

README

          

# mappersmith-aws

Mappersmith middeware for AWS Signature Version 4 signing process.

## Usage

```js
import forge from "mappersmith"
import { configAWSMiddleware } from "mappersmith-aws"

const AWSMiddleware = configAWSMiddleware({
region: "us-east-1",
service: "execute-api"
})

const api = forge({
middleware: [
...,
AWSMiddleware
]
...
})
```

> Important: the middleware should always be the last one in your API definitions since it needs to be aware of all headers.

### Params:



region


mandatory


string


--




AWS region.



service


mandatory


string


--



Name of the AWS service (s3, execute-api, etc...).



systemClockOffset


optional


number


0




Compensate for clock skew when your system may be out of sync with the AWS service time.



logger


optional


Console


console




A logger to write debug details.



credentialsProvider


optional


(): Promise&ltAWS.Credentials&gt


() => AWS.config.credentialProvider.resolvePromise()




An async function returning AWS credentials.