mirror of
https://github.com/TECHNOFAB11/jwt-authorizer.git
synced 2025-12-11 23:50:07 +01:00
fix: tonic/clippy errors
This commit is contained in:
parent
efa378b3bf
commit
3d5367da88
2 changed files with 6 additions and 2 deletions
|
|
@ -116,6 +116,10 @@ impl From<AuthError> for Response<tonic::body::BoxBody> {
|
|||
debug!("AuthErrors::InvalidClaims");
|
||||
tonic::Status::unauthenticated("error=\"insufficient_scope\"")
|
||||
}
|
||||
AuthError::NoAuthorizer() => {
|
||||
debug!("AuthErrors::NoAuthorizer");
|
||||
tonic::Status::unauthenticated("error=\"invalid_token\"")
|
||||
}
|
||||
}
|
||||
.to_http()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use std::{sync::Once, task::Poll};
|
|||
use axum::body::HttpBody;
|
||||
use futures_core::future::BoxFuture;
|
||||
use http::header::AUTHORIZATION;
|
||||
use jwt_authorizer::{layer::AsyncAuthorizationService, JwtAuthorizer};
|
||||
use jwt_authorizer::{layer::AsyncAuthorizationService, IntoLayer, JwtAuthorizer};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tonic::{server::UnaryService, transport::NamedService, IntoRequest, Status};
|
||||
use tower::{buffer::Buffer, Service};
|
||||
|
|
@ -83,7 +83,7 @@ async fn app(
|
|||
jwt_auth: JwtAuthorizer<User>,
|
||||
expected_sub: String,
|
||||
) -> AsyncAuthorizationService<Buffer<tonic::transport::server::Routes, http::Request<tonic::transport::Body>>, User> {
|
||||
let layer = jwt_auth.layer().await.unwrap();
|
||||
let layer = jwt_auth.into_layer().await.unwrap();
|
||||
tonic::transport::Server::builder()
|
||||
.layer(layer)
|
||||
.layer(tower::buffer::BufferLayer::new(1))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue