mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-31 01:57:45 +08:00
feat(auth): Add support for partial-auth, by facilitating injection of authentication parameters in headers (#4802)
Co-authored-by: Jagan <jaganelavarasan@gmail.com>
This commit is contained in:
@ -53,7 +53,7 @@ pub async fn customer_create(
|
||||
|state, auth, req, _| {
|
||||
customers::create_customer(state, auth.merchant_account, auth.key_store, req)
|
||||
},
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
@ -87,7 +87,7 @@ pub async fn customer_retrieve(
|
||||
|state, auth, req, _| {
|
||||
customers::retrieve_customer(state, auth.merchant_account, auth.key_store, req)
|
||||
},
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
@ -132,7 +132,7 @@ pub async fn customer_update(
|
||||
|state, auth, req, _| {
|
||||
customers::update_customer(state, auth.merchant_account, req, auth.key_store)
|
||||
},
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
@ -166,7 +166,7 @@ pub async fn customer_delete(
|
||||
|state, auth: auth::AuthenticationData, req, _| {
|
||||
customers::delete_customer(state, auth.merchant_account, req, auth.key_store)
|
||||
},
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
@ -208,7 +208,7 @@ pub async fn list_customer_payment_method_api(
|
||||
None,
|
||||
)
|
||||
},
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
pub mod types;
|
||||
|
||||
use actix_web::{web, HttpRequest, HttpResponse};
|
||||
use api_models::payments as payment_types;
|
||||
use error_stack::report;
|
||||
@ -71,7 +72,7 @@ pub async fn payment_intents_create(
|
||||
api_types::HeaderPayload::default(),
|
||||
)
|
||||
},
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
locking_action,
|
||||
))
|
||||
.await
|
||||
@ -400,7 +401,7 @@ pub async fn payment_intents_capture(
|
||||
api_types::HeaderPayload::default(),
|
||||
)
|
||||
},
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
locking_action,
|
||||
))
|
||||
.await
|
||||
@ -500,7 +501,7 @@ pub async fn payment_intent_list(
|
||||
|state, auth, req, _| {
|
||||
payments::list_payments(state, auth.merchant_account, auth.key_store, req)
|
||||
},
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
pub mod types;
|
||||
|
||||
use actix_web::{web, HttpRequest, HttpResponse};
|
||||
use error_stack::report;
|
||||
use router_env::{instrument, tracing, Flow, Tag};
|
||||
@ -51,7 +52,7 @@ pub async fn refund_create(
|
||||
|state, auth, req, _| {
|
||||
refunds::refund_create_core(state, auth.merchant_account, auth.key_store, req)
|
||||
},
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
@ -101,7 +102,7 @@ pub async fn refund_retrieve_with_gateway_creds(
|
||||
refunds::refund_retrieve_core,
|
||||
)
|
||||
},
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
@ -143,7 +144,7 @@ pub async fn refund_retrieve(
|
||||
refunds::refund_retrieve_core,
|
||||
)
|
||||
},
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
@ -175,7 +176,7 @@ pub async fn refund_update(
|
||||
&req,
|
||||
create_refund_update_req,
|
||||
|state, auth, req, _| refunds::refund_update_core(state, auth.merchant_account, req),
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
pub mod types;
|
||||
|
||||
use actix_web::{web, HttpRequest, HttpResponse};
|
||||
use api_models::payments as payment_types;
|
||||
use error_stack::report;
|
||||
@ -72,7 +73,7 @@ pub async fn setup_intents_create(
|
||||
api_types::HeaderPayload::default(),
|
||||
)
|
||||
},
|
||||
&auth::ApiKeyAuth,
|
||||
&auth::HeaderAuth(auth::ApiKeyAuth),
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user