mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
feat: cards info api (#749)
Co-authored-by: Jagan <jaganelavarasan@gmail.com> Co-authored-by: Kartikeya Hegde <karthikey.hegde@juspay.in> Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
@ -33,6 +33,22 @@ where
|
||||
#[derive(Debug)]
|
||||
pub struct ApiKeyAuth;
|
||||
|
||||
pub struct NoAuth;
|
||||
|
||||
#[async_trait]
|
||||
impl<A> AuthenticateAndFetch<(), A> for NoAuth
|
||||
where
|
||||
A: AppStateInfo + Sync,
|
||||
{
|
||||
async fn authenticate_and_fetch(
|
||||
&self,
|
||||
_request_headers: &HeaderMap,
|
||||
_state: &A,
|
||||
) -> RouterResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<A> AuthenticateAndFetch<storage::MerchantAccount, A> for ApiKeyAuth
|
||||
where
|
||||
@ -243,6 +259,12 @@ impl ClientSecretFetch for PaymentMethodListRequest {
|
||||
}
|
||||
}
|
||||
|
||||
impl ClientSecretFetch for api_models::cards_info::CardsInfoRequest {
|
||||
fn get_client_secret(&self) -> Option<&String> {
|
||||
self.client_secret.as_ref()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn jwt_auth_or<'a, T, A: AppStateInfo>(
|
||||
default_auth: &'a dyn AuthenticateAndFetch<T, A>,
|
||||
headers: &HeaderMap,
|
||||
|
||||
Reference in New Issue
Block a user