# mappersmith-aws

> Mappersmith middeware for AWS Signature Version 4 signing process.

Latest version **0.1.0** (published 2020-10-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install mappersmith-aws
pnpm add mappersmith-aws
yarn add mappersmith-aws
bun add mappersmith-aws
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-10-13 |
| First published | 2020-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 16.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Juan Lulkin |
| Maintainers | joaomilho |

## Links

- npm: https://www.npmjs.com/package/mappersmith-aws
- npm.io page: https://npm.io/package/mappersmith-aws

## Dependencies (4)

- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.771.0
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.0.0
- [@types/node](https://npm.io/package/@types/node.md) ^14.11.8
- [@types/crypto-js](https://npm.io/package/@types/crypto-js.md) ^4.0.1

## Recent versions

- 0.1.0 (latest) — 2020-10-13
- 0.0.3 — 2020-10-12
- 0.0.2 — 2020-10-12
- 0.0.1 — 2020-10-12

## 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:

<table width="100%" style="width: 100%">
  <tr>
    <th align="left">
      region
    </th>
    <td>
      mandatory
    </td>
    <td>
      <code>string</code>
    </td>
    <td>
      --
    </td>
  </tr>
  <tr>
    <td colspan="4">
      AWS region.
    </td>
  </tr>

  <tr>
    <th align="left">
      service
    </th>
    <td>
      mandatory
    </td>
    <td>
      <code>string</code>
    </td>
    <td>
      --
    </td>
  </tr>

  <tr>
    <td colspan="4">
      Name of the AWS service (s3, execute-api, etc...).
    </td>
  </tr>

  <tr>
    <th align="left">
      systemClockOffset
    </th>
    <td>
      optional
    </td>
    <td>
      <code>number</code>
    </td>
    <td>
      <code>0</code>
    </td>
  </tr>
  <tr>
    <td colspan="4">
      Compensate for clock skew when your system may be out of sync with the AWS service time.
    </td>
  </tr>

  <tr>
    <th align="left">
      logger
    </th>
    <td>
      optional
    </td>
    <td>
      <code>Console</code>
    </td>
    <td>
      <code>console</code>
    </td>
  </tr>
  <tr>
    <td colspan="4">
      A logger to write debug details.
    </td>
  </tr>

  <tr>
    <th align="left">
      credentialsProvider
    </th>
    <td>
      optional
    </td>
    <td>
      <code>(): Promise&ltAWS.Credentials&gt</code>
    </td>
    <td>
      <code>() => AWS.config.credentialProvider.resolvePromise()<code>
    </td>
  </tr>
  <tr>
    <td colspan="4">
      An async function returning AWS credentials.
    </td>
  </tr>
</table>

---
_Source: https://npm.io/package/mappersmith-aws · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
