npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

couch-proxy-auth

1.0.1 • Public • Published

CouchDB Proxy Authentication Headers

build status

Creates CouchDB Proxy Authentication Headers

Installation

npm install couch-proxy-auth

Usage

var xauth = require('couch-proxy-auth')
 
var headers = xauth('username', 'role', 'secret')
 
/*
  {
    'X-Auth-CouchDB-UserName': 'username'
    'X-Auth-CouchDB-Token': '0xde7c9b8bbaab8a73f090cd4d9',
    'X-Auth-CouchDB-Roles': 'role'
  }
*/

The token is generated by HMAC-SHA1(secret, username) and represented as Hex.

Parameters

xauth(username, roles, secret)

  • username Name of the user in CouchDB
  • roles Array of (multiple) roles or string for a singe role
  • secret Optional, but recommended, shared secret (see documentation)

CouchDB Proxy Authentication

For more information see the CouchDB Docs

License

MIT

install

npm i couch-proxy-auth

Downloadsweekly downloads

7

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability