diff --git a/Cargo.toml b/Cargo.toml index a821adf16..65f6eae9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,9 +59,9 @@ run_script = { version = "0.10" } testcontainers-modules = { version = "0.3", features = ["redis"] } strum = { version = "0.26", features = ["derive"] } # tardis -tardis = { version = "0.1.0-rc.10" } +# tardis = { version = "0.1.0-rc.10" } # tardis = { path = "../tardis/tardis" } -# tardis = { git = "https://github.com/ideal-world/tardis.git", rev = "6312e3305c322d48b084e14c23a8de2a879a738a" } +tardis = { git = "https://github.com/ideal-world/tardis.git", rev = "191f3ec6220c6020b8183f2417cbe7a2ce38b1d9" } #spacegate # spacegate-kernel = { git = "https://github.com/ideal-world/spacegate.git", rev = "f37a81a", features = [ diff --git a/middleware/flow/src/dto/flow_state_dto.rs b/middleware/flow/src/dto/flow_state_dto.rs index 67812339f..dfaeb25f3 100644 --- a/middleware/flow/src/dto/flow_state_dto.rs +++ b/middleware/flow/src/dto/flow_state_dto.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use tardis::{ basic::field::TrimString, chrono::{DateTime, Utc}, - db::sea_orm, + db::sea_orm::{self, EnumIter}, serde_json::Value, web::poem_openapi, }; @@ -111,7 +111,7 @@ pub struct FlowStateDetailResp { pub disabled: bool, } -#[derive(Clone, Default, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, sea_orm::strum::EnumIter, sea_orm::DeriveActiveEnum)] +#[derive(Clone, Default, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, EnumIter, sea_orm::DeriveActiveEnum)] #[sea_orm(rs_type = "String", db_type = "String(Some(255))")] pub enum FlowSysStateKind { #[default] @@ -123,7 +123,7 @@ pub enum FlowSysStateKind { Finish, } -#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, sea_orm::strum::EnumIter, sea_orm::DeriveActiveEnum)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, EnumIter, sea_orm::DeriveActiveEnum)] #[sea_orm(rs_type = "String", db_type = "String(Some(255))")] pub enum FlowStateKind { #[sea_orm(string_value = "simple")] diff --git a/middleware/flow/src/dto/flow_transition_dto.rs b/middleware/flow/src/dto/flow_transition_dto.rs index 4e10b7719..8e959814b 100644 --- a/middleware/flow/src/dto/flow_transition_dto.rs +++ b/middleware/flow/src/dto/flow_transition_dto.rs @@ -2,7 +2,7 @@ use bios_basic::dto::BasicQueryCondInfo; use itertools::Itertools; use serde::{Deserialize, Serialize}; use strum::Display; -use tardis::{basic::field::TrimString, db::sea_orm, serde_json::Value, web::poem_openapi, TardisFuns}; +use tardis::{basic::field::TrimString, db::sea_orm::{self, EnumIter}, serde_json::Value, web::poem_openapi, TardisFuns}; use super::flow_var_dto::FlowVarInfo; @@ -255,7 +255,7 @@ pub struct FlowTransitionActionChangeAgg { pub state_change_info: Option, } -#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, strum::EnumIter, sea_orm::DeriveActiveEnum)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, EnumIter, sea_orm::DeriveActiveEnum)] #[sea_orm(rs_type = "String", db_type = "String(Some(255))")] pub enum FlowTransitionActionChangeKind { #[sea_orm(string_value = "var")] @@ -275,7 +275,7 @@ pub struct FlowTransitionActionByVarChangeInfo { pub changed_kind: Option, } -#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, strum::EnumIter, sea_orm::DeriveActiveEnum)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, poem_openapi::Enum, EnumIter, sea_orm::DeriveActiveEnum)] #[sea_orm(rs_type = "String", db_type = "String(Some(255))")] pub enum FlowTransitionActionByVarChangeInfoChangedKind { #[sea_orm(string_value = "clean")] diff --git a/middleware/flow/src/dto/flow_var_dto.rs b/middleware/flow/src/dto/flow_var_dto.rs index 0e10561e7..040c9adb3 100644 --- a/middleware/flow/src/dto/flow_var_dto.rs +++ b/middleware/flow/src/dto/flow_var_dto.rs @@ -1,7 +1,8 @@ use serde::{Deserialize, Serialize}; use std::str::FromStr; +use strum::Display; use tardis::{ - db::sea_orm::{self, strum::Display, DbErr, QueryResult, TryGetError, TryGetable}, + db::sea_orm::{self, DbErr, QueryResult, TryGetError, TryGetable}, serde_json::Value, web::poem_openapi, }; diff --git a/middleware/flow/src/serv/flow_rel_serv.rs b/middleware/flow/src/serv/flow_rel_serv.rs index 9b4d5420c..2f976bead 100644 --- a/middleware/flow/src/serv/flow_rel_serv.rs +++ b/middleware/flow/src/serv/flow_rel_serv.rs @@ -11,7 +11,7 @@ use bios_basic::rbum::{ }; use serde::{Deserialize, Serialize}; -use tardis::db::sea_orm::strum::Display; +use strum::Display; use tardis::{ basic::{dto::TardisContext, result::TardisResult}, chrono::{Duration, Utc}, diff --git a/support/iam/src/basic/serv/iam_cert_ldap_serv.rs b/support/iam/src/basic/serv/iam_cert_ldap_serv.rs index f73afb14f..2d6e1659b 100644 --- a/support/iam/src/basic/serv/iam_cert_ldap_serv.rs +++ b/support/iam/src/basic/serv/iam_cert_ldap_serv.rs @@ -94,8 +94,8 @@ impl IamCertLdapServ { let _ = IamLogClient::add_ctx_task( LogParamTag::IamAccount, Some(ctx.owner.clone()), - "绑定5A账号".to_string(), - Some("Bind5aAccount".to_string()), + "绑定账号".to_string(), + Some("BindAccount".to_string()), ctx, ) .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 238efbe63..744134434 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 @@ -169,7 +169,8 @@ impl IamCiAccountApi { ctx: TardisContextExtractor, request: &Request, ) -> TardisApiResult> { - add_remote_ip(request, &ctx.0).await?; + let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?; + add_remote_ip(request, &ctx).await?; let funs = iam_constants::get_tardis_inst(); let supplier = supplier.0.unwrap_or_default(); let kind = kind.0.unwrap_or_else(|| "UserPwd".to_string()); @@ -187,7 +188,7 @@ impl IamCiAccountApi { ..Default::default() }, &funs, - &ctx.0, + &ctx, ) .await? { @@ -203,7 +204,7 @@ impl IamCiAccountApi { ..Default::default() }, &funs, - &ctx.0, + &ctx, ) .await?, ) @@ -214,7 +215,7 @@ impl IamCiAccountApi { None }; - ctx.0.execute_task().await?; + ctx.execute_task().await?; TardisResp::ok(result) } 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 2cf223fe8..521c03a10 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 @@ -111,13 +111,14 @@ impl IamCiCertApi { ctx: TardisContextExtractor, request: &Request, ) -> TardisApiResult { - add_remote_ip(request, &ctx.0).await?; + let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?; + add_remote_ip(request, &ctx).await?; let funs = iam_constants::get_tardis_inst(); let supplier = supplier.0.unwrap_or_default(); let kind = kind.0.unwrap_or_else(|| "UserPwd".to_string()); let kind = if kind.is_empty() { "UserPwd".to_string() } else { kind }; - let true_tenant_id = if IamAccountServ::is_global_account(&account_id.0, &funs, &ctx.0).await? { + let true_tenant_id = if IamAccountServ::is_global_account(&account_id.0, &funs, &ctx).await? { None } else { tenant_id.0 @@ -129,8 +130,8 @@ impl IamCiCertApi { }; let ldap_dn = ldap_origin.0.unwrap_or_default(); let cert = - IamCertServ::get_cert_by_relrubmid_kind_supplier(&account_id.0, &kind, vec![supplier], conf_id, &true_tenant_id.unwrap_or_default(), ldap_dn, &funs, &ctx.0).await?; - ctx.0.execute_task().await?; + IamCertServ::get_cert_by_relrubmid_kind_supplier(&account_id.0, &kind, vec![supplier], conf_id, &true_tenant_id.unwrap_or_default(), ldap_dn, &funs, &ctx).await?; + ctx.execute_task().await?; TardisResp::ok(cert) }