Releases: techfromsage/persona-node-client
Debug certificate use
Adding debugging for checking which certificate is used to validate a token.
Remote validation checks for su scope
When validating a token remotely (includes more than 25 scopes) the client will call Persona. A single scope was being passed scope=blah which was not checking for the overriding su scope. Each time a call is now made to Persona the su scope is automatically appended ?scope=blah,su.
3.2.0 - Add getProfilesForGuids
Fix indentation breaking tests
3.1.1 - Remove shrinkwrap on library
Functionally identical to 3.1.0 but removes the shrinkwrap so the calling app can lock down dependencies.
Expose decoded JWT on validation
This change adds a 3rd argument to the validateToken/validateHTTPBearerToken callback function that provides the decoded JSON web token for the caller to access token metadata:
var opts = {
token: token,
scope: 'my:scope'
};
personaClient.validateToken(opts, function done(error, result, decodedToken) {
// error will be one of personaClient.errorTypes or null if validation passed.
// result will be null or 'ok' if validation passed.
console.log(decodedToken.jti) // get the unique ID of the token.
});
Small bug fix
- Fixed invalid relative path to package.json. Path is now absolute.
Minor Bug Fix
The middleware validateHTTPBearerToken
method would throw an exception if the supplied token from the HTTP call was not supplied. This bug was introduced in the last major patch.
Switching to uuid.v4 for x-request-id generation
3.0.5 Change from uuid.v1 to v4
xRequestId, opts, fixed cert timeout, removing mandatory config
*** Breaking changes, please review the docs ***
- Fix discrepancy between seconds, ms, be more explicit in var names and comments
- Added user agent functionality, make appUA mandatory
- Fail tests if there are any non-matched events
- Made cert timeout part of config, fixed defect with loop over background refresh, made tests more granular
- Added xRequestId
- Removing mandatory config, not supplying config will default to live
- _getPublicKey now private
- _getToken now private
- All public methods use opts not individual params
Removal of debugging bug
This release fixes a small bug introduced in 2.0.0 caused by a debugging line that was inadvertently merged :/