mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
feat(router): added dispute retrieve and dispute list apis (#842)
Co-authored-by: Sangamesh <sangamesh.kulkarni@juspay.in> Co-authored-by: sai harsha <sai.harsha@sai.harsha-MacBookPro> Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
committed by
GitHub
parent
d1d58e33b7
commit
acab7671b0
@ -391,3 +391,16 @@ pub fn strip_jwt_token(token: &str) -> RouterResult<&str> {
|
||||
.strip_prefix("Bearer ")
|
||||
.ok_or_else(|| errors::ApiErrorResponse::InvalidJwtToken.into())
|
||||
}
|
||||
|
||||
pub fn auth_type<'a, T, A>(
|
||||
default_auth: &'a dyn AuthenticateAndFetch<T, A>,
|
||||
jwt_auth_type: &'a dyn AuthenticateAndFetch<T, A>,
|
||||
headers: &HeaderMap,
|
||||
) -> &'a dyn AuthenticateAndFetch<T, A>
|
||||
where
|
||||
{
|
||||
if is_jwt_auth(headers) {
|
||||
return jwt_auth_type;
|
||||
}
|
||||
default_auth
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user