text stringlengths 70 351k | source stringclasses 4
values |
|---|---|
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/api/generic_link_response/context.rs | crate: router
use rust_i18n::t;
use tera::Context;
pub fn insert_locales_in_context_for_payout_link_status(context: &mut Context, locale: &str) {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/api/generic_link_response/context.rs | crate: router
use rust_i18n::t;
use tera::Context;
pub fn insert_locales_in_context_for_payout_link(context: &mut Context, locale: &str) {
{let i18n_payout_link_title = t!("payout_link.initiate.title", locale = locale)... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/api/generic_link_response/context.rs | crate: router
use rust_i18n::t;
use tera::Context;
pub fn insert_locales_in_context_for_payout_link_status(context: &mut Context, locale: &str) {
{let i18n_payout_link_status_title = t!("payout_link.status.title", loca... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
use std::collections::HashMap;
use api_models::enums::ReconPermissionScope;
use common_enums::{EntityType, PermissionGroup, Resource, RoleScope};
use super::permission_groups::{RECON_OPS, RECON_REPORTS};
pub fn get_rec... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
use common_utils::{errors::CustomResult, id_type};
use crate::{core::errors, routes::SessionState};
pub async fn from_role_id_in_lineage(
state: &SessionState,
role_id: &str,
merchant_id: &id_ty... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
use std::collections::HashMap;
use api_models::enums::ReconPermissionScope;
use common_enums::{EntityType, PermissionGroup, Resource, RoleScope};
use super::permission_groups::{RECON_OPS, RECON_REPORTS};
pub fn get_rec... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
fn from(role: diesel_models::role::Role) -> Self {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
use common_utils::{errors::CustomResult, id_type};
use crate::{core::errors, routes::SessionState};
pub async fn from_role_id_org_id_tenant_id(
state: &SessionState,
role_id: &str,
org_id: &id_t... | ast_fragments |
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
use common_utils::{errors::CustomResult, id_type};
use crate::{core::errors, routes::SessionState};
pub async fn from_role_id_in_lineage(
state: &SessionState,
role_id: &str,
merchant_id: &id_type::MerchantId,... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
use super::{permission_groups::PermissionGroupExt, permissions::Permission};
pub fn check_permission_exists(&self, required_permission: Permission) -> bool {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
use std::collections::HashSet;
use common_enums::{EntityType, PermissionGroup, Resource, RoleScope};
pub fn get_resources_set(&self) -> HashSet<Resource> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
pub fn is_updatable(&self) -> bool {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
pub fn is_internal(&self) -> bool {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
pub fn is_deletable(&self) -> bool {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
pub fn is_invitable(&self) -> bool {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
use common_enums::{EntityType, PermissionGroup, Resource, RoleScope};
pub fn get_entity_type(&self) -> EntityType {
self.entity_type
} | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
use common_enums::{EntityType, PermissionGroup, Resource, RoleScope};
pub fn get_scope(&self) -> RoleScope {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
use std::collections::HashSet;
use common_enums::{EntityType, PermissionGroup, Resource, RoleScope};
pub fn get_permission_groups(&self) -> Vec<PermissionGroup> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
pub fn get_role_name(&self) -> &str {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
// file: hyperswitch/crates/router/src/services/authorization/roles.rs | crate: router
pub fn get_role_id(&self) -> &str {
&self.role_id
} | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/permission_groups.rs | crate: router
use std::collections::HashMap;
use common_enums::{EntityType, ParentGroup, PermissionGroup, PermissionScope, Resource};
use super::permissions::{self, ResourceExt};
fn get_descriptions_for_groups(
e... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/permission_groups.rs | crate: router
use super::permissions::{self, ResourceExt};
fn accessible_groups(&self) -> Vec<Self> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/permission_groups.rs | crate: router
use common_enums::{EntityType, ParentGroup, PermissionGroup, PermissionScope, Resource};
use super::permissions::{self, ResourceExt};
fn resources(&self) -> Vec<Resource> {
{
Self::Operations => OPERATIONS.... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/permission_groups.rs | crate: router
use super::permissions::{self, ResourceExt};
fn accessible_groups(&self) -> Vec<Self> {
{
Self::OperationsView => vec![Self::OperationsView, Self::ConnectorsView],<|fim_suffix|>
<|fim_middle|>
Self::Account... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/permission_groups.rs | crate: router
use common_enums::{EntityType, ParentGroup, PermissionGroup, PermissionScope, Resource};
use super::permissions::{self, ResourceExt};
fn resources(&self) -> Vec<Resource> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/permission_groups.rs | crate: router
use common_enums::{EntityType, ParentGroup, PermissionGroup, PermissionScope, Resource};
use super::permissions::{self, ResourceExt};
fn parent(&self) -> ParentGroup {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/permission_groups.rs | crate: router
use common_enums::{EntityType, ParentGroup, PermissionGroup, PermissionScope, Resource};
use super::permissions::{self, ResourceExt};
fn scope(&self) -> PermissionScope {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/info.rs | crate: router
use common_enums::{ParentGroup, PermissionGroup};
fn get_group_description(group: PermissionGroup) -> &'static str {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/info.rs | crate: router
use common_enums::{ParentGroup, PermissionGroup};
fn get_group_description(group: PermissionGroup) -> &'static str {
{
PermissionGroup::OperationsView => {
"View Payments, Refunds, Payouts, Mandates, Dispute... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/info.rs | crate: router
use api_models::user_role::GroupInfo;
use common_enums::{ParentGroup, PermissionGroup};
fn get_group_info_from_permission_group(group: PermissionGroup) -> GroupInfo {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authorization/info.rs | crate: router
use api_models::user_role::GroupInfo;
use common_enums::{ParentGroup, PermissionGroup};
pub fn get_group_authorization_info() -> Vec<GroupInfo> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/decision.rs | crate: router
use common_utils::{errors::CustomResult, request::RequestContent};
use masking::{ErasedMaskSerialize, Secret};
use storage_impl::errors::ApiClientError;
use crate::{
core::metrics,
routes::{app::settings::D... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/decision.rs | crate: router
use common_utils::{errors::CustomResult, request::RequestContent};
use masking::{ErasedMaskSerialize, Secret};
use storage_impl::errors::ApiClientError;
use crate::{
core::metrics,
routes::{app::settings::D... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/decision.rs | crate: router
use common_utils::{errors::CustomResult, request::RequestContent};
pub fn convert_expiry(expiry: time::PrimitiveDateTime) -> u64 {
{
i64::MIN..=0 => 0,<|fim_suffix|>
<|fim_middle|>
_ => output as u64,
}
} | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/decision.rs | crate: router
use crate::{
core::metrics,
routes::{app::settings::DecisionConfig, SessionState},
};
pub fn spawn_tracked_job<E, F>(future: F, request_type: &'static str)
where
E: std::fmt::Debug,
F: futures::Futu... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/decision.rs | crate: router
use common_utils::{errors::CustomResult, request::RequestContent};
pub fn convert_expiry(expiry: time::PrimitiveDateTime) -> u64 {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/decision.rs | crate: router
use common_utils::{errors::CustomResult, request::RequestContent};
use masking::{ErasedMaskSerialize, Secret};
use storage_impl::errors::ApiClientError;
use crate::{
core::metrics,
routes::{app::settings::D... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/decision.rs | crate: router
use common_utils::{errors::CustomResult, request::RequestContent};
use masking::{ErasedMaskSerialize, Secret};
use storage_impl::errors::ApiClientError;
use crate::{
core::metrics,
routes::{app::settings::D... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/detached.rs | crate: router
use std::{borrow::Cow, string::ToString};
use actix_web::http::header::HeaderMap;
use common_utils::{
crypto::VerifySignature,
id_type::{ApiKeyId, MerchantId},
};
use error_stack::ResultExt;
use hyperswitch... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/detached.rs | crate: router
use common_utils::{
crypto::VerifySignature,
id_type::{ApiKeyId, MerchantId},
};
fn append_api_key(prefix: &str, data: &Option<ApiKeyId>) -> String {
{
Some(inner) => format!("{}:{}", prefix, inner.get_stri... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/detached.rs | crate: router
use common_utils::{
crypto::VerifySignature,
id_type::{ApiKeyId, MerchantId},
};
fn append_api_key(prefix: &str, data: &Option<ApiKeyId>) -> String {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/detached.rs | crate: router
fn append_option(prefix: &str, data: &Option<String>) -> String {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/detached.rs | crate: router
fn generate_payload(&self) -> String {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/authentication/detached.rs | crate: router
use actix_web::http::header::HeaderMap;
use common_utils::{
crypto::VerifySignature,
id_type::{ApiKeyId, MerchantId},
};
pub fn verify_checksum(
&self,
headers: &HeaderMap,
algo: imp... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
use common_utils::{errors::CustomResult, pii, types::theme::EmailThemeConfig};
use external_services::email::{EmailContents, EmailData, EmailError};
use crate::{
core::errors::{UserErrors, UserResult},
services::jwt,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
use external_services::email::{EmailContents, EmailData, EmailError};
pub fn get_html_body(email_body: EmailBody) -> String {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
use common_utils::{errors::CustomResult, pii, types::theme::EmailThemeConfig};
use external_services::email::{EmailContents, EmailData, EmailError};
async fn get_email_data(&self, _base_url: &str) -> CustomResult<EmailContents... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
use api_models::user::dashboard_metadata::ProdIntent;
use common_enums::{EntityType, MerchantProductType};
use common_utils::{errors::CustomResult, pii, types::theme::EmailThemeConfig};
use external_services::email::{EmailCont... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
use api_models::user::dashboard_metadata::ProdIntent;
use crate::{configs, consts, routes::SessionState};
pub fn get_base_url(state: &SessionState) -> &str {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
use api_models::user::dashboard_metadata::ProdIntent;
pub fn get_link_with_token(
base_url: impl std::fmt::Display,
token: impl std::fmt::Display,
action: impl std::fmt::Display,
auth_id: &Option<impl std::fmt:... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
use crate::{
core::errors::{UserErrors, UserResult},
services::jwt,
types::domain,
};
pub fn get_flow(&self) -> domain::Origin {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
pub fn get_entity(&self) -> Option<&Entity> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
use common_utils::{errors::CustomResult, pii, types::theme::EmailThemeConfig};
use external_services::email::{EmailContents, EmailData, EmailError};
use crate::{
core::errors::{UserErrors, UserResult},
services::jwt,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
use external_services::email::{EmailContents, EmailData, EmailError};
use crate::{configs, consts, routes::SessionState};
use crate::{
core::errors::{UserErrors, UserResult},
services::jwt,
types::domain,
};
pub as... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
pub fn get_entity_id(&self) -> &str {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
use common_enums::{EntityType, MerchantProductType};
pub fn get_entity_type(&self) -> EntityType {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/router/src/services/email/types.rs | crate: router
use external_services::email::{EmailContents, EmailData, EmailError};
pub fn get_html_body(email_body: EmailBody) -> String {
{
EmailBody::Verify {
link,
entity_name,
entity_logo... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/error.rs | crate: src
use reqwest::StatusCode;
fn into_response(self) -> axum::response::Response {
{
Self::CustodianLocked => (
hyper::StatusCode::UNAUTHORIZED,
axum::Json(ApiErrorResponse::new(
error_codes::TE_00,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/error.rs | crate: src
fn new(code: &'static str, message: String, data: Option<serde_json::Value>) -> Self {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/error.rs | crate: src
fn into_response(self) -> axum::response::Response {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/tenant.rs | crate: src
use std::{collections::HashSet, sync::Arc};
use rustc_hash::FxHashMap;
use tokio::sync::RwLock;
use crate::config::TenantConfig;
use crate::routes::key_custodian::CustodianKeyState;
use crate::{api_client::ApiClient, app::TenantAppState, config::... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/tenant.rs | crate: src
use std::{collections::HashSet, sync::Arc};
use crate::{api_client::ApiClient, app::TenantAppState, config::GlobalConfig, error::ApiError};
pub async fn get_app_state_of_tenant(
&self,
tenant_id: &str,
) -> Result<Arc<TenantAp... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/tenant.rs | crate: src
use crate::{api_client::ApiClient, app::TenantAppState, config::GlobalConfig, error::ApiError};
pub async fn is_custodian_unlocked(&self, tenant_id: &str) -> Result<(), ApiError> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/tenant.rs | crate: src
use std::{collections::HashSet, sync::Arc};
use crate::config::TenantConfig;
use crate::{api_client::ApiClient, app::TenantAppState, config::GlobalConfig, error::ApiError};
pub async fn set_app_state(&self, state: TenantAppState) {
<|fim_suffix|>... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/tenant.rs | crate: src
use crate::{api_client::ApiClient, app::TenantAppState, config::GlobalConfig, error::ApiError};
pub fn is_known_tenant(&self, tenant_id: &str) -> Result<(), ApiError> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
// file: hyperswitch-card-vault/src/tenant.rs | crate: src
use std::{collections::HashSet, sync::Arc};
use crate::{api_client::ApiClient, app::TenantAppState, config::GlobalConfig, error::ApiError};
pub async fn get_app_state_of_tenant(
&self,
tenant_id: &str,
) -> Result<Arc<TenantAppState>, ApiErr... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
use crate::{
api_client::ApiClientConfig,
crypto::secrets_manager::{
secrets_interface::SecretManager, secrets_management::SecretsManagementConfig,
},
error,
logger::config::Log,
};
use error_stack::ResultExt;
pub asyn... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
use crate::{
api_client::ApiClientConfig,
crypto::secrets_manager::{
secrets_interface::SecretManager, secrets_management::SecretsManagementConfig,
},
error,
logger::config::Log,
};
fn test_hashicorp_case() {
{<|fim_su... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
use crate::{
api_client::ApiClientConfig,
crypto::secrets_manager::{
secrets_interface::SecretManager, secrets_management::SecretsManagementConfig,
},
error,
logger::config::Log,
};
fn test_aws_kms_case() {
{
SecretsMa... | ast_fragments |
// file: hyperswitch-card-vault/src/config.rs | crate: src
use crate::{
api_client::ApiClientConfig,
crypto::secrets_manager::{
secrets_interface::SecretManager, secrets_management::SecretsManagementConfig,
},
error,
logger::config::Log,
};
fn test_hashicorp_case() {
let data = r#"
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
use crate::{
api_client::ApiClientConfig,
crypto::secrets_manager::{
secrets_interface::SecretManager, secrets_management::SecretsManagementConfig,
},
error,
logger::config::Log,
};
fn test_aws_kms_case() {
<|fim_suffi... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
use crate::{
api_client::ApiClientConfig,
crypto::secrets_manager::{
secrets_interface::SecretManager, secrets_management::SecretsManagementConfig,
},
error,
logger::config::Log,
};
fn test_non_case() {
<|fim_suffix|>
... | ast_fragments |
// file: hyperswitch-card-vault/src/config.rs | crate: src
use std::{
collections::HashMap,
ops::{Deref, DerefMut},
path::PathBuf,
};
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Development => write!(f, "development"),
Self::Release... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
pub const fn config_path(self) -> &'static str {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
pub const fn current_env() -> Self {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
use crate::{
api_client::ApiClientConfig,
crypto::secrets_manager::{
secrets_interface::SecretManager, secrets_management::SecretsManagementConfig,
},
error,
logger::config::Log,
};
use error_stack::ResultExt;
pub fn v... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
use crate::{
api_client::ApiClientConfig,
crypto::secrets_manager::{
secrets_interface::SecretManager, secrets_management::SecretsManagementConfig,
},
error,
logger::config::Log,
};
use std::{
collections::HashMap,... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
use crate::{
api_client::ApiClientConfig,
crypto::secrets_manager::{
secrets_interface::SecretManager, secrets_management::SecretsManagementConfig,
},
error,
logger::config::Log,
};
pub fn builder(
environment:... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
use crate::{
api_client::ApiClientConfig,
crypto::secrets_manager::{
secrets_interface::SecretManager, secrets_management::SecretsManagementConfig,
},
error,
logger::config::Log,
};
use std::{
collections::HashMap,... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
use crate::{
api_client::ApiClientConfig,
crypto::secrets_manager::{
secrets_interface::SecretManager, secrets_management::SecretsManagementConfig,
},
error,
logger::config::Log,
};
/// Function to build the config... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
use std::{
collections::HashMap,
ops::{Deref, DerefMut},
path::PathBuf,
};
/// Get the origin directory of the project
pub fn workspace_path() -> PathBuf {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/config.rs | crate: src
fn deserialize_hex<'de, D>(deserializer: D) -> Result<Vec<u8>, D::Error>
where
D: serde::Deserializer<'de>,
{
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
// file: hyperswitch-card-vault/src/config.rs | crate: src
///
/// # Panics
///
/// Never, as tenant_id would already be validated from [`crate::custom_extractors::TenantId`] custom extractor
///
pub fn from_global_config(global_config: &GlobalConfig, tenant_id: String) -> Self {
Self {
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/app.rs | crate: src
use error_stack::ResultExt;
use std::sync::Arc;
use crate::{
api_client::ApiClient,
config::{self, GlobalConfig, TenantConfig},
error, logger,
routes::{self, routes_v2},
storage,
tenant::GlobalAppState,
utils,
};
use crat... | ast_fragments |
// file: hyperswitch-card-vault/src/app.rs | crate: src
use error_stack::ResultExt;
use std::sync::Arc;
use crate::{
api_client::ApiClient,
config::{self, GlobalConfig, TenantConfig},
error, logger,
routes::{self, routes_v2},
storage,
tenant::GlobalAppState,
utils,
};
use crate::storage::cac... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/app.rs | crate: src
use axum::{extract::Request, routing::post};
use axum_server::tls_rustls::RustlsConfig;
use tower_http::trace as tower_trace;
use crate::middleware as custom_middleware;
use axum::middleware;
use std::sync::Arc;
use crate::{
api_client::ApiClien... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/hash_manager/managers/sha.rs | crate: src
fn test_n_equal() {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/hash_manager/managers/sha.rs | crate: src
fn test_n_not_equal() {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
// file: hyperswitch-card-vault/src/crypto/hash_manager/managers/sha.rs | crate: src
fn test_n_equal() {
let data = "Hello, World!";
let key = "key";
let algo1 = HmacSha512::<10>::new(key.as_bytes().to_vec().into());
let algo2 = HmacSha512::<10>::new(key.as_bytes().to_vec().into());
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/hash_manager/managers/sha.rs | crate: src
fn test_key_equal() {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/hash_manager/managers/sha.rs | crate: src
fn test_key_not_equal() {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/hash_manager/managers/sha.rs | crate: src
fn test_input_data_not_equal() {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/hash_manager/managers/sha.rs | crate: src
fn test_input_data_equal() {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/hash_manager/managers/sha.rs | crate: src
use masking::{PeekInterface, Secret};
use ring::hmac;
fn encode(&self, input: Secret<Vec<u8>>) -> Self::ReturnType<Secret<Vec<u8>>> {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/hash_manager/managers/sha.rs | crate: src
use masking::{PeekInterface, Secret};
pub fn new(key: masking::Secret<Vec<u8>>) -> Self {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/hash_manager/managers/sha.rs | crate: src
use ring::hmac;
fn encode(&self, input: Vec<u8>) -> Self::ReturnType<Vec<u8>> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/aes.rs | crate: src
use ring::aead::{self, BoundKey};
fn test_gcm_aes_256_decode_message() {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/aes.rs | crate: src
use crate::{
crypto::encryption_manager::encryption_interface::Encryption,
error::{self, ContainerError},
};
use ring::aead::{self, BoundKey};
/// Returns the current nonce value as bytes.
fn current(&s... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/aes.rs | crate: src
fn test_gcm_aes_256_encode_message() {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch-card-vault/src/crypto/encryption_manager/managers/aes.rs | crate: src
use crate::{
crypto::encryption_manager::encryption_interface::Encryption,
error::{self, ContainerError},
};
use error_stack::ResultExt;
use ring::aead::{self, BoundKey};
pub fn generate_aes256_key() -> [u8... | ast_fragments |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.