mirror of
https://github.com/TECHNOFAB11/jwt-authorizer.git
synced 2025-12-12 16:10:06 +01:00
feat: implement IntoLayer for slices (IntoIter)
This commit is contained in:
parent
36bc0fca7d
commit
efa378b3bf
2 changed files with 3 additions and 2 deletions
|
|
@ -209,8 +209,9 @@ where
|
|||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<C> IntoLayer<C> for Vec<JwtAuthorizer<C>>
|
||||
impl<C, T> IntoLayer<C> for T
|
||||
where
|
||||
T: IntoIterator<Item = JwtAuthorizer<C>> + Send + Sync,
|
||||
C: Clone + DeserializeOwned + Send + Sync,
|
||||
{
|
||||
async fn into_layer(self) -> Result<AsyncAuthorizationLayer<C>, InitError> {
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ mod tests {
|
|||
proteced_request_with_header(auths, header::COOKIE.as_str(), &format!("ccc={}", common::JWT_RSA1_OK)).await;
|
||||
assert_eq!(response.status(), StatusCode::OK);
|
||||
|
||||
let auths: Vec<JwtAuthorizer<User>> = vec![
|
||||
let auths: [JwtAuthorizer<User>; 2] = [
|
||||
JwtAuthorizer::from_ec_pem("../config/ecdsa-public1.pem"),
|
||||
JwtAuthorizer::from_rsa_pem("../config/rsa-public1.pem").jwt_source(JwtSource::Cookie("ccc".to_owned())),
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue