feat(users): setup user authentication methods schema and apis (#4999)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Mani Chandra Dulam <mani.dchandra@juspay.in>
This commit is contained in:
Apoorv Dixit
2024-06-21 16:29:17 +05:30
committed by GitHub
parent 5cde7ee034
commit 2005d3df9f
29 changed files with 888 additions and 16 deletions

View File

@ -13,7 +13,10 @@ use crate::{
authentication::{AuthToken, UserFromToken},
authorization::roles::RoleInfo,
},
types::domain::{self, MerchantAccount, UserFromStorage},
types::{
domain::{self, MerchantAccount, UserFromStorage},
transformers::ForeignFrom,
},
};
pub mod dashboard_metadata;
@ -200,3 +203,13 @@ pub fn get_redis_connection(state: &SessionState) -> UserResult<Arc<RedisConnect
.change_context(UserErrors::InternalServerError)
.attach_printable("Failed to get redis connection")
}
impl ForeignFrom<user_api::AuthConfig> for common_enums::UserAuthType {
fn foreign_from(from: user_api::AuthConfig) -> Self {
match from {
user_api::AuthConfig::OpenIdConnect { .. } => Self::OpenIdConnect,
user_api::AuthConfig::Password => Self::Password,
user_api::AuthConfig::MagicLink => Self::MagicLink,
}
}
}