Skip to content

Commit

Permalink
iam:fix global account get kernel cert .
Browse files Browse the repository at this point in the history
  • Loading branch information
LiJieLong committed May 6, 2023
1 parent 2c4a062 commit 90f4cd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions support/iam/src/basic/serv/iam_cert_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,19 +212,20 @@ impl IamCertServ {
}

pub async fn get_kernel_cert(account_id: &str, rel_iam_cert_kind: &IamCertKernelKind, funs: &TardisFunsInst, ctx: &TardisContext) -> TardisResult<RbumCertSummaryWithSkResp> {
let rel_rbum_cert_conf_id = Self::get_cert_conf_id_by_kind(rel_iam_cert_kind.to_string().as_str(), rbum_scope_helper::get_max_level_id_by_context(ctx), funs).await?;
let ctx = IamAccountServ::new_context_if_account_is_global(ctx, funs).await?;
let rel_rbum_cert_conf_id = Self::get_cert_conf_id_by_kind(rel_iam_cert_kind.to_string().as_str(), Some(ctx.clone().own_paths), funs).await?;
let kernel_cert = RbumCertServ::find_one_detail_rbum(
&RbumCertFilterReq {
rel_rbum_id: Some(account_id.to_string()),
rel_rbum_cert_conf_ids: Some(vec![rel_rbum_cert_conf_id]),
..Default::default()
},
funs,
ctx,
&ctx,
)
.await?;
if let Some(kernel_cert) = kernel_cert {
let now_sk = RbumCertServ::show_sk(kernel_cert.id.as_str(), &RbumCertFilterReq::default(), funs, ctx).await?;
let now_sk = RbumCertServ::show_sk(kernel_cert.id.as_str(), &RbumCertFilterReq::default(), funs, &ctx).await?;
Ok(RbumCertSummaryWithSkResp {
id: kernel_cert.id,
ak: kernel_cert.ak,
Expand Down
2 changes: 1 addition & 1 deletion support/iam/src/iam_initializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ async fn init_basic_info<'a>(funs: &TardisFunsInst, ctx: &TardisContext) -> Tard
.iter()
.find(|r| r.code == iam_constants::RBUM_ITEM_NAME_TENANT_AUDIT_ROLE)
.map(|r| r.id.clone())
.ok_or_else(|| funs.err().not_found("iam", "init", "not found audit admin role", ""))?;
.ok_or_else(|| funs.err().not_found("iam", "init", "not found tenant audit admin role", ""))?;

let role_app_admin_id = roles
.iter()
Expand Down

0 comments on commit 90f4cd1

Please sign in to comment.