feat: add new error response for 403 (#1330)

Co-authored-by: harsh_sharma_juspay <harsh.sharma@juspay.in>
Co-authored-by: Sampras Lopes <lsampras@protonmail.com>
This commit is contained in:
Mani Chandra
2023-06-17 13:06:26 +05:30
committed by GitHub
parent 66978593f8
commit 49d5ad7b3c
3 changed files with 7 additions and 15 deletions

View File

@ -241,7 +241,7 @@ where
}
#[derive(Debug)]
pub struct JWTAuth;
pub(crate) struct JWTAuth;
#[derive(serde::Deserialize)]
struct JwtAuthPayloadFetchUnit {
@ -315,19 +315,6 @@ impl ClientSecretFetch for api_models::cards_info::CardsInfoRequest {
}
}
pub fn jwt_auth_or<'a, T: AuthInfo, A: AppStateInfo>(
default_auth: &'a dyn AuthenticateAndFetch<T, A>,
headers: &HeaderMap,
) -> Box<&'a dyn AuthenticateAndFetch<T, A>>
where
JWTAuth: AuthenticateAndFetch<T, A>,
{
if is_jwt_auth(headers) {
return Box::new(&JWTAuth);
}
Box::new(default_auth)
}
pub fn get_auth_type_and_flow<A: AppStateInfo + Sync>(
headers: &HeaderMap,
) -> RouterResult<(