mirror of
https://github.com/TECHNOFAB11/jwt-authorizer.git
synced 2025-12-12 16:10:06 +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");
|
debug!("AuthErrors::InvalidClaims");
|
||||||
tonic::Status::unauthenticated("error=\"insufficient_scope\"")
|
tonic::Status::unauthenticated("error=\"insufficient_scope\"")
|
||||||
}
|
}
|
||||||
|
AuthError::NoAuthorizer() => {
|
||||||
|
debug!("AuthErrors::NoAuthorizer");
|
||||||
|
tonic::Status::unauthenticated("error=\"invalid_token\"")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.to_http()
|
.to_http()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ use std::{sync::Once, task::Poll};
|
||||||
use axum::body::HttpBody;
|
use axum::body::HttpBody;
|
||||||
use futures_core::future::BoxFuture;
|
use futures_core::future::BoxFuture;
|
||||||
use http::header::AUTHORIZATION;
|
use http::header::AUTHORIZATION;
|
||||||
use jwt_authorizer::{layer::AsyncAuthorizationService, JwtAuthorizer};
|
use jwt_authorizer::{layer::AsyncAuthorizationService, IntoLayer, JwtAuthorizer};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use tonic::{server::UnaryService, transport::NamedService, IntoRequest, Status};
|
use tonic::{server::UnaryService, transport::NamedService, IntoRequest, Status};
|
||||||
use tower::{buffer::Buffer, Service};
|
use tower::{buffer::Buffer, Service};
|
||||||
|
|
@ -83,7 +83,7 @@ async fn app(
|
||||||
jwt_auth: JwtAuthorizer<User>,
|
jwt_auth: JwtAuthorizer<User>,
|
||||||
expected_sub: String,
|
expected_sub: String,
|
||||||
) -> AsyncAuthorizationService<Buffer<tonic::transport::server::Routes, http::Request<tonic::transport::Body>>, User> {
|
) -> 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()
|
tonic::transport::Server::builder()
|
||||||
.layer(layer)
|
.layer(layer)
|
||||||
.layer(tower::buffer::BufferLayer::new(1))
|
.layer(tower::buffer::BufferLayer::new(1))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue