Skip to content

Commit

Permalink
iam:fix search.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljl committed Jan 22, 2024
1 parent c852d3a commit 0634748
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
20 changes: 18 additions & 2 deletions support/iam/src/basic/serv/iam_set_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,15 @@ impl IamSetServ {

if kind == IamSetKind::Apps.to_string() && result.is_ok() {
SpiKvClient::add_or_modify_key_name(
&format!("{}:{}", funs.conf::<IamConfig>().spi.kv_tenant_prefix.clone(), result.clone().unwrap()),
&format!("{}:{}", funs.conf::<IamConfig>().spi.kv_apps_prefix.clone(), result.clone().unwrap()),
&add_req.name,
funs,
ctx,
)
.await?;
} else if kind == IamSetKind::Org.to_string() && result.is_ok() {
SpiKvClient::add_or_modify_key_name(
&format!("{}:{}", funs.conf::<IamConfig>().spi.kv_orgs_prefix.clone(), result.clone().unwrap()),
&add_req.name,
funs,
ctx,
Expand Down Expand Up @@ -253,7 +261,15 @@ impl IamSetServ {
let mut kind = item.kind;
if kind == IamSetKind::Apps.to_string() {
SpiKvClient::add_or_modify_key_name(
&format!("{}:{}", funs.conf::<IamConfig>().spi.kv_tenant_prefix.clone(), &set_cate_id),
&format!("{}:{}", funs.conf::<IamConfig>().spi.kv_apps_prefix.clone(), &set_cate_id.clone()),
&set_cate_item.name.clone(),
funs,
ctx,
)
.await?;
} else if kind == IamSetKind::Org.to_string() && result.is_ok() {
SpiKvClient::add_or_modify_key_name(
&format!("{}:{}", funs.conf::<IamConfig>().spi.kv_orgs_prefix.clone(), &set_cate_id),
&set_cate_item.name.clone(),
funs,
ctx,
Expand Down
3 changes: 2 additions & 1 deletion support/iam/src/console_tenant/api/iam_ct_org_api.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use bios_basic::rbum::dto::rbum_filer_dto::{RbumRelFilterReq, RbumSetTreeFilterReq};
use bios_basic::rbum::dto::rbum_filer_dto::{RbumRelFilterReq, RbumSetCateFilterReq, RbumSetTreeFilterReq};
use bios_basic::rbum::dto::rbum_set_dto::RbumSetTreeResp;
use bios_basic::rbum::serv::rbum_set_serv::RbumSetCateServ;
use tardis::basic::dto::TardisContext;
use tardis::web::context_extractor::TardisContextExtractor;
use tardis::web::poem_openapi;
Expand Down
4 changes: 4 additions & 0 deletions support/iam/src/iam_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ pub struct IamSpiConfig {
pub kv_tenant_prefix: String,
pub kv_account_prefix: String,
pub kv_app_prefix: String,
pub kv_apps_prefix: String,
pub kv_orgs_prefix: String,

pub owner: String,
}
Expand All @@ -117,6 +119,8 @@ impl Default for IamSpiConfig {
kv_tenant_prefix: "iam_tenant".to_string(),
kv_account_prefix: "iam_account".to_string(),
kv_app_prefix: "iam_app".to_string(),
kv_apps_prefix: "iam_apps".to_string(),
kv_orgs_prefix: "iam_orgs".to_string(),
owner: "".to_string(),
}
}
Expand Down

0 comments on commit 0634748

Please sign in to comment.