node-oclc-wskey
Module to construct a WebService Key for use with OCLC services.
npm install oclc-wskey
usage
var key = new WSKey(publicKey, secret /*, user */)
Where user
is an object with the keys principalID
and principalIDNS
.
Depending on what you're planning, you may not need to provide a one.
You can also pass an object as the sole parameter. Use these keys:
key | value |
---|---|
public |
the public key |
secret |
the secret key |
user |
an object with principalID and principalIDNS keys |
redirect_uri |
redirect uri associated with the key |
scope |
an array of scopes associated with the key |
redirect_uri
and scope
have no bearing on this module's only function
(key.HMACSignature
), but are necessary for generating Access Tokens.
var sig = key.HMACSignature(method, uri /*, user */)
Returns an HMAC signature for method
and uri
. Uses the instantiated user by
default, but can be overridden with a different user.
example
var WSKey = var https = var url = var me = principalID: 'principalID' principalIDNS: 'principalIDNS' var key = 'wskey' 'secret' mevar addr = url var opts = hostname: addrhostname path: addrpath headers: 'Authorization': key 'Accept': 'application/json' https
license
MIT