diff options
author | Robert Newson <rnewson@apache.org> | 2017-05-09 13:50:33 +0100 |
---|---|---|
committer | Robert Newson <rnewson@apache.org> | 2017-05-09 13:50:33 +0100 |
commit | a18a2e5e5c40bb406f67f27b00bb3d206778aefd (patch) | |
tree | 35e0d68e58eaac2aaddee0b77cca7312c0430c4b | |
parent | e60fa5015b5b0debf8be7d95e70c731638d7f2bd (diff) | |
download | couchdb-a18a2e5e5c40bb406f67f27b00bb3d206778aefd.tar.gz |
some documentation
-rw-r--r-- | src/jwks.erl | 5 | ||||
-rw-r--r-- | src/jwtf.erl | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/jwks.erl b/src/jwks.erl index edd695964..748c162d8 100644 --- a/src/jwks.erl +++ b/src/jwks.erl @@ -10,6 +10,11 @@ % License for the specific language governing permissions and limitations under % the License. +% @doc +% This module parses JSON Web Key Sets (JWKS) and caches them for +% performance reasons. To use the module, include it in your +% supervision tree. + -module(jwks). -behaviour(gen_server). diff --git a/src/jwtf.erl b/src/jwtf.erl index 1a1877c03..6ec832f73 100644 --- a/src/jwtf.erl +++ b/src/jwtf.erl @@ -10,10 +10,20 @@ % License for the specific language governing permissions and limitations under % the License. +% @doc +% This module decodes and validates JWT tokens. Almost all property +% checks are optional. If not checked, the presence or validity of the +% field is not verified. Signature check is mandatory, though. + -module(jwtf). -export([decode/3]). +% @doc decode +% Decodes the supplied encoded token, checking +% for the attributes defined in Checks and calling +% the key store function to retrieve the key needed +% to verify the signature decode(EncodedToken, Checks, KS) -> try [Header, Payload, Signature] = split(EncodedToken), |