GitXplorerGitXplorer
k

couch-proxy-auth

public
10 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
ce3fa977a808df8e38358b05a432452984aea5d9

tests

kklaemo committed 10 years ago
Unverified
e313d2111ff522ad78747b8fe5750d14004573d4

syntax highlighting

kklaemo committed 10 years ago
Unverified
8bd170ee4c6c09b3981d8c049bfb245e50a539c0

Pull LICENSE from github

kklaemo committed 10 years ago
Unverified
c9eb7ab70d820b170e687ae7dc2fc09b42d06be4

initial commit

kklaemo committed 10 years ago
Unverified
0b60ae0daa81eb9df52eca2bf8065dc46545356b

Initial commit

kklaemo committed 10 years ago

README

The README file for this repository.

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