From d3a1436a06c5f8154ca6ec03926c3fd65d53f183 Mon Sep 17 00:00:00 2001 From: David Halls Date: Sat, 18 Nov 2017 20:23:50 +0000 Subject: [PATCH] Fix documentation for allowed_algs (has to be an array) --- README.md | 4 ++-- package.json | 2 +- wrap/docs.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1728fab..170c746 100644 --- a/README.md +++ b/README.md @@ -279,7 +279,7 @@ jsjws-slow|1,177|1,176,602|532 - `{String} jws` The JSON Web Signature to verify. - `{PublicKey} key` The public key to be used to verify the signature. For `HS256` and `HS512`, pass a string or `Buffer`. Note: if you pass `null` and `allowed_algs` contains `none` then the signature will not be verified. -- `{Array | Object} allowed_algs` Algorithms expected to be used to sign the signature. If you pass an `Object` then its properties define the set of algorithms expected. +- `{Array} allowed_algs` Algorithms expected to be used to sign the signature. **Return:** @@ -396,7 +396,7 @@ Inherits from [JWS](#jws). - `{Boolean} checks_optional` Whether the token must contain the `typ` header property and the `iat`, `nbf` and `exp` claim properties. Defaults to `false`. - `{PublicKey} key` The public key to be used to verify the token. For `HS256` and `HS512`, pass a string or `Buffer`. Note: if you pass `null` and `allowed_algs` contains `none` then the token's signature will not be verified. -- `{Array | Object} allowed_algs` Algorithms expected to be used to sign the token. If you pass an `Object` then its properties define the set of algorithms expected. +- `{Array} allowed_algs` Algorithms expected to be used to sign the token. **Return:** diff --git a/package.json b/package.json index e3f5a4b..52f1cb8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jsjws", "description": "Wraps jsrsasign (http://kjur.github.io/jsrsasign/) and uses Node crypto routines for performance", - "version": "5.0.0", + "version": "5.0.1", "homepage": "https://github.com/davedoesdev/node-jsjws", "author": { "name": "David Halls", diff --git a/wrap/docs.js b/wrap/docs.js index 723473e..0b387ee 100644 --- a/wrap/docs.js +++ b/wrap/docs.js @@ -208,7 +208,7 @@ Verify a JSON Web Signature. @param {PublicKey} key The public key to be used to verify the signature. For `HS256` and `HS512`, pass a string or `Buffer`. Note: if you pass `null` and `allowed_algs` contains `none` then the signature will not be verified. -@param {Array|Object} allowed_algs Algorithms expected to be used to sign the signature. If you pass an `Object` then its properties define the set of algorithms expected. +@param {Array} allowed_algs Algorithms expected to be used to sign the signature. @return {Boolean} `true` if the signature was verified successfully. The JWS must pass the following tests: @@ -310,7 +310,7 @@ Verify a JSON Web Token. @param {PublicKey} key The public key to be used to verify the token. For `HS256` and `HS512`, pass a string or `Buffer`. Note: if you pass `null` and `allowed_algs` contains `none` then the token's signature will not be verified. -@param {Array|Object} allowed_algs Algorithms expected to be used to sign the token. If you pass an `Object` then its properties define the set of algorithms expected. +@param {Array} allowed_algs Algorithms expected to be used to sign the token. @return {Boolean} `true` if the token was verified successfully. The token must pass the following tests: