feat: Add support for tonic

Tonic and Axum are quite closely related; From a tower perspective the
main difference is in the Error type in the body for their Response.

This refactor the code a little bit and add conversions from AuthError
to a tonic's Response such that the exact same code can be used by both
Axum and tonic services

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
This commit is contained in:
Sjoerd Simons 2023-04-17 21:23:39 +02:00
parent f45568a044
commit 5f3a08c4c7
6 changed files with 547 additions and 257 deletions

View file

@ -1,6 +1,6 @@
# jwt-authorizer
JWT authorizer Layer for Axum.
JWT authorizer Layer for Axum and Tonic.
[![Build status](https://github.com/cduvray/jwt-authorizer/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/tokio-rs/cduvray/jwt-authorizer/workflows/ci.yml)
[![Crates.io](https://img.shields.io/crates/v/jwt-authorizer)](https://crates.io/crates/jwt-authorizer)