refactor(core): use secrets for connector AuthType in connector integration (#1441)

This commit is contained in:
Shankar Singh C
2023-07-26 17:04:49 +05:30
committed by GitHub
parent e6a5e9fa72
commit d068569f4d
80 changed files with 491 additions and 393 deletions

View File

@ -34,8 +34,8 @@ pub enum TransactionType {
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
struct MerchantAuthentication {
name: String,
transaction_key: String,
name: Secret<String>,
transaction_key: Secret<String>,
}
impl TryFrom<&types::ConnectorAuthType> for MerchantAuthentication {
@ -44,8 +44,8 @@ impl TryFrom<&types::ConnectorAuthType> for MerchantAuthentication {
fn try_from(auth_type: &types::ConnectorAuthType) -> Result<Self, Self::Error> {
if let types::ConnectorAuthType::BodyKey { api_key, key1 } = auth_type {
Ok(Self {
name: api_key.clone(),
transaction_key: key1.clone(),
name: api_key.to_owned(),
transaction_key: key1.to_owned(),
})
} else {
Err(errors::ConnectorError::FailedToObtainAuthType)?