canic_host/deployment_truth/model/plan/
mod.rs1use super::artifact::RoleArtifactV1;
2use super::inventory::{
3 ExpectedCanisterV1, ExpectedPoolCanisterV1, VerifierReadinessExpectationV1,
4};
5use serde::{Deserialize, Serialize};
6
7#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
11pub struct DeploymentPlanV1 {
12 pub schema_version: u32,
13 pub plan_id: String,
14 pub deployment_identity: DeploymentIdentityV1,
15 pub trust_domain: TrustDomainV1,
16 pub fleet_template: String,
17 pub runtime_variant: String,
18 pub authority_profile: AuthorityProfileV1,
19 pub role_artifacts: Vec<RoleArtifactV1>,
20 pub expected_canisters: Vec<ExpectedCanisterV1>,
21 pub expected_pool: Vec<ExpectedPoolCanisterV1>,
22 pub expected_verifier_readiness: VerifierReadinessExpectationV1,
23 pub unresolved_assumptions: Vec<DeploymentAssumptionV1>,
24}
25
26#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
30pub struct DeploymentIdentityV1 {
31 pub deployment_name: String,
32 pub network: String,
33 pub root_principal: Option<String>,
34 pub authority_profile_hash: Option<String>,
35 pub role_topology_hash: Option<String>,
36 pub deployment_manifest_digest: Option<String>,
37 pub canonical_runtime_config_digest: Option<String>,
38 pub role_embedded_config_set_digest: Option<String>,
39 pub artifact_set_digest: Option<String>,
40 pub pool_identity_set_digest: Option<String>,
41 pub canic_version: Option<String>,
42 pub ic_memory_version: Option<String>,
43}
44
45#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
49pub struct TrustDomainV1 {
50 pub root_trust_anchor: Option<String>,
51 pub migration_from: Option<String>,
52}
53
54#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
58pub struct AuthorityProfileV1 {
59 pub profile_id: String,
60 pub expected_controllers: Vec<String>,
61 pub staging_controllers: Vec<String>,
62 pub emergency_controllers: Vec<String>,
63}
64
65#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
69pub struct DeploymentAssumptionV1 {
70 pub key: String,
71 pub description: String,
72}
73
74impl DeploymentAssumptionV1 {
75 #[must_use]
76 pub fn has_kind(&self, kind: DeploymentAssumptionKindV1) -> bool {
77 self.key == kind.key()
78 }
79}
80
81#[derive(Clone, Copy, Debug, Eq, PartialEq)]
88pub enum DeploymentAssumptionKindV1 {
89 LocalStateMissing,
90 LocalStateNetworkMismatch,
91 LocalStateReadFailed,
92}
93
94impl DeploymentAssumptionKindV1 {
95 #[must_use]
96 pub const fn key(self) -> &'static str {
97 match self {
98 Self::LocalStateMissing => "local_state.root_canister_id.missing",
99 Self::LocalStateNetworkMismatch => "local_state.root_canister_id.network_mismatch",
100 Self::LocalStateReadFailed => "local_state.root_canister_id.read_failed",
101 }
102 }
103}