diff --git a/middleware/flow/src/api/ci/flow_ci_inst_api.rs b/middleware/flow/src/api/ci/flow_ci_inst_api.rs index 12814fb95..da869ddcd 100644 --- a/middleware/flow/src/api/ci/flow_ci_inst_api.rs +++ b/middleware/flow/src/api/ci/flow_ci_inst_api.rs @@ -23,7 +23,7 @@ impl FlowCiInstApi { #[oai(path = "/", method = "post")] async fn start(&self, add_req: Json, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; funs.begin().await?; let result = FlowInstServ::start(&add_req.0, None, &funs, &ctx.0).await?; funs.commit().await?; @@ -34,7 +34,7 @@ impl FlowCiInstApi { #[oai(path = "/:flow_inst_id", method = "get")] async fn get(&self, flow_inst_id: Path, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let result = FlowInstServ::get(&flow_inst_id.0, &funs, &ctx.0).await?; TardisResp::ok(result) } @@ -48,7 +48,7 @@ impl FlowCiInstApi { request: &Request, ) -> TardisApiResult> { let funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let result = FlowInstServ::find_state_and_next_transitions(&find_req.0, &funs, &ctx.0).await?; TardisResp::ok(result) } @@ -57,7 +57,7 @@ impl FlowCiInstApi { #[oai(path = "/:flow_inst_id", method = "put")] async fn abort(&self, flow_inst_id: Path, abort_req: Json, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; funs.begin().await?; FlowInstServ::abort(&flow_inst_id.0, &abort_req.0, &funs, &ctx.0).await?; funs.commit().await?; @@ -74,7 +74,7 @@ impl FlowCiInstApi { request: &Request, ) -> TardisApiResult { let mut funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let mut transfer = transfer_req.0; FlowInstServ::check_transfer_vars(&flow_inst_id.0, &mut transfer, &funs, &ctx.0).await?; funs.begin().await?; @@ -93,7 +93,7 @@ impl FlowCiInstApi { request: &Request, ) -> TardisApiResult> { let mut funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let mut result = vec![]; let flow_inst_ids: Vec<_> = flow_inst_ids.split(',').collect(); let raw_transfer_req = transfer_req.0; @@ -121,7 +121,7 @@ impl FlowCiInstApi { request: &Request, ) -> TardisApiResult { let mut funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; funs.begin().await?; FlowInstServ::modify_assigned(&flow_inst_id.0, &modify_req.0.current_assigned, &funs, &ctx.0).await?; funs.commit().await?; @@ -138,7 +138,7 @@ impl FlowCiInstApi { request: &Request, ) -> TardisApiResult { let mut funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; funs.begin().await?; FlowInstServ::modify_current_vars(&flow_inst_id.0, &modify_req.0.vars, &funs, &ctx.0).await?; funs.commit().await?; @@ -149,7 +149,7 @@ impl FlowCiInstApi { #[oai(path = "/bind", method = "post")] async fn bind(&self, add_req: Json, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let inst_id = FlowInstServ::get_inst_ids_by_rel_business_obj_id(vec![add_req.0.rel_business_obj_id.clone()], &funs, &ctx.0).await?.pop(); let result = if let Some(inst_id) = inst_id { inst_id @@ -177,7 +177,7 @@ impl FlowCiInstApi { #[oai(path = "/batch_bind", method = "post")] async fn batch_bind(&self, add_req: Json, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult> { let mut funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; funs.begin().await?; let result = FlowInstServ::batch_bind(&add_req.0, &funs, &ctx.0).await?; funs.commit().await?; @@ -188,7 +188,7 @@ impl FlowCiInstApi { #[oai(path = "/find_detail_by_obj_ids", method = "get")] async fn find_detail_by_obj_ids(&self, obj_ids: Query, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult> { let funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let rel_business_obj_ids: Vec<_> = obj_ids.0.split(',').map(|id| id.to_string()).collect(); let inst_ids = FlowInstServ::get_inst_ids_by_rel_business_obj_id(rel_business_obj_ids, &funs, &ctx.0).await?; let mut result = vec![]; diff --git a/middleware/flow/src/api/ci/flow_ci_model_api.rs b/middleware/flow/src/api/ci/flow_ci_model_api.rs index 13b1b4e6b..bfc38b331 100644 --- a/middleware/flow/src/api/ci/flow_ci_model_api.rs +++ b/middleware/flow/src/api/ci/flow_ci_model_api.rs @@ -27,7 +27,7 @@ impl FlowCiModelApi { request: &Request, ) -> TardisApiResult { let funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let model_id = FlowModelServ::find_one_item( &FlowModelFilterReq { basic: RbumBasicFilterReq { @@ -59,7 +59,7 @@ impl FlowCiModelApi { request: &Request, ) -> TardisApiResult> { let funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let result = FlowModelServ::find_rel_states(tag.0.split(',').collect(), rel_template_id.0, &funs, &ctx.0).await?; TardisResp::ok(result) @@ -74,7 +74,7 @@ impl FlowCiModelApi { request: &Request, ) -> TardisApiResult> { let mut funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; funs.begin().await?; let proj_template_id = req.0.proj_template_id.unwrap_or_default(); let mut result = vec![]; diff --git a/middleware/flow/src/api/ci/flow_ci_state_api.rs b/middleware/flow/src/api/ci/flow_ci_state_api.rs index b1ebc9853..1eaf97682 100644 --- a/middleware/flow/src/api/ci/flow_ci_state_api.rs +++ b/middleware/flow/src/api/ci/flow_ci_state_api.rs @@ -40,7 +40,7 @@ impl FlowCiStateApi { request: &Request, ) -> TardisApiResult> { let funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let (scope_level, with_sub_own_paths) = if let Some(is_global) = is_global.0 { if is_global { @@ -92,7 +92,7 @@ impl FlowCiStateApi { request: &Request, ) -> TardisApiResult> { let mut funs = flow_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; funs.begin().await?; let result = FlowStateServ::count_group_by_state(&req.0, &funs, &ctx.0).await?; funs.commit().await?; diff --git a/support/iam/src/console_interface/api/iam_ci_account_api.rs b/support/iam/src/console_interface/api/iam_ci_account_api.rs index 2cc6a0cc0..0061adb60 100644 --- a/support/iam/src/console_interface/api/iam_ci_account_api.rs +++ b/support/iam/src/console_interface/api/iam_ci_account_api.rs @@ -52,7 +52,7 @@ impl IamCiAccountApi { request: &Request, ) -> TardisApiResult> { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?; add_remote_ip(request, &ctx).await?; let rel = role_ids.0.map(|role_ids| { @@ -127,7 +127,7 @@ impl IamCiAccountApi { #[oai(path = "/:id/ctx", method = "get")] async fn get_account_context(&self, id: Path, app_id: Query>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; let mut ctx_resp = IamIdentCacheServ::get_account_context(&id.0, &app_id.0.unwrap_or((&"").to_string()), &funs).await?; ctx_resp.own_paths = ctx.0.own_paths; @@ -138,7 +138,7 @@ impl IamCiAccountApi { #[oai(path = "/:id", method = "get")] async fn get(&self, id: Path, tenant_id: Query>, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0)?; add_remote_ip(request, &ctx).await?; let result = IamAccountServ::get_account_detail_aggs( @@ -174,7 +174,7 @@ impl IamCiAccountApi { request: &Request, ) -> TardisApiResult> { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?; add_remote_ip(request, &ctx).await?; let supplier = supplier.0.unwrap_or_default(); @@ -234,7 +234,7 @@ impl IamCiAccountApi { request: &Request, ) -> TardisApiResult> { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?; add_remote_ip(request, &ctx).await?; let set_id = IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Apps, &funs, &ctx).await?; @@ -301,7 +301,7 @@ impl IamCiAccountApi { request: &Request, ) -> TardisApiResult> { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?; add_remote_ip(request, &ctx).await?; let set_id = IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Apps, &funs, &ctx).await?; diff --git a/support/iam/src/console_interface/api/iam_ci_app_api.rs b/support/iam/src/console_interface/api/iam_ci_app_api.rs index 85994041e..9ffd438a2 100644 --- a/support/iam/src/console_interface/api/iam_ci_app_api.rs +++ b/support/iam/src/console_interface/api/iam_ci_app_api.rs @@ -33,7 +33,7 @@ impl IamCiAppApi { #[oai(path = "/", method = "post")] async fn add(&self, add_req: Json, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; funs.begin().await?; let result = IamAppServ::add_app_agg(&add_req.0, &funs, &ctx.0).await?; @@ -48,7 +48,7 @@ impl IamCiAppApi { #[oai(path = "/", method = "put")] async fn modify(&self, modify_req: Json, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult> { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; funs.begin().await?; @@ -72,7 +72,7 @@ impl IamCiAppApi { request: &Request, ) -> TardisApiResult> { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?; add_remote_ip(request, &ctx).await?; let set_id = IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Apps, &funs, &ctx).await?; @@ -139,7 +139,7 @@ impl IamCiAppApi { request: &Request, ) -> TardisApiResult> { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?; add_remote_ip(request, &ctx).await?; let set_id = IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Apps, &funs, &ctx).await?; diff --git a/support/iam/src/console_interface/api/iam_ci_app_set_api.rs b/support/iam/src/console_interface/api/iam_ci_app_set_api.rs index e3a0afa3e..738ec41f6 100644 --- a/support/iam/src/console_interface/api/iam_ci_app_set_api.rs +++ b/support/iam/src/console_interface/api/iam_ci_app_set_api.rs @@ -34,7 +34,7 @@ impl IamCiAppSetApi { request: &Request, ) -> TardisApiResult> { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?; add_remote_ip(request, &ctx).await?; let set_id = IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Apps, &funs, &ctx).await?; diff --git a/support/iam/src/console_interface/api/iam_ci_cert_api.rs b/support/iam/src/console_interface/api/iam_ci_cert_api.rs index 9c9a1d84a..e90bd0ef3 100644 --- a/support/iam/src/console_interface/api/iam_ci_cert_api.rs +++ b/support/iam/src/console_interface/api/iam_ci_cert_api.rs @@ -40,7 +40,7 @@ impl IamCiCertManageApi { #[oai(path = "/aksk", method = "post")] async fn add_aksk(&self, add_req: Json, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, Some(add_req.tenant_id.clone()))?; add_remote_ip(request, &ctx).await?; funs.begin().await?; @@ -53,7 +53,7 @@ impl IamCiCertManageApi { #[oai(path = "/aksk", method = "delete")] async fn delete_aksk(&self, id: Query, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; funs.begin().await?; IamCiCertAkSkServ::delete_cert(&id.0, &funs, &ctx.0).await?; @@ -82,7 +82,7 @@ impl IamCiCertApi { #[oai(path = "/get/:id", method = "get")] async fn get_cert_by_id(&self, id: Path, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; let ak = RbumCertServ::find_one_detail_rbum( &RbumCertFilterReq { @@ -117,7 +117,7 @@ impl IamCiCertApi { request: &Request, ) -> TardisApiResult { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?; add_remote_ip(request, &ctx).await?; let supplier = supplier.0.unwrap_or_default(); @@ -151,7 +151,7 @@ impl IamCiCertApi { request: &Request, ) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; funs.begin().await?; IamCertServ::add_3th_kind_cert(&mut add_req.0, &account_id.0, &funs, &ctx.0).await?; @@ -170,7 +170,7 @@ impl IamCiCertApi { request: &Request, ) -> TardisApiResult { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; let rbum_cert = IamCertServ::get_3th_kind_cert_by_rel_rubm_id(&account_id.0, vec![supplier.0], &funs, &ctx.0).await?; ctx.0.execute_task().await?; @@ -183,7 +183,7 @@ impl IamCiCertApi { #[oai(path = "/sync", method = "get")] async fn third_integration_sync(&self, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; let msg = IamCertServ::third_integration_sync_without_config(&funs, &ctx.0).await?; ctx.0.execute_task().await?; @@ -194,7 +194,7 @@ impl IamCiCertApi { #[oai(path = "/decode", method = "post")] async fn decode_certs(&self, body: Json, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult> { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?; add_remote_ip(request, &ctx).await?; funs.begin().await?; @@ -233,7 +233,7 @@ impl IamCiLdapCertApi { request: &Request, ) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?; add_remote_ip(request, &ctx).await?; funs.begin().await?; diff --git a/support/iam/src/console_interface/api/iam_ci_open_api.rs b/support/iam/src/console_interface/api/iam_ci_open_api.rs index fd2584296..c5ac90317 100644 --- a/support/iam/src/console_interface/api/iam_ci_open_api.rs +++ b/support/iam/src/console_interface/api/iam_ci_open_api.rs @@ -24,7 +24,7 @@ impl IamCiOpenApi { #[oai(path = "/add_product", method = "post")] async fn add_product(&self, add_req: Json, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; funs.begin().await?; IamOpenServ::add_product(&add_req.0, &funs, &ctx.0).await?; @@ -43,7 +43,7 @@ impl IamCiOpenApi { request: &Request, ) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; funs.begin().await?; IamOpenServ::bind_cert_product_and_spec(&id.0, &bind_req.0, &funs, &ctx.0).await?; @@ -56,7 +56,7 @@ impl IamCiOpenApi { #[oai(path = "/aksk", method = "post")] async fn add_aksk(&self, add_req: Json, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, Some(add_req.tenant_id.clone()))?; add_remote_ip(request, &ctx).await?; funs.begin().await?; @@ -70,7 +70,7 @@ impl IamCiOpenApi { #[oai(path = "/", method = "get")] async fn get_rule_info(&self, cert_id: Query, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; funs.begin().await?; let result = IamOpenServ::get_rule_info(cert_id.0, &funs, &ctx.0).await?; diff --git a/support/iam/src/console_interface/api/iam_ci_res_api.rs b/support/iam/src/console_interface/api/iam_ci_res_api.rs index bfbc5f6bb..e97883f84 100644 --- a/support/iam/src/console_interface/api/iam_ci_res_api.rs +++ b/support/iam/src/console_interface/api/iam_ci_res_api.rs @@ -25,7 +25,7 @@ impl IamCiResApi { #[oai(path = "/", method = "post")] async fn add(&self, mut add_req: Json, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; funs.begin().await?; let set_id = IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Res, &funs, &ctx.0).await?; @@ -39,7 +39,7 @@ impl IamCiResApi { #[oai(path = "/cate", method = "post")] async fn add_cate(&self, add_req: Json, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; funs.begin().await?; let set_cate_sys_code_node_len = funs.rbum_conf_set_cate_sys_code_node_len(); diff --git a/support/iam/src/console_interface/api/iam_ci_role_api.rs b/support/iam/src/console_interface/api/iam_ci_role_api.rs index 5ac91fbf0..0200a9260 100644 --- a/support/iam/src/console_interface/api/iam_ci_role_api.rs +++ b/support/iam/src/console_interface/api/iam_ci_role_api.rs @@ -31,7 +31,7 @@ impl IamCiRoleApi { #[oai(path = "/verify/tenant/admin", method = "get")] async fn get_verify_role_tenant_admin(&self, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; let mut verify_tenant_admin = false; for role in &ctx.0.roles { @@ -46,7 +46,7 @@ impl IamCiRoleApi { #[oai(path = "/:id/account/batch/:account_ids", method = "put")] async fn batch_add_rel_account(&self, id: Path, account_ids: Path, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; funs.begin().await?; let app_id = IamAppServ::get_id_by_ctx(&ctx.0, &funs)?; @@ -64,7 +64,7 @@ impl IamCiRoleApi { #[oai(path = "/:id/account/batch/:account_ids", method = "delete")] async fn batch_delete_rel_account(&self, id: Path, account_ids: Path, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; funs.begin().await?; let split = account_ids.0.split(',').collect::>(); @@ -80,7 +80,7 @@ impl IamCiRoleApi { #[oai(path = "/:id/account/:account_id", method = "delete")] async fn delete_rel_account(&self, id: Path, account_id: Path, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; funs.begin().await?; IamRoleServ::delete_rel_account(&id.0, &account_id.0, Some(RBUM_SCOPE_LEVEL_APP), &funs, &ctx.0).await?; @@ -100,7 +100,7 @@ impl IamCiRoleApi { request: &Request, ) -> TardisApiResult> { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; let ctx = ctx.0; let ctx_clone = ctx.clone(); @@ -144,7 +144,7 @@ impl IamCiRoleApi { request: &Request, ) -> TardisApiResult { let mut funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; let ctx = ctx.0; funs.begin().await?; @@ -165,7 +165,7 @@ impl IamCiRoleApi { #[oai(path = "/:role_code/accounts", method = "get")] async fn get_rel_accounts(&self, role_code: Path, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult> { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; let role_id = RbumItemServ::find_one_rbum( &RbumBasicFilterReq { @@ -226,7 +226,7 @@ impl IamCiRoleApi { request: &Request, ) -> TardisApiResult> { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamCertServ::try_use_app_ctx(ctx.0, app_id.0)?; add_remote_ip(request, &ctx).await?; let result = IamRoleServ::paginate_items( diff --git a/support/iam/src/console_interface/api/iam_ci_system_api.rs b/support/iam/src/console_interface/api/iam_ci_system_api.rs index 0b6f85e15..f55eba4ac 100644 --- a/support/iam/src/console_interface/api/iam_ci_system_api.rs +++ b/support/iam/src/console_interface/api/iam_ci_system_api.rs @@ -35,7 +35,7 @@ impl IamCiSystemApi { #[oai(path = "/task/execute", method = "put")] async fn execute_task_external(&self, cache_key: Query, task_id: Query, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let task_id = TaskProcessor::execute_task_external( &cache_key.0, task_id.0, @@ -51,7 +51,7 @@ impl IamCiSystemApi { #[oai(path = "/task/execute/stop/:task_ids", method = "delete")] async fn stop_task_external(&self, cache_key: Query, task_ids: Path, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let task_ids = task_ids.0.split(','); for task_id in task_ids { let task_id = task_id.parse().map_err(|_| funs.err().format_error("system", "task", "task id format error", "406-iam-task-id-format"))?; @@ -78,7 +78,7 @@ impl IamCiSystemApi { request: &Request, ) -> TardisApiResult { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; TaskProcessor::set_task_process_data( &cache_key.0, task_id.0, @@ -95,7 +95,7 @@ impl IamCiSystemApi { #[oai(path = "/task/process/:task_id", method = "get")] async fn get_task_process_data(&self, cache_key: Query, task_id: Path, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let data = TaskProcessor::get_task_process_data(&cache_key.0, task_id.0, &funs).await?; TardisResp::ok(data) } diff --git a/support/iam/src/console_interface/api/iam_ci_tenant_api.rs b/support/iam/src/console_interface/api/iam_ci_tenant_api.rs index 9411ee169..f9c59da52 100644 --- a/support/iam/src/console_interface/api/iam_ci_tenant_api.rs +++ b/support/iam/src/console_interface/api/iam_ci_tenant_api.rs @@ -38,7 +38,7 @@ impl IamCiTenantApi { #[oai(path = "/", method = "get")] async fn get(&self, mut ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; add_remote_ip(request, &ctx.0).await?; let result = IamTenantServ::get_tenant_agg(&IamTenantServ::get_id_by_ctx(&ctx.0, &funs)?, &IamTenantFilterReq::default(), &funs, &ctx.0).await?; ctx.0.execute_task().await?; @@ -58,7 +58,7 @@ impl IamCiTenantApi { request: &Request, ) -> TardisApiResult> { let funs = iam_constants::get_tardis_inst(); - unsafe_fill_ctx(request, &funs, &mut ctx.0).await?; + unsafe_fill_ctx(request, &funs, &mut ctx.0)?; let ctx = IamSetServ::try_get_rel_ctx_by_set_id(set_id.0, &funs, ctx.0).await?; add_remote_ip(request, &ctx).await?; let set_id = IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Org, &funs, &ctx).await?;