Module to construct a WebService Key for use with OCLC services.
npm install oclc-wskey
var key = new WSKey(publicKey, secret /*, user */)
user is an object with the keys
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:
||the public key|
||the secret key|
||an object with
||redirect uri associated with the key|
||an array of scopes associated with the key|
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
uri. Uses the instantiated user by
default, but can be overridden with a different user.
var WSKey =var https =var url =var me = principalID: 'principalID' principalIDNS: 'principalIDNS'var key = 'wskey' 'secret' mevar addr = urlvar opts =hostname: addrhostnamepath: addrpathheaders:'Authorization': key'Accept': 'application/json'https