# whook-authorization

> A wrapper to provide authorization support to a Whook server

Latest version **0.0.0** (published 2019-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install whook-authorization
pnpm add whook-authorization
yarn add whook-authorization
bun add whook-authorization
```

## Health

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

Positive: no vulnerabilities; high maintenance score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2019-02-24 |
| First published | 2019-02-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.12.0 |
| Dependencies | 2 |
| Unpacked size | 25 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | Nicolas Froidure |
| Maintainers | nfroidure |

## Links

- npm: https://www.npmjs.com/package/whook-authorization
- Repository: https://github.com/nfroidure/whook
- Issues: https://github.com/nfroidure/whook/issues
- npm.io page: https://npm.io/package/whook-authorization

## Dependencies (2)

- [knifecycle](https://npm.io/package/knifecycle.md) ^5.2.0
- [http-auth-utils](https://npm.io/package/http-auth-utils.md) ^2.1.0

## Recent versions

- 0.0.0 (latest) — 2019-02-24

## README

[//]: # ( )
[//]: # (This file is automatically generated by a `metapak`)
[//]: # (module. Do not change it  except between the)
[//]: # (`content:start/end` flags, your changes would)
[//]: # (be overridden.)
[//]: # ( )
# whook-authorization
> A wrapper to provide authorization support to a Whook server

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nfroidure/whook-authorization/blob/master/LICENSE)
[![NPM version](https://badge.fury.io/js/whook-authorization.svg)](https://npmjs.org/package/whook-authorization)


[//]: # (::contents:start)

To see how to add authorization support to your application, have a look
 at the `create-whook` project, it will be well documented here
 as soon as possible.

[//]: # (::contents:end)

# API
## Constants

<dl>
<dt><a href="#optionsWithCORS">optionsWithCORS</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>A simple Whook handler that just returns a 200 OK
 HTTP response</p>
</dd>
</dl>

## Functions

<dl>
<dt><a href="#wrapHandlerWithCORS">wrapHandlerWithCORS(initHandler)</a> ⇒ <code>function</code></dt>
<dd><p>Wrap an handler initializer to append CORS to response.</p>
</dd>
<dt><a href="#augmentAPIWithCORS">augmentAPIWithCORS(API)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Augment an OpenAPI to also serve OPTIONS methods with
 the CORS added.</p>
</dd>
</dl>

<a name="optionsWithCORS"></a>

## optionsWithCORS ⇒ <code>Promise.&lt;Object&gt;</code>
A simple Whook handler that just returns a 200 OK
 HTTP response

**Kind**: global constant  
**Returns**: <code>Promise.&lt;Object&gt;</code> - The HTTP response object  
<a name="wrapHandlerWithCORS"></a>

## wrapHandlerWithCORS(initHandler) ⇒ <code>function</code>
Wrap an handler initializer to append CORS to response.

**Kind**: global function  
**Returns**: <code>function</code> - The handler initializer wrapped  

| Param | Type | Description |
| --- | --- | --- |
| initHandler | <code>function</code> | The handler initializer |

<a name="augmentAPIWithCORS"></a>

## augmentAPIWithCORS(API) ⇒ <code>Promise.&lt;Object&gt;</code>
Augment an OpenAPI to also serve OPTIONS methods with
 the CORS added.

**Kind**: global function  
**Returns**: <code>Promise.&lt;Object&gt;</code> - The augmented  OpenAPI object  

| Param | Type | Description |
| --- | --- | --- |
| API | <code>Object</code> | The OpenAPI object |


# Authors
- [Nicolas Froidure](http://insertafter.com/en/index.html)

# License
[MIT](https://github.com/nfroidure/whook-authorization/blob/master/LICENSE)

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