Skip to content

Commit

Permalink
feat: add batch-third-party api (#793)
Browse files Browse the repository at this point in the history
* feat: add batch-third-party api

* update
  • Loading branch information
RWDai authored Jul 1, 2024
1 parent b794198 commit b2926b1
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,35 @@ impl IamCiAccountApi {
TardisResp::ok(result)
}

/// Batch Find Account By ThirdParty Cert ak
/// 通过三方凭证ak批量查找帐户
///
#[oai(path = "/batch-third-party", method = "get")]
async fn batch_by_third_party(&self, supplier: Query<String>, aks: Query<String>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<Vec<IamAccountDetailResp>> {
let funs = iam_constants::get_tardis_inst();
check_without_owner_and_unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
let mut result=vec![];
for ak in aks.0.split(','){
let cert = IamCertServ::get_3th_kind_cert_by_ak(&supplier.0, &ak, true, &funs, &ctx.0).await?;
result.push(IamAccountServ::get_item(
&cert.rel_rbum_id,
&IamAccountFilterReq {
basic: RbumBasicFilterReq {
own_paths: Some("".to_string()),
with_sub_own_paths: true,
..Default::default()
},
..Default::default()
},
&funs,
&ctx.0,
)
.await?);
}

TardisResp::ok(result)
}

/// Find App Set Items (Account) ctx
/// 查找应用集合项(帐户)上下文
#[oai(path = "/apps/item/ctx", method = "get")]
Expand Down

0 comments on commit b2926b1

Please sign in to comment.