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
- Host: GitHub
- URL: https://github.com/joaomilho/mappersmith-aws
- Owner: joaomilho
- Created: 2020-10-10T23:17:58.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-13T07:46:03.000Z (over 5 years ago)
- Last Synced: 2025-03-24T19:49:17.241Z (over 1 year ago)
- Topics: aws, javascript, mappersmith, node, sigv4, typescript
- Language: TypeScript
- Homepage:
- Size: 83 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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<AWS.Credentials>
() => AWS.config.credentialProvider.resolvePromise()
An async function returning AWS credentials.