feat(core): confirm flow and authorization api changes for external authentication (#4015)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: sai-harsha-vardhan <harsha111hero@gmail.com>
Co-authored-by: Sai Harsha Vardhan <56996463+sai-harsha-vardhan@users.noreply.github.com>
This commit is contained in:
Hrithikesh
2024-03-12 16:11:22 +05:30
committed by GitHub
parent 195c700e6c
commit ce3625cb0c
19 changed files with 692 additions and 49 deletions

View File

@ -13,7 +13,7 @@ use crate::{
routes::AppState,
services::{self, execute_connector_processing_step},
types::{
api,
api::{self, ConnectorCallType},
authentication::{AuthNFlowType, AuthenticationResponseData},
storage,
transformers::ForeignFrom,
@ -22,6 +22,34 @@ use crate::{
utils::OptionExt,
};
pub fn get_connector_name_if_separate_authn_supported(
connector_call_type: &ConnectorCallType,
) -> Option<String> {
match connector_call_type {
ConnectorCallType::PreDetermined(connector_data) => {
if connector_data
.connector_name
.is_separate_authentication_supported()
{
Some(connector_data.connector_name.to_string())
} else {
None
}
}
ConnectorCallType::Retryable(connectors) => connectors.first().and_then(|connector_data| {
if connector_data
.connector_name
.is_separate_authentication_supported()
{
Some(connector_data.connector_name.to_string())
} else {
None
}
}),
ConnectorCallType::SessionMultiple(_) => None,
}
}
pub async fn update_trackers<F: Clone, Req>(
state: &AppState,
router_data: RouterData<F, Req, AuthenticationResponseData>,