basic-webserver
basic-webserver copied to clipboard
Add support for Json Web Token verification
Based on builtin-task so most of these commits should merge (hopefully) and disappear.
Implementation is good to go with 3/12 algorithms implemented and the example working ok. It's mostly a matter of copy-paste to include the other algorithms, but we can do this later.
There is a lurking Error in alias analysis issue which I think blocks this PR as it's too easy to hit.
test case
# Test Hs256 algorithm
result = Jwt.verify! {
secret: "shhh_very_secret",
algorithm: Hs256,
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.joReqPNNkWQ8zQCW3UQnhc_5NMrSZEOQYpk6sDS6Y-o",
}
demo
Closing as this has gone very stale, and I am not planning on adding/fixing/completing this any time soon.