mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
feat: create key in encryption service for merchant and user (#4910)
Co-authored-by: Arjun Karthik <m.arjunkarthik@gmail.com> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -145,6 +145,42 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum KeyManagerClientError {
|
||||
#[error("Failed to construct header from the given value")]
|
||||
FailedtoConstructHeader,
|
||||
#[error("Failed to send request to Keymanager")]
|
||||
RequestNotSent(String),
|
||||
#[error("URL encoding of request failed")]
|
||||
UrlEncodingFailed,
|
||||
#[error("Failed to build the reqwest client ")]
|
||||
ClientConstructionFailed,
|
||||
#[error("Failed to send the request to Keymanager")]
|
||||
RequestSendFailed,
|
||||
#[error("Internal Server Error Received {0:?}")]
|
||||
InternalServerError(bytes::Bytes),
|
||||
#[error("Bad request received {0:?}")]
|
||||
BadRequest(bytes::Bytes),
|
||||
#[error("Unexpected Error occurred while calling the KeyManager")]
|
||||
Unexpected(bytes::Bytes),
|
||||
#[error("Response Decoding failed")]
|
||||
ResponseDecodingFailed,
|
||||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum KeyManagerError {
|
||||
#[error("Failed to add key to the KeyManager")]
|
||||
KeyAddFailed,
|
||||
#[error("Failed to transfer the key to the KeyManager")]
|
||||
KeyTransferFailed,
|
||||
#[error("Failed to Encrypt the data in the KeyManager")]
|
||||
EncryptionFailed,
|
||||
#[error("Failed to Decrypt the data in the KeyManager")]
|
||||
DecryptionFailed,
|
||||
}
|
||||
|
||||
/// Allow [error_stack::Report] to convert between error types
|
||||
/// This auto-implements [ReportSwitchExt] for the corresponding errors
|
||||
pub trait ErrorSwitch<T> {
|
||||
|
||||
Reference in New Issue
Block a user