text stringlengths 70 351k | source stringclasses 4
values |
|---|---|
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/jw.rs | crate: src
use crate::{
crypto::encryption_manager::encryption_interface::Encryption,
error::{self, ContainerError},
};
use josekit::{jwe, jws};
pub fn encrypt_jwe(
payload: &[u8],
public_key: impl AsRef<[u8]>,... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/jw.rs | crate: src
use crate::{
crypto::encryption_manager::encryption_interface::Encryption,
error::{self, ContainerError},
};
use josekit::{jwe, jws};
pub fn jws_sign_payload(
payload: &[u8],
private_key: impl AsRef<... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/jw.rs | crate: src
use crate::{
crypto::encryption_manager::encryption_interface::Encryption,
error::{self, ContainerError},
};
use josekit::{jwe, jws};
fn decrypt(&self, input: JweBody) -> Self::ReturnType<'_, Vec<u8>> {
{<|f... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/jw.rs | crate: src
use crate::{
crypto::encryption_manager::encryption_interface::Encryption,
error::{self, ContainerError},
};
fn encrypt(&self, input: Vec<u8>) -> Self::ReturnType<'_, JweBody> {
{<|fim_suffix|>
<|fim_middle|... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/jw.rs | crate: src
use crate::{
crypto::encryption_manager::encryption_interface::Encryption,
error::{self, ContainerError},
};
pub fn get_dotted_jwe(self) -> String {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/jw.rs | crate: src
fn from_str(input: &str) -> Option<Self> {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/jw.rs | crate: src
use crate::{
crypto::encryption_manager::encryption_interface::Encryption,
error::{self, ContainerError},
};
pub fn get_dotted_jws(self) -> String {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/jw.rs | crate: src
fn from_dotted_str(input: &str) -> Option<Self> {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/jw.rs | crate: src
use josekit::{jwe, jws};
pub fn new(
private_key: String,
public_key: String,
enc_algo: jwe::alg::rsaes::RsaesJweAlgorithm,
dec_algo: jwe::alg::rsaes::RsaesJweAlgorithm,
) -> Self... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/internal_keymanager.rs | crate: src
use masking::{ExposeInterface, PeekInterface, Secret, StrongSecret};
use crate::{
app::TenantAppState,
crypto::{
encryption_manager::{encryption_interface::Encryption, managers::aes::GcmAes256},
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/internal_keymanager.rs | crate: src
use masking::{ExposeInterface, PeekInterface, Secret, StrongSecret};
use crate::{
app::TenantAppState,
crypto::{
encryption_manager::{encryption_interface::Encryption, managers::aes::GcmAes256},
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/internal_keymanager.rs | crate: src
use crate::{
app::TenantAppState,
crypto::{
encryption_manager::{encryption_interface::Encryption, managers::aes::GcmAes256},
keymanager::CryptoOperationsManager,
},
error::{self, Con... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/internal_keymanager.rs | crate: src
use masking::{ExposeInterface, PeekInterface, Secret, StrongSecret};
use crate::{
app::TenantAppState,
crypto::{
encryption_manager::{encryption_interface::Encryption, managers::aes::GcmAes256},
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/internal_keymanager.rs | crate: src
use crate::{
app::TenantAppState,
crypto::{
encryption_manager::{encryption_interface::Encryption, managers::aes::GcmAes256},
keymanager::CryptoOperationsManager,
},
error::{self, Con... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use crate::{
crypto::{self, consts::BASE64_ENGINE},
error::{self, ResultContainerExt},
storage::{consts, types::Encrypted, utils},
};
use serde::{
de::{self, Unexpected, Visitor},
Deseriali... | ast_fragments |
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use crate::{
crypto::{self, consts::BASE64_ENGINE},
error::{self, ResultContainerExt},
storage::{consts, types::Encrypted, utils},
};
use serde::{
de::{self, Unexpected, Visitor},
Deserialize, Deserialize... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use crate::{
crypto::{self, consts::BASE64_ENGINE},
error::{self, ResultContainerExt},
storage::{consts, types::Encrypted, utils},
};
use masking::{ExposeInterface, PeekInterface, Secret, StrongSec... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use crate::{
crypto::{self, consts::BASE64_ENGINE},
error::{self, ResultContainerExt},
storage::{consts, types::Encrypted, utils},
};
use masking::{ExposeInterface, PeekInterface, Secret, StrongSec... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use masking::{ExposeInterface, PeekInterface, Secret, StrongSecret};
pub fn from_secret(data: StrongSecret<Vec<u8>>) -> Self {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use crate::{
crypto::{self, consts::BASE64_ENGINE},
error::{self, ResultContainerExt},
storage::{consts, types::Encrypted, utils},
};
use serde::{
de::{self, Unexpected, Visitor},
Deserialize, Deserialize... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use crate::{
crypto::{self, consts::BASE64_ENGINE},
error::{self, ResultContainerExt},
storage::{consts, types::Encrypted, utils},
};
use serde::{
de::{self, Unexpected, Visitor},
Deseriali... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
fn from(value: EncryptedData) -> Self {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use crate::{
crypto::{self, consts::BASE64_ENGINE},
error::{self, ResultContainerExt},
storage::{consts, types::Encrypted, utils},
};
use masking::{ExposeInterface, PeekInterface, Secret, StrongSec... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use masking::{ExposeInterface, PeekInterface, Secret, StrongSecret};
pub fn from_secret(data: Secret<Vec<u8>>) -> Self {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use masking::{ExposeInterface, PeekInterface, Secret, StrongSecret};
pub fn create_request(key_identifier: String, data: Secret<Vec<u8>>) -> Self {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use crate::{
crypto::{self, consts::BASE64_ENGINE},
error::{self, ResultContainerExt},
storage::{consts, types::Encrypted, utils},
};
use masking::{ExposeInterface, PeekInterface, Secret, StrongSec... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use crate::{
crypto::{self, consts::BASE64_ENGINE},
error::{self, ResultContainerExt},
storage::{consts, types::Encrypted, utils},
};
pub fn create_request(key: Vec<u8>) -> Self {
<|fim_suffix|>
<|... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/keymanager/external_keymanager/types.rs | crate: src
use crate::{
crypto::{self, consts::BASE64_ENGINE},
error::{self, ResultContainerExt},
storage::{consts, types::Encrypted, utils},
};
pub fn create_request() -> Self {
{<|fim_suffix|>
<|fim_middle|... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/utils.rs | crate: src
/// Generate UUID v4 as strings to be used in storage layer
pub fn generate_uuid() -> String {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/utils.rs | crate: src
use crate::storage::consts;
pub fn generate_nano_id(id_length: usize) -> String {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/caching.rs | crate: src
use super::types;
pub(super) type Cache<T, U> =
moka::future::Cache<<T as super::Cacheable<U>>::Key, Arc<<T as super::Cacheable<U>>::Value>>;
pub fn implement_cache(config: &'_ crate::config::Cache) -> impl Fn(T) -> Self + '_ {
{<|fi... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/caching.rs | crate: src
use super::types;
pub(super) type Cache<T, U> =
moka::future::Cache<<T as super::Cacheable<U>>::Key, Arc<<T as super::Cacheable<U>>::Value>>;
pub async fn cache_data<U>(
&self,
key: <T as super::Cacheable<U>>::Key,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/caching.rs | crate: src
use std::sync::Arc;
use super::types;
pub(super) type Cache<T, U> =
moka::future::Cache<<T as super::Cacheable<U>>::Key, Arc<<T as super::Cacheable<U>>::Value>>;
pub async fn lookup<U>(
&self,
key: <T as super::Cachea... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/caching.rs | crate: src
use super::types;
pub(super) type Cache<T, U> =
moka::future::Cache<<T as super::Cacheable<U>>::Key, Arc<<T as super::Cacheable<U>>::Value>>;
fn get_cache(&self) -> &Cache<T, types::Entity> {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/caching.rs | crate: src
use super::types;
pub(super) type Cache<T, U> =
moka::future::Cache<<T as super::Cacheable<U>>::Key, Arc<<T as super::Cacheable<U>>::Value>>;
fn get_cache(&self) -> &Cache<T, types::Fingerprint> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/caching.rs | crate: src
use super::types;
pub(super) type Cache<T, U> =
moka::future::Cache<<T as super::Cacheable<U>>::Key, Arc<<T as super::Cacheable<U>>::Value>>;
fn get_cache(&self) -> &Cache<T, types::HashTable> {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/caching.rs | crate: src
use super::types;
pub(super) type Cache<T, U> =
moka::future::Cache<<T as super::Cacheable<U>>::Key, Arc<<T as super::Cacheable<U>>::Value>>;
fn get_cache(&self) -> &Cache<T, types::Merchant> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/caching.rs | crate: src
use std::sync::Arc;
use super::types;
pub(super) type Cache<T, U> =
moka::future::Cache<<T as super::Cacheable<U>>::Key, Arc<<T as super::Cacheable<U>>::Value>>;
fn new_cache<T, U>(config: &crate::config::Cache, name: &str) -> Cache<... | ast_fragments |
// file: hyperswitch-card-vault/src/storage/caching/fingerprint.rs | crate: src
use masking::{ExposeInterface, PeekInterface, Secret};
use crate::{
error::ContainerError,
storage::{self, types},
};
async fn get_or_insert_fingerprint(
&self,
data: Secret<String>,
key: Secret<String>,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/caching/fingerprint.rs | crate: src
use masking::{ExposeInterface, PeekInterface, Secret};
use crate::{
error::ContainerError,
storage::{self, types},
};
async fn find_by_fingerprint_hash(
&self,
fingerprint_hash: Secret<Vec<u8>>,
) ... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/caching/merchant.rs | crate: src
use crate::{
error::{ContainerError, NotFoundError},
storage::{self, types},
};
async fn insert_merchant(
&self,
new: types::MerchantNew<'_>,
key: &Self::Algorithm,
) -> Result<types::Merchant... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/caching/merchant.rs | crate: src
use crate::crypto::encryption_manager::managers::aes;
use crate::{
error::{ContainerError, NotFoundError},
storage::{self, types},
};
async fn find_or_create_by_merchant_id(
&self,
merchant_id: &str,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/storage/caching/merchant.rs | crate: src
use crate::{
error::{ContainerError, NotFoundError},
storage::{self, types},
};
async fn find_by_merchant_id(
&self,
merchant_id: &str,
key: &Self::Algorithm,
) -> Result<types::Merchant, Cont... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/error/custom_error.rs | crate: src
fn is_not_found(&self) -> bool {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
// file: hyperswitch-card-vault/src/error/custom_error.rs | crate: src
fn is_not_found(&self) -> bool {
matches!(self.error.current_context(), MerchantDBError::NotFoundError)
} | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/health.rs | crate: src
use crate::tenant::GlobalAppState;
use crate::{crypto::keymanager, logger};
use axum::{routing::get, Json};
use crate::{custom_extractors::TenantStateResolver, error, storage::TestInterface};
/// '/health/diagnostics` API handler`
pub asyn... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/health.rs | crate: src
use crate::tenant::GlobalAppState;
use crate::{crypto::keymanager, logger};
use axum::{routing::get, Json};
use crate::{custom_extractors::TenantStateResolver, error, storage::TestInterface};
/// '/health` API handler`
pub async fn health(... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/health.rs | crate: src
use std::sync::Arc;
use crate::tenant::GlobalAppState;
use axum::{routing::get, Json};
///
/// Function for registering routes that is specifically handling the health apis
///
pub fn serve() -> axum::Router<Arc<GlobalAppState>> {
{<|fim_s... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/tenant.rs | crate: src
pub fn serve<S>() -> axum::Router<S>
where
S: Send + Sync + Clone + 'static,
{
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/key_migration.rs | crate: src
use crate::{
app::TenantAppState,
crypto::{
consts::BASE64_ENGINE,
encryption_manager::managers::aes::GcmAes256,
keymanager::external_keymanager::{
self,
types::{DataKeyTransfe... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/key_migration.rs | crate: src
use crate::{
app::TenantAppState,
crypto::{
consts::BASE64_ENGINE,
encryption_manager::managers::aes::GcmAes256,
keymanager::external_keymanager::{
self,
types::{DataKeyTransfe... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/key_migration.rs | crate: src
use axum::Json;
use crate::{
app::TenantAppState,
crypto::{
consts::BASE64_ENGINE,
encryption_manager::managers::aes::GcmAes256,
keymanager::external_keymanager::{
self,
types:... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/data.rs | crate: src
use axum::{routing::post, Json};
use axum::{error_handling::HandleErrorLayer, response::IntoResponse};
use crate::{
crypto::{
hash_manager::managers::sha::Sha512,
keymanager::{self, KeyProvider},
},
custom_extract... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/data.rs | crate: src
use axum::{routing::post, Json};
use axum::{error_handling::HandleErrorLayer, response::IntoResponse};
use crate::{
crypto::{
hash_manager::managers::sha::Sha512,
keymanager::{self, KeyProvider},
},
custom_extract... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/data.rs | crate: src
use std::sync::Arc;
use axum::{routing::post, Json};
use axum::{error_handling::HandleErrorLayer, response::IntoResponse};
use crate::{
crypto::{
hash_manager::managers::sha::Sha512,
keymanager::{self, KeyProvider},
}... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/data.rs | crate: src
use axum::{routing::post, Json};
use axum::{error_handling::HandleErrorLayer, response::IntoResponse};
use crate::{
crypto::{
hash_manager::managers::sha::Sha512,
keymanager::{self, KeyProvider},
},
custom_extract... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/data.rs | crate: src
use axum::{routing::post, Json};
use axum::{error_handling::HandleErrorLayer, response::IntoResponse};
use crate::{
crypto::{
hash_manager::managers::sha::Sha512,
keymanager::{self, KeyProvider},
},
custom_extract... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/data.rs | crate: src
use axum::{routing::post, Json};
use axum::{error_handling::HandleErrorLayer, response::IntoResponse};
async fn ratelimit_err_handler(_: axum::BoxError) -> impl IntoResponse {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/key_custodian.rs | crate: src
use std::sync::Arc;
use axum::{extract::State, routing::post, Json};
use crate::{
app::TenantAppState,
config::TenantConfig,
crypto::encryption_manager::{encryption_interface::Encryption, managers::aes::GcmAes256},
c... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/key_custodian.rs | crate: src
use crate::{
app::TenantAppState,
config::TenantConfig,
crypto::encryption_manager::{encryption_interface::Encryption, managers::aes::GcmAes256},
custom_extractors::TenantId,
error::{self, ResultContainerExt},
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/key_custodian.rs | crate: src
use std::sync::Arc;
use axum::{extract::State, routing::post, Json};
use crate::{
app::TenantAppState,
config::TenantConfig,
crypto::encryption_manager::{encryption_interface::Encryption, managers::aes::GcmAes256},
c... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/key_custodian.rs | crate: src
use std::sync::Arc;
use axum::{extract::State, routing::post, Json};
use crate::{
app::TenantAppState,
config::TenantConfig,
crypto::encryption_manager::{encryption_interface::Encryption, managers::aes::GcmAes256},
c... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/key_custodian.rs | crate: src
use std::sync::Arc;
use axum::{extract::State, routing::post, Json};
use crate::{
app::TenantAppState,
config::TenantConfig,
crypto::encryption_manager::{encryption_interface::Encryption, managers::aes::GcmAes256},
c... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/key_custodian.rs | crate: src
use crate::{
app::TenantAppState,
config::TenantConfig,
crypto::encryption_manager::{encryption_interface::Encryption, managers::aes::GcmAes256},
custom_extractors::TenantId,
error::{self, ResultContainerExt},
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/routes_v2/data/types.rs | crate: src
use masking::{Secret, StrongSecret};
use crate::{
error,
routes::data::types::{SecretDataManager, Ttl, Validation},
storage::{storage_v2::types::Vault, types::Encryptable},
};
fn set_decrypted_data(mut self, decry... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/data/types.rs | crate: src
use masking::{Secret, StrongSecret};
use crate::{
error,
storage::{
self,
types::{Encryptable, Locker},
},
utils,
};
fn get_encrypted_inner_value(&self) -> Option<Secret<Vec<u8>>> {
<|fim_suffix|>
<|fim_... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/routes/data/types.rs | crate: src
use crate::{
error,
storage::{
self,
types::{Encryptable, Locker},
},
utils,
};
fn validate(&self) -> Result<(), Self::Error> {
{
Data::EncData { .. } => Ok(()),<|fim_suffix|>
<|fim_middle|>
Data::Card {... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-encryption-service/src/core/crypto/decryption.rs | crate: src
use crate::{
env::observability as logger,
errors::{self, SwitchError},
metrics,
multitenancy::TenantState,
types::{requests::DecryptionRequest, response::DecryptionResponse},
};
use opentelemetry::KeyV... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-encryption-service/src/core/datakey/rotate.rs | crate: src
use crate::{
core::{crypto::KeyEncrypter, custodian::Custodian},
env::observability as logger,
errors::{self, SwitchError},
multitenancy::TenantState,
storage::dek::DataKeyStorageInterface,
types::{req... | ast_fragments |
// file: hyperswitch-encryption-service/src/storage/adapter/postgres.rs | crate: src
use crate::storage::{adapter::PostgreSQL, errors, Config, Connection, DbState};
use diesel::ConnectionError;
use diesel_async::pooled_connection::{bb8::Pool, AsyncDieselConnectionManager, ManagerConfig};
use diesel_async::AsyncPgConnec... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/hyperswitch_domain_models/src/refunds.rs | crate: hyperswitch_domain_models
use crate::errors;
fn try_from(
(value, auth_profile_id_list): (
api_models::refunds::RefundListRequest,
Option<Vec<common_utils::id_type::ProfileId>>,
),
) ... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/hyperswitch_domain_models/src/disputes.rs | crate: hyperswitch_domain_models
use crate::errors;
fn try_from(
(value, auth_profile_id_list): (
api_models::disputes::DisputeListGetConstraints,
Option<Vec<common_utils::id_type::ProfileId>>,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/hyperswitch_domain_models/src/merchant_key_store.rs | crate: hyperswitch_domain_models
use common_utils::{
crypto::Encryptable,
custom_serde, date_time,
errors::{CustomResult, ValidationError},
type_name,
types::keymanager::{self, KeyManagerState},
};
use m... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/hyperswitch_domain_models/src/payouts/payouts.rs | crate: hyperswitch_domain_models
fn from(payout_update: PayoutsUpdate) -> Self {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/hyperswitch_domain_models/src/payouts/payout_attempt.rs | crate: hyperswitch_domain_models
fn from(payout_update: PayoutAttemptUpdate) -> Self {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/test_utils/tests/connectors/bluesnap_ui.rs | crate: test_utils | connector: bluesnap_ui
async fn should_make_3ds_payment(driver: WebDriver) -> Result<(), WebDriverError> {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/test_utils/src/main.rs | crate: test_utils
use std::process::{exit, Command};
use anyhow::Result;
use test_utils::newman_runner;
fn main() -> Result<()> {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/payouts.rs | crate: diesel_models
use serde::{self, Deserialize, Serialize};
pub fn apply_changeset(self, source: Payouts) -> Payouts {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/fraud_check.rs | crate: diesel_models
fn from(fraud_check_update: FraudCheckUpdate) -> Self {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/user.rs | crate: diesel_models
use common_utils::{encryption::Encryption, pii};
fn from(user_update: UserUpdate) -> Self {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/gsm.rs | crate: diesel_models
use common_utils::{
custom_serde,
events::{ApiEventMetric, ApiEventsType},
};
fn from(value: GatewayStatusMappingUpdate) -> Self {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/payout_attempt.rs | crate: diesel_models
use serde::{self, Deserialize, Serialize};
pub fn apply_changeset(self, source: PayoutAttempt) -> PayoutAttempt {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/user/sample_data.rs | crate: diesel_models
use crate::{
enums::{MandateDataType, MandateDetails},
ConnectorMandateReferenceId, PaymentAttemptNew,
};
fn convert_into_normal_attempt_insert(self) -> PaymentAttemptNew {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/producer.rs | crate: scheduler
use common_utils::{errors::CustomResult, id_type};
use diesel_models::enums::ProcessTrackerStatus;
use error_stack::{report, ResultExt};
use time::Duration;
use super::{
env::logger::{self, debug, error, warn},
metrics,
};
u... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/producer.rs | crate: scheduler
use common_utils::{errors::CustomResult, id_type};
use super::{
env::logger::{self, debug, error, warn},
metrics,
};
use crate::{
configs::settings::SchedulerSettings, errors, flow::SchedulerFlow,
scheduler::Schedule... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/producer.rs | crate: scheduler
use std::sync::Arc;
use common_utils::{errors::CustomResult, id_type};
use diesel_models::enums::ProcessTrackerStatus;
use error_stack::{report, ResultExt};
use router_env::{
instrument,
tracing::{self, Instrument},
};
use t... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router_derive/src/macros/api_error.rs | crate: router_derive
use std::collections::HashMap;
use proc_macro2::TokenStream;
use quote::quote;
use syn::{
punctuated::Punctuated, token::Comma, Data, DeriveInput, Fields, Ident, ImplGenerics,
TypeGenerics, Variant, WhereClau... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router_derive/src/macros/api_error.rs | crate: router_derive
use std::collections::HashMap;
use proc_macro2::TokenStream;
use quote::quote;
use syn::{
punctuated::Punctuated, token::Comma, Data, DeriveInput, Fields, Ident, ImplGenerics,
TypeGenerics, Variant, WhereClau... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router_derive/src/macros/api_error.rs | crate: router_derive
use std::collections::HashMap;
use proc_macro2::TokenStream;
use quote::quote;
use syn::{
punctuated::Punctuated, token::Comma, Data, DeriveInput, Fields, Ident, ImplGenerics,
TypeGenerics, Variant, WhereClau... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router_derive/src/macros/api_error.rs | crate: router_derive
use std::collections::HashMap;
use proc_macro2::TokenStream;
use quote::quote;
use syn::{
punctuated::Punctuated, token::Comma, Data, DeriveInput, Fields, Ident, ImplGenerics,
TypeGenerics, Variant, WhereClau... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router_derive/src/macros/api_error.rs | crate: router_derive
use std::collections::HashMap;
use proc_macro2::TokenStream;
use quote::quote;
use syn::{
punctuated::Punctuated, token::Comma, Data, DeriveInput, Fields, Ident, ImplGenerics,
TypeGenerics, Variant, WhereClau... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/euclid/src/backend/interpreter/types.rs | crate: euclid
use std::{collections::HashMap, fmt, ops::Deref, string::ToString};
use crate::{backend::inputs, frontend::ast::ValueType, types::EuclidKey};
fn from(input: inputs::BackendInput) -> Self {
{<|fim_suffix|>
<|fim_middle|>
}... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/euclid/src/backend/vir_interpreter/types.rs | crate: euclid
use rustc_hash::{FxHashMap, FxHashSet};
use crate::{
backend::inputs::BackendInput,
dssa,
types::{self, EuclidKey, EuclidValue, MetadataValue, NumValueRefinement, StrValue},
};
pub fn from_input(input: Bac... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/euclid/src/backend/vir_interpreter/types.rs | crate: euclid
use crate::{
backend::inputs::BackendInput,
dssa,
types::{self, EuclidKey, EuclidValue, MetadataValue, NumValueRefinement, StrValue},
};
pub fn check_presence(&self, value: &EuclidValue) -> bool {
{<|fim_s... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/kgraph_utils/benches/evaluation.rs | crate: kgraph_utils
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use euclid::{
dirval,
dssa::graph::{self, CgraphExt},
frontend::dir,
types::{NumValue, NumValueRefinement},
};
use hyperswitch_const... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/kgraph_utils/benches/evaluation.rs | crate: kgraph_utils
use std::{collections::HashMap, str::FromStr};
use api_models::{
admin as admin_api, enums as api_enums, payment_methods::RequestPaymentMethodTypes,
};
use common_utils::types::MinorUnit;
use criterion::{black_box, c... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/external_services/build.rs | crate: external_services
fn main() -> Result<(), Box<dyn std::error::Error>> {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/external_services/src/grpc_client/dynamic_routing.rs | crate: external_services
use std::fmt::Debug;
use router_env::logger;
pub use contract_routing_client::ContractScoreCalculatorClient;
pub use elimination_based_client::EliminationAnalyserClient;
pub use success_rate_client... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/analytics/src/outgoing_webhook_event/events.rs | crate: analytics
use api_models::analytics::{outgoing_webhook_event::OutgoingWebhookLogsRequest, Granularity};
use common_utils::errors::ReportSwitchExt;
use time::PrimitiveDateTime;
use crate::{
query::{Aggregate, GroupByCl... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/analytics/src/connector_events/events.rs | crate: analytics
use api_models::analytics::{connector_events::ConnectorEventsRequest, Granularity};
use common_utils::errors::ReportSwitchExt;
use time::PrimitiveDateTime;
use crate::{
query::{Aggregate, GroupByClause, QueryBuild... | ast_fragments |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.