# body-validator-middleware

> Lambda - Middy validator wrapper - validate the http event body

Latest version **1.0.0** (published 2021-02-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install body-validator-middleware
pnpm add body-validator-middleware
yarn add body-validator-middleware
bun add body-validator-middleware
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-02-14 |
| First published | 2021-02-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | adrien@smarthalo.bike |
| Maintainers | smarthalo |
| Keywords | validator, middleware, lambda, middy |

## Links

- npm: https://www.npmjs.com/package/body-validator-middleware
- npm.io page: https://npm.io/package/body-validator-middleware

## Dependencies (1)

- [@middy/validator](https://npm.io/package/@middy/validator.md) ^1.5.2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-02-14

## README

# Smarthalo AUTH middy Middleware

The auth [middy](https://github.com/middyjs/middy) middleware used @smarthalo for microservices.

## How to install

Latest: `npm install ssh://git@bitbucket.org/smart_halo/auth-middleware.git#master`

Or a specific version: `npm install ssh://git@bitbucket.org/smart_halo/auth-middleware.git#1.1.0`


## Basic usage

```js
import { accessTokenValidationMiddleware } from '@smarthalo/auth-middleware';
import middy from '@middy/core';

const dfuHandler = (event, context, callback) => {
  // do stuff with user that have the dfu_allow_write priviledges
  // ...

  return callback(null, { result: 'success', message: 'Succeed', code: 200})
}

export const myHandler = middy(dfuHandler)
  .use(accessTokenValidationMiddleware({
    // the ACLs (called scopes) here
    accessTokenScopes: ['dfu_allow_write'],
  }));
```

## Contribute

Clone and install the repo

`npm install`

test

`npm test`

Publish

`npx tsc -p ./` tag and push to the remote

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