Creates CouchDB Proxy Authentication Headers
npm install couch-proxy-authCreates CouchDB Proxy Authentication Headers
npm install couch-proxy-auth
`` js
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 CouchDBroles
- Array of (multiple) roles or string for a singe rolesecret` Optional, but recommended, shared secret (see documentation)
-
For more information see the CouchDB Docs
MIT