diff --git a/backend/basic/src/rbum/dto/rbum_cert_conf_dto.rs b/backend/basic/src/rbum/dto/rbum_cert_conf_dto.rs index 76be11ecd..56132d4cc 100644 --- a/backend/basic/src/rbum/dto/rbum_cert_conf_dto.rs +++ b/backend/basic/src/rbum/dto/rbum_cert_conf_dto.rs @@ -664,7 +664,6 @@ pub struct RbumCertConfDetailResp { /// 凭证配置id和扩展信息 #[derive(Serialize, Deserialize, Debug)] #[cfg_attr(feature = "default", derive(poem_openapi::Object, sea_orm::FromQueryResult))] -#[deprecated] pub struct RbumCertConfIdAndExtResp { /// Certificate configuration id /// diff --git a/backend/basic/src/rbum/dto/rbum_cert_dto.rs b/backend/basic/src/rbum/dto/rbum_cert_dto.rs index 29d9066f2..a6d4b685c 100644 --- a/backend/basic/src/rbum/dto/rbum_cert_dto.rs +++ b/backend/basic/src/rbum/dto/rbum_cert_dto.rs @@ -291,8 +291,6 @@ pub struct RbumCertSummaryResp { /// /// 关联的[凭证配置](crate::rbum::dto::rbum_cert_conf_dto::RbumCertConfDetailResp)名称 pub rel_rbum_cert_conf_name: Option, - // TODO - pub rel_rbum_cert_conf_code: Option, /// Associated [resource kind](crate::rbum::rbum_enumeration::RbumCertRelKind) /// /// 关联的[资源类型](crate::rbum::rbum_enumeration::RbumCertRelKind) @@ -367,8 +365,6 @@ pub struct RbumCertSummaryWithSkResp { /// /// 关联的[凭证配置](crate::rbum::dto::rbum_cert_conf_dto::RbumCertConfDetailResp)名称 pub rel_rbum_cert_conf_name: Option, - // TODO - pub rel_rbum_cert_conf_code: Option, /// Associated [resource kind](crate::rbum::rbum_enumeration::RbumCertRelKind) /// /// 关联的[资源类型](crate::rbum::rbum_enumeration::RbumCertRelKind) @@ -439,8 +435,6 @@ pub struct RbumCertDetailResp { /// /// 关联的[凭证配置](crate::rbum::dto::rbum_cert_conf_dto::RbumCertConfDetailResp)名称 pub rel_rbum_cert_conf_name: Option, - // TODO - pub rel_rbum_cert_conf_code: Option, /// Associated [resource kind](crate::rbum::rbum_enumeration::RbumCertRelKind) /// /// 关联的[资源类型](crate::rbum::rbum_enumeration::RbumCertRelKind) diff --git a/backend/basic/src/rbum/rbum_config.rs b/backend/basic/src/rbum/rbum_config.rs index f4130b649..f0bb58bfa 100644 --- a/backend/basic/src/rbum/rbum_config.rs +++ b/backend/basic/src/rbum/rbum_config.rs @@ -18,9 +18,6 @@ pub struct RbumConfig { pub task_mq_topic_event: String, // own_paths:ak -> vcode pub cache_key_cert_vcode_info_: String, - pub cache_key_cert_vcode_expire_sec: usize, - pub cache_key_cert_code_: String, - pub cache_key_cert_code_expire_sec: usize, // set_code -> set_id pub cache_key_set_code_: String, pub cache_key_set_code_expire_sec: usize, @@ -42,9 +39,6 @@ impl Default for RbumConfig { mq_header_name_operator: "OP".to_string(), task_mq_topic_event: "rbum::task::event".to_string(), cache_key_cert_vcode_info_: "rbum:cache:cert:vcode:".to_string(), - cache_key_cert_vcode_expire_sec: 300, - cache_key_cert_code_: "rbum:cache:cert:code:".to_string(), - cache_key_cert_code_expire_sec: 60 * 60 * 24, cache_key_set_code_: "rbum:cache:set:code:".to_string(), cache_key_set_code_expire_sec: 60 * 60 * 24, cache_key_cert_locked_: "rbum:cert:locked:".to_string(), @@ -89,9 +83,6 @@ pub trait RbumConfigApi { fn rbum_conf_task_mq_topic_event(&self) -> String; fn rbum_conf_mq_header_name_operator(&self) -> String; fn rbum_conf_cache_key_cert_vcode_info_(&self) -> String; - fn rbum_conf_cache_key_cert_vcode_expire_sec(&self) -> usize; - fn rbum_conf_cache_key_cert_code_(&self) -> String; - fn rbum_conf_cache_key_cert_code_expire_sec(&self) -> usize; fn rbum_conf_cache_key_set_code_(&self) -> String; fn rbum_conf_cache_key_set_code_expire_sec(&self) -> usize; fn rbum_conf_cache_key_cert_locked_(&self) -> String; @@ -125,24 +116,6 @@ impl RbumConfigApi for TardisFunsInst { RbumConfigManager::get_config(self.module_code(), |conf| conf.cache_key_cert_vcode_info_.to_string()) } - // TODO - // #[deprecated] - fn rbum_conf_cache_key_cert_vcode_expire_sec(&self) -> usize { - RbumConfigManager::get_config(self.module_code(), |conf| conf.cache_key_cert_vcode_expire_sec) - } - - // TODO - // #[deprecated] - fn rbum_conf_cache_key_cert_code_(&self) -> String { - RbumConfigManager::get_config(self.module_code(), |conf| conf.cache_key_cert_code_.to_string()) - } - - // TODO - // #[deprecated] - fn rbum_conf_cache_key_cert_code_expire_sec(&self) -> usize { - RbumConfigManager::get_config(self.module_code(), |conf| conf.cache_key_cert_code_expire_sec) - } - fn rbum_conf_cache_key_set_code_(&self) -> String { RbumConfigManager::get_config(self.module_code(), |conf| conf.cache_key_set_code_.to_string()) } diff --git a/backend/basic/src/rbum/serv/rbum_cert_serv.rs b/backend/basic/src/rbum/serv/rbum_cert_serv.rs index 6980f2095..f893d74e7 100644 --- a/backend/basic/src/rbum/serv/rbum_cert_serv.rs +++ b/backend/basic/src/rbum/serv/rbum_cert_serv.rs @@ -210,31 +210,6 @@ impl RbumCrudOperation TardisResult<()> { - let rbum_cert_conf = Self::get_rbum(id, &RbumCertConfFilterReq::default(), funs, ctx).await?; - let key = &format!( - "{}{}", - funs.rbum_conf_cache_key_cert_code_(), - TardisFuns::crypto.base64.encode(format!( - "{}{}{}", - &rbum_cert_conf.kind, &rbum_cert_conf.rel_rbum_domain_id, &rbum_cert_conf.rel_rbum_item_id - )) - ); - funs.cache() - .set_ex( - key, - &TardisFuns::json.obj_to_string(&RbumCertConfIdAndExtResp { - id: rbum_cert_conf.id.clone(), - ext: rbum_cert_conf.ext.clone(), - })?, - funs.rbum_conf_cache_key_cert_code_expire_sec() as u64, - ) - .await?; - Ok(()) - } - async fn before_delete_rbum(id: &str, funs: &TardisFunsInst, ctx: &TardisContext) -> TardisResult> { if funs .db() @@ -252,27 +227,6 @@ impl RbumCrudOperation(&conf_info_stat).await? { - funs.cache() - .set_ex( - key, - &TardisFuns::json.obj_to_string(&rbum_cert_conf_id_and_ext)?, - funs.rbum_conf_cache_key_cert_code_expire_sec() as u64, - ) - .await?; + if let Some(rbum_cert_conf_id_and_ext) = funs.db().get_dto::(&conf_info_stat).await? { Ok(Some(rbum_cert_conf_id_and_ext)) } else { Ok(None) @@ -581,9 +519,9 @@ impl RbumCrudOperation TardisResult<()> { + pub async fn add_vcode_to_cache(ak: &str, vcode: &str, cert_conf_id: &str, funs: &TardisFunsInst, ctx: &TardisContext) -> TardisResult<()> { + let rbum_cert_conf = RbumCertConfServ::peek_rbum(cert_conf_id, &RbumCertConfFilterReq::default(), funs, ctx).await?; + funs.cache() .set_ex( - format!("{}{}:{}", funs.rbum_conf_cache_key_cert_vcode_info_(), own_paths, ak).as_str(), + format!("{}{}:{}", funs.rbum_conf_cache_key_cert_vcode_info_(), &ctx.own_paths, ak).as_str(), vcode.to_string().as_str(), - // TODO 可否使用 expire_sec? - funs.rbum_conf_cache_key_cert_vcode_expire_sec() as u64, + rbum_cert_conf.expire_sec as u64, ) .await?; Ok(()) diff --git a/backend/basic/tests/test_rbum_cert.rs b/backend/basic/tests/test_rbum_cert.rs index 9933a2b7c..d72832b30 100644 --- a/backend/basic/tests/test_rbum_cert.rs +++ b/backend/basic/tests/test_rbum_cert.rs @@ -737,18 +737,18 @@ async fn test_rbum_cert_sk_dynamic(context: &TardisContext) -> TardisResult<()> info!("【test_rbum_cert】 : Test Add : RbumCertServ::get_and_delete_vcode_in_cache"); assert!(RbumCertServ::get_and_delete_vcode_in_cache("i@sunisle.org", &context.own_paths, &funs).await?.is_none()); - RbumCertServ::add_vcode_to_cache("i@sunisle.org", "qqqqq", &context.own_paths, &funs).await?; + RbumCertServ::add_vcode_to_cache("i@sunisle.org", "qqqqq", &cert_conf_mail_vcode_id, &funs, &context).await?; assert_eq!( RbumCertServ::get_and_delete_vcode_in_cache("i@sunisle.org", &context.own_paths, &funs).await?.unwrap(), "qqqqq" ); info!("【test_rbum_cert】 : Test Validate : RbumCertServ::validate with sk_dynamic"); - RbumCertServ::add_vcode_to_cache("i@sunisle.org", "xxxx", &context.own_paths, &funs).await?; + RbumCertServ::add_vcode_to_cache("i@sunisle.org", "xxxx", &cert_conf_mail_vcode_id, &funs, &context).await?; RbumCertServ::validate_by_spec_cert_conf("i@sunisle.org", "xxxx", &cert_conf_mail_vcode_id, false, &context.own_paths, &funs).await?; info!("【test_rbum_cert】 : Test Validate : RbumCertServ::validate with sk_dynamic & expire"); - RbumCertServ::add_vcode_to_cache("i@sunisle.org", "xxxx", &context.own_paths, &funs).await?; + RbumCertServ::add_vcode_to_cache("i@sunisle.org", "xxxx", &cert_conf_mail_vcode_id, &funs, &context).await?; // tardis::tokio::time::sleep(Duration::from_secs(120)).await; RbumCertServ::get_and_delete_vcode_in_cache("i@sunisle.org", &context.own_paths, &funs).await?; assert!(RbumCertServ::validate_by_spec_cert_conf("i@sunisle.org", "xxxx", &cert_conf_mail_vcode_id, false, &context.own_paths, &funs).await.is_err()); diff --git a/backend/basic/tests/test_rbum_item.rs b/backend/basic/tests/test_rbum_item.rs index d86e5366c..789418365 100644 --- a/backend/basic/tests/test_rbum_item.rs +++ b/backend/basic/tests/test_rbum_item.rs @@ -705,7 +705,6 @@ async fn test_rbum_item_with_none_owner_name(context: &TardisContext) -> TardisR #[derive(Debug, sea_orm::FromQueryResult)] pub struct IamAccountResp { - pub id: String, pub ext1_idx: String, pub ext2: String, } diff --git a/backend/supports/iam/src/basic/serv/iam_account_serv.rs b/backend/supports/iam/src/basic/serv/iam_account_serv.rs index 72cb9104a..d262930f9 100644 --- a/backend/supports/iam/src/basic/serv/iam_account_serv.rs +++ b/backend/supports/iam/src/basic/serv/iam_account_serv.rs @@ -540,7 +540,7 @@ impl IamAccountServ { ) .await? .into_iter() - .map(|r| (r.rel_rbum_cert_conf_code.unwrap_or("".to_string()), r.ak)) + .map(|r| (r.rel_rbum_cert_conf_name.unwrap_or("".to_string()), r.ak)) .collect(), orgs: IamSetServ::find_set_paths(&account.id, &set_id, funs, &mock_tenant_ctx).await?.into_iter().map(|r| r.into_iter().map(|rr| rr.name).join("/")).collect(), exts: account_attrs @@ -615,7 +615,7 @@ impl IamAccountServ { ) .await? .into_iter() - .map(|r| (r.rel_rbum_cert_conf_code.unwrap_or("".to_string()), r.ak)) + .map(|r| (r.rel_rbum_cert_conf_name.unwrap_or("".to_string()), r.ak)) .collect(), orgs: IamSetServ::find_set_paths(&account.id, &set_id, funs, &mock_tenant_ctx).await?.into_iter().map(|r| r.into_iter().map(|rr| rr.name).join("/")).collect(), }); diff --git a/backend/supports/iam/src/basic/serv/iam_cert_mail_vcode_serv.rs b/backend/supports/iam/src/basic/serv/iam_cert_mail_vcode_serv.rs index 4a2554e81..34eb2ab86 100644 --- a/backend/supports/iam/src/basic/serv/iam_cert_mail_vcode_serv.rs +++ b/backend/supports/iam/src/basic/serv/iam_cert_mail_vcode_serv.rs @@ -193,7 +193,9 @@ impl IamCertMailVCodeServ { pub async fn resend_activation_mail(account_id: &str, mail: &str, funs: &TardisFunsInst, ctx: &TardisContext) -> TardisResult<()> { let vcode = Self::get_vcode(); - RbumCertServ::add_vcode_to_cache(mail, &vcode, &ctx.own_paths, funs).await?; + let rel_rbum_cert_conf_id = + IamCertServ::get_cert_conf_id_by_kind(IamCertKernelKind::MailVCode.to_string().as_str(), Some(IamTenantServ::get_id_by_ctx(&ctx, funs)?), funs).await?; + RbumCertServ::add_vcode_to_cache(mail, &vcode, &rel_rbum_cert_conf_id, funs, &ctx).await?; Self::send_activation_mail(account_id, mail, &vcode, funs, ctx).await } @@ -256,12 +258,12 @@ impl IamCertMailVCodeServ { pub async fn send_bind_mail(mail: &str, funs: &TardisFunsInst, ctx: &TardisContext) -> TardisResult<()> { let ctx = IamAccountServ::new_context_if_account_is_global(ctx, funs).await?; - // let rel_rbum_cert_conf_id = - // IamCertServ::get_cert_conf_id_by_kind(IamCertKernelKind::MailVCode.to_string().as_str(), Some(IamTenantServ::get_id_by_ctx(&ctx, funs)?), funs).await?; + let rel_rbum_cert_conf_id = + IamCertServ::get_cert_conf_id_by_kind(IamCertKernelKind::MailVCode.to_string().as_str(), Some(IamTenantServ::get_id_by_ctx(&ctx, funs)?), funs).await?; // Self::check_bind_mail(mail, vec![rel_rbum_cert_conf_id], &ctx.owner, funs, &ctx).await?; let vcode = Self::get_vcode(); let account_name = IamAccountServ::peek_item(&ctx.owner, &IamAccountFilterReq::default(), funs, &ctx).await?.name; - RbumCertServ::add_vcode_to_cache(mail, &vcode, &ctx.own_paths, funs).await?; + RbumCertServ::add_vcode_to_cache(mail, &vcode, &rel_rbum_cert_conf_id, funs, &ctx).await?; MailClient::send_cert_activate_vcode(mail, Some(account_name), &vcode, funs).await?; Ok(()) } @@ -409,7 +411,7 @@ impl IamCertMailVCodeServ { }, ak: Some(mail.to_string()), rel_rbum_kind: Some(RbumCertRelKind::Item), - rel_rbum_cert_conf_ids: Some(vec![tenant_rbum_cert_conf_id]), + rel_rbum_cert_conf_ids: Some(vec![tenant_rbum_cert_conf_id.clone()]), ..Default::default() }, funs, @@ -419,7 +421,7 @@ impl IamCertMailVCodeServ { > 0 { let vcode = Self::get_vcode(); - RbumCertServ::add_vcode_to_cache(mail, &vcode, &own_paths, funs).await?; + RbumCertServ::add_vcode_to_cache(mail, &vcode, &tenant_rbum_cert_conf_id, funs, &mock_ctx).await?; MailClient::send_vcode(mail, None, &vcode, funs).await?; return Ok(()); } @@ -432,7 +434,7 @@ impl IamCertMailVCodeServ { }, ak: Some(mail.to_string()), rel_rbum_kind: Some(RbumCertRelKind::Item), - rel_rbum_cert_conf_ids: Some(vec![global_rbum_cert_conf_id]), + rel_rbum_cert_conf_ids: Some(vec![global_rbum_cert_conf_id.clone()]), ..Default::default() }, funs, @@ -442,7 +444,17 @@ impl IamCertMailVCodeServ { > 0 { let vcode = Self::get_vcode(); - RbumCertServ::add_vcode_to_cache(mail, &vcode, "", funs).await?; + RbumCertServ::add_vcode_to_cache( + mail, + &vcode, + &global_rbum_cert_conf_id, + funs, + &TardisContext { + own_paths: "".to_string(), + ..Default::default() + }, + ) + .await?; MailClient::send_vcode(mail, None, &vcode, funs).await?; return Ok(()); } diff --git a/backend/supports/iam/src/basic/serv/iam_cert_phone_vcode_serv.rs b/backend/supports/iam/src/basic/serv/iam_cert_phone_vcode_serv.rs index a842afce2..ef091236d 100644 --- a/backend/supports/iam/src/basic/serv/iam_cert_phone_vcode_serv.rs +++ b/backend/supports/iam/src/basic/serv/iam_cert_phone_vcode_serv.rs @@ -217,7 +217,9 @@ impl IamCertPhoneVCodeServ { pub async fn resend_activation_phone(account_id: &str, phone: &str, funs: &TardisFunsInst, ctx: &TardisContext) -> TardisResult<()> { let vcode = Self::get_vcode(); - RbumCertServ::add_vcode_to_cache(phone, &vcode, &ctx.own_paths, funs).await?; + let rel_rbum_cert_conf_id = + IamCertServ::get_cert_conf_id_by_kind(IamCertKernelKind::PhoneVCode.to_string().as_str(), Some(IamTenantServ::get_id_by_ctx(&ctx, funs)?), funs).await?; + RbumCertServ::add_vcode_to_cache(phone, &vcode, &rel_rbum_cert_conf_id, funs, &ctx).await?; Self::send_activation_phone(account_id, phone, &vcode, funs, ctx).await } @@ -282,11 +284,11 @@ impl IamCertPhoneVCodeServ { pub async fn send_bind_phone(phone: &str, funs: &TardisFunsInst, ctx: &TardisContext) -> TardisResult<()> { let ctx = IamAccountServ::new_context_if_account_is_global(ctx, funs).await?; - // let rel_rbum_cert_conf_id = - // IamCertServ::get_cert_conf_id_by_kind(IamCertKernelKind::PhoneVCode.to_string().as_str(), Some(IamTenantServ::get_id_by_ctx(&ctx, funs)?), funs).await?; + let rel_rbum_cert_conf_id = + IamCertServ::get_cert_conf_id_by_kind(IamCertKernelKind::PhoneVCode.to_string().as_str(), Some(IamTenantServ::get_id_by_ctx(&ctx, funs)?), funs).await?; // Self::check_bind_phone(phone, vec![rel_rbum_cert_conf_id], &ctx.owner.clone(), funs, &ctx).await?; let vcode = Self::get_vcode(); - RbumCertServ::add_vcode_to_cache(phone, &vcode, &ctx.own_paths, funs).await?; + RbumCertServ::add_vcode_to_cache(phone, &vcode, &rel_rbum_cert_conf_id, funs, &ctx).await?; SmsClient::send_vcode(phone, &vcode, funs, &ctx).await } @@ -432,7 +434,7 @@ impl IamCertPhoneVCodeServ { }, ak: Some(phone.to_string()), rel_rbum_kind: Some(RbumCertRelKind::Item), - rel_rbum_cert_conf_ids: Some(vec![tenant_rbum_cert_conf_id]), + rel_rbum_cert_conf_ids: Some(vec![tenant_rbum_cert_conf_id.clone()]), ..Default::default() }, funs, @@ -442,7 +444,7 @@ impl IamCertPhoneVCodeServ { > 0 { let vcode = Self::get_vcode(); - RbumCertServ::add_vcode_to_cache(phone, &vcode, &own_paths, funs).await?; + RbumCertServ::add_vcode_to_cache(phone, &vcode, &tenant_rbum_cert_conf_id, funs, &mock_ctx).await?; return SmsClient::send_vcode(phone, &vcode, funs, &mock_ctx).await; } @@ -455,7 +457,7 @@ impl IamCertPhoneVCodeServ { }, ak: Some(phone.to_string()), rel_rbum_kind: Some(RbumCertRelKind::Item), - rel_rbum_cert_conf_ids: Some(vec![global_rbum_cert_conf_id]), + rel_rbum_cert_conf_ids: Some(vec![global_rbum_cert_conf_id.clone()]), ..Default::default() }, funs, @@ -465,7 +467,17 @@ impl IamCertPhoneVCodeServ { > 0 { let vcode = Self::get_vcode(); - RbumCertServ::add_vcode_to_cache(phone, &vcode, "", funs).await?; + RbumCertServ::add_vcode_to_cache( + phone, + &vcode, + &global_rbum_cert_conf_id, + funs, + &TardisContext { + own_paths: "".to_string(), + ..Default::default() + }, + ) + .await?; return SmsClient::send_vcode(phone, &vcode, funs, &mock_ctx).await; } return Err(funs.err().not_found("iam_cert_phone_vcode", "send", "phone not find", "404-iam-cert-phone-not-exist")); diff --git a/backend/supports/iam/src/basic/serv/iam_cert_serv.rs b/backend/supports/iam/src/basic/serv/iam_cert_serv.rs index ecd3ab38c..6fca307a8 100644 --- a/backend/supports/iam/src/basic/serv/iam_cert_serv.rs +++ b/backend/supports/iam/src/basic/serv/iam_cert_serv.rs @@ -295,7 +295,6 @@ impl IamCertServ { supplier: "".to_string(), rel_rbum_cert_conf_id: kernel_cert.rel_rbum_cert_conf_id, rel_rbum_cert_conf_name: kernel_cert.rel_rbum_cert_conf_name, - rel_rbum_cert_conf_code: kernel_cert.rel_rbum_cert_conf_code, rel_rbum_kind: kernel_cert.rel_rbum_kind, rel_rbum_id: kernel_cert.rel_rbum_id, own_paths: kernel_cert.own_paths, @@ -654,7 +653,6 @@ impl IamCertServ { supplier: ext_cert.supplier, rel_rbum_cert_conf_id: ext_cert.rel_rbum_cert_conf_id, rel_rbum_cert_conf_name: ext_cert.rel_rbum_cert_conf_name, - rel_rbum_cert_conf_code: ext_cert.rel_rbum_cert_conf_code, rel_rbum_kind: ext_cert.rel_rbum_kind, rel_rbum_id: ext_cert.rel_rbum_id, own_paths: ext_cert.own_paths, @@ -706,7 +704,6 @@ impl IamCertServ { supplier: ext_cert.supplier, rel_rbum_cert_conf_id: ext_cert.rel_rbum_cert_conf_id, rel_rbum_cert_conf_name: ext_cert.rel_rbum_cert_conf_name, - rel_rbum_cert_conf_code: ext_cert.rel_rbum_cert_conf_code, rel_rbum_kind: ext_cert.rel_rbum_kind, rel_rbum_id: ext_cert.rel_rbum_id, own_paths: ext_cert.own_paths, @@ -778,7 +775,6 @@ impl IamCertServ { supplier: ext_cert.supplier, rel_rbum_cert_conf_id: ext_cert.rel_rbum_cert_conf_id, rel_rbum_cert_conf_name: ext_cert.rel_rbum_cert_conf_name, - rel_rbum_cert_conf_code: ext_cert.rel_rbum_cert_conf_code, rel_rbum_kind: ext_cert.rel_rbum_kind, rel_rbum_id: ext_cert.rel_rbum_id, own_paths: ext_cert.own_paths, @@ -988,10 +984,13 @@ impl IamCertServ { pub async fn get_cert_conf_id_and_ext_opt_by_kind_supplier( kind: &str, - supplier: &str, + mut supplier: &str, rel_iam_item_id: Option, funs: &TardisFunsInst, ) -> TardisResult> { + if kind != "Ldap" { + supplier = ""; + } RbumCertConfServ::get_rbum_cert_conf_id_and_ext_by_kind_supplier(kind, supplier, false, &funs.iam_basic_domain_iam_id(), rel_iam_item_id.unwrap_or_default().as_str(), funs) .await } diff --git a/backend/supports/iam/src/console_interface/api/iam_ci_role_api.rs b/backend/supports/iam/src/console_interface/api/iam_ci_role_api.rs index 19c1f78cc..c122f2e48 100644 --- a/backend/supports/iam/src/console_interface/api/iam_ci_role_api.rs +++ b/backend/supports/iam/src/console_interface/api/iam_ci_role_api.rs @@ -211,7 +211,7 @@ impl IamCiRoleApi { ) .await? .into_iter() - .map(|r| (r.rel_rbum_id, r.rel_rbum_cert_conf_code.unwrap_or_default(), r.ak)) + .map(|r| (r.rel_rbum_id, r.rel_rbum_cert_conf_name.unwrap_or_default(), r.ak)) .collect_vec(); let result = account_ids .iter() diff --git a/backend/supports/iam/src/console_passport/serv/iam_cp_account_serv.rs b/backend/supports/iam/src/console_passport/serv/iam_cp_account_serv.rs index 5594b02ba..a147562f8 100644 --- a/backend/supports/iam/src/console_passport/serv/iam_cp_account_serv.rs +++ b/backend/supports/iam/src/console_passport/serv/iam_cp_account_serv.rs @@ -120,7 +120,7 @@ impl IamCpAccountServ { ) .await? .into_iter() - .map(|r| (r.rel_rbum_cert_conf_code.unwrap_or_default(), r.ak)) + .map(|r| (r.rel_rbum_cert_conf_name.unwrap_or_default(), r.ak)) .collect(), exts: account_attrs .into_iter() diff --git a/backend/supports/iam/tests/test_iam_scenes_passport.rs b/backend/supports/iam/tests/test_iam_scenes_passport.rs index 32ca27a7f..9eee26dbf 100644 --- a/backend/supports/iam/tests/test_iam_scenes_passport.rs +++ b/backend/supports/iam/tests/test_iam_scenes_passport.rs @@ -191,7 +191,7 @@ pub async fn account_mgr_by_sys_admin(client: &mut BIOSWebTestClient) -> TardisR // Find Certs By Current Account let certs: Vec = client.get("/cp/cert").await; assert_eq!(certs.len(), 1); - assert!(certs.into_iter().any(|i| i.rel_rbum_cert_conf_code == Some("UserPwd".to_string()))); + assert!(certs.into_iter().any(|i| i.rel_rbum_cert_conf_name == Some("UserPwd".to_string()))); // Modify Account By Current Account let _: Void = client @@ -276,7 +276,7 @@ pub async fn account_mgr_by_tenant_account(client: &mut BIOSWebTestClient) -> Ta // Find Certs By Current Account let certs: Vec = client.get("/cp/cert").await; assert_eq!(certs.len(), 1); - assert!(certs.into_iter().any(|i| i.rel_rbum_cert_conf_code == Some("UserPwd".to_string()))); + assert!(certs.into_iter().any(|i| i.rel_rbum_cert_conf_name == Some("UserPwd".to_string()))); let _: String = client .post( @@ -408,7 +408,7 @@ pub async fn account_mgr_by_app_account(client: &mut BIOSWebTestClient) -> Tardi // Find Certs By Current Account let certs: Vec = client.get("/cp/cert").await; assert_eq!(certs.len(), 1); - assert!(certs.into_iter().any(|i| i.rel_rbum_cert_conf_code == Some("UserPwd".to_string()))); + assert!(certs.into_iter().any(|i| i.rel_rbum_cert_conf_name == Some("UserPwd".to_string()))); Ok(()) } diff --git a/backend/supports/iam/tests/test_iam_scenes_system.rs b/backend/supports/iam/tests/test_iam_scenes_system.rs index 2d391e307..37b1d2d03 100644 --- a/backend/supports/iam/tests/test_iam_scenes_system.rs +++ b/backend/supports/iam/tests/test_iam_scenes_system.rs @@ -479,7 +479,7 @@ pub async fn sys_console_account_mgr_page(client: &mut BIOSWebTestClient) -> Tar // Find Certs By Account Id let certs: Vec = client.get(&format!("/cs/cert?account_id={}", account_id)).await; assert_eq!(certs.len(), 2); - assert!(certs.into_iter().any(|i| i.rel_rbum_cert_conf_code == Some("UserPwd".to_string()))); + assert!(certs.into_iter().any(|i| i.rel_rbum_cert_conf_name == Some("UserPwd".to_string()))); // Rest Password By Account Id let _: Void = client