Skip to content

Commit

Permalink
Fix tonic test
Browse files Browse the repository at this point in the history
  • Loading branch information
blablacio authored and cduvray committed Nov 11, 2023
1 parent 77949d6 commit 62b75a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jwt-authorizer/tests/tonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::AuthorizationService, IntoLayer, JwtAuthorizer};
use jwt_authorizer::{layer::AuthorizationService, IntoLayer, JwtAuthorizer, Validation};
use serde::{Deserialize, Serialize};
use tonic::{server::UnaryService, transport::NamedService, IntoRequest, Status};
use tower::{buffer::Buffer, Service};
Expand Down Expand Up @@ -181,7 +181,8 @@ where
#[tokio::test]
async fn successfull_auth() {
init_test();
let auth: JwtAuthorizer<User> = JwtAuthorizer::from_rsa_pem("../config/rsa-public1.pem");
let auth: JwtAuthorizer<User> =
JwtAuthorizer::from_rsa_pem("../config/rsa-public1.pem").validation(Validation::new().aud(&["aud1"]));
let app = app(auth, "[email protected]".to_string()).await;
let r = make_protected_request(app.clone(), Some(JWT_RSA1_OK), "world").await.unwrap();
assert_eq!(r.get_ref().message, "Hello, world");
Expand Down

0 comments on commit 62b75a8

Please sign in to comment.