about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorFilesLines
2019-12-21 chore(alcoholic_jwt): Prepare for depot mergeVincent Ambo8-22/+0
2019-02-13 chore(Cargo): Bump version to 1.0.0Vincent Ambo2-2/+1
This library has been running in a production codebase for a while and can be considered stable. There is a minor breaking change between this version and the previous 0.1.0 in that the `ValidationError` enum has gained additional variants.
2019-02-13 fix: Allow trailing bits in base64 encodingsVincent Ambo1-12/+27
After upgrading the base64 library, tests were failing because the new default of the library is to disallow trailing bits in JWTs. Some JWT provider implementations do however use this "forgiving" version of base64-encoding, hence it is required for token validation. This adds a base64::Config with the appropriate settings and also chains base64-errors separately from other token errors.
2019-02-13 chore(Cargo): Update base64 dependencyVincent Ambo1-2/+2
2018-09-04 chore: Add repository URL to Cargo manifestVincent Ambo1-0/+1
2018-09-04 feat(build): Configure Travis CI buildsVincent Ambo2-0/+9
2018-09-04 chore: Make JWKS type CloneableVincent Ambo1-4/+4
2018-09-04 fix: validate() does not require ownership of the token stringVincent Ambo1-5/+5
Thanks to @bvs for pointing this out.
2018-09-04 chore: License under GPL-3.0-or-laterVincent Ambo4-0/+708
2018-09-04 docs: Update README to match new library APIVincent Ambo2-36/+31
2018-09-04 feat: Implement claim validationVincent Ambo2-7/+109
Implements initial validations of token claims. The included validations are: * validation of token issuer * validation of token audience * validation that a subject is set * validation that a token is not expired
2018-09-04 fix: Handle warning about unused kty & alg fieldsVincent Ambo1-0/+1
These fields are only used to constrain deserialisation to the supported values, but have no further effect. `rustc` throws warnings about them not being used, which this commit disables.
2018-09-04 test: Ensure library doctest compiles & runs correctlyVincent Ambo1-26/+41
2018-09-04 refactor: Pass 'String' to token_kid instead of internal typeVincent Ambo2-4/+4
2018-09-04 feat: Initial implementation of 'validate' functionVincent Ambo1-2/+24
Implements the logic for validating a token signature and returning its decoded headers and claims. This does not yet apply claim validations, as those have not been specified yet.
2018-09-04 feat: Introduce ValidJWT type to represent validated & decoded JWTVincent Ambo1-0/+18
Introduces a new struct type which contains the token's headers and claims as JSON values. This is constructed by validating a token and allows library users to deal with the deserialised values as they please.
2018-09-04 refactor: Introduce helper for deserialising token partsVincent Ambo1-10/+23
There are multiple points in the code where a token part needs to be deserialised (i.e. first base64-decoded, then JSON-deserialised). This is extracted to a helper function in this commit.
2018-09-04 feat: Implement extraction of KIDs from unvalidated tokensVincent Ambo2-2/+32
2018-09-04 test: Add simple test for working JWT validationVincent Ambo1-0/+17
2018-09-04 feat: Introduce validation of JWT signaturesVincent Ambo1-6/+39
Introduces the internal function for validating JWT signatures. The process is relatively straightforward: 1. Create an OpenSSL signature verifier using the public key from the JWK. 2. Split the JWT into the data (header + claims) and signature parts. 3. Validate the data against the signature using the verifier from (1) OpenSSL "cleanly" returns a boolean in case of an invalid signature, but an otherwise successful operation. This is represented differently in the returned error variant, with an invalid signature being represented as `InvalidSignature`, and other errors as the `OpenSSL` error variant which wraps the underlying OpenSSL issue. Successful validation returns an empty `Ok` result.
2018-09-04 refactor: Move tests to separate fileVincent Ambo2-9/+23
2018-09-04 refactor: Use error enum + result type alias for failuresVincent Ambo1-11/+26
This makes the library slightly more "rusty". Instead of returning a validation result which also represents potential success, use an enum representing the error variants and the standard library's `Result`-type to represent success/failure.
2018-09-04 feat: Add initial public API skeletonVincent Ambo3-0/+200
2018-09-04 docs: Add code of conductVincent Ambo1-0/+20
2018-09-04 docs: Add initial READMEVincent Ambo1-0/+63