pub struct PluginManifest {Show 17 fields
pub domain: String,
pub name: String,
pub version: String,
pub documentation: Option<String>,
pub iot_class: Option<IotClass>,
pub config_flow: bool,
pub integration_type: Option<IntegrationType>,
pub dependencies: Vec<String>,
pub requirements: Vec<String>,
pub wasm_module: Option<String>,
pub wasm_module_hash: Option<String>,
pub wasm_module_sig: Option<String>,
pub publisher_key: Option<String>,
pub min_homecore_version: Option<String>,
pub host_imports_required: Vec<String>,
pub homecore_permissions: Vec<PermissionClaim>,
pub cog_id: Option<String>,
}Expand description
Parsed and validated plugin manifest.
Serialises to/from HA-compatible manifest.json. HOMECORE-only fields
are Option<…> so that a plain HA manifest is a valid (native-only)
HOMECORE manifest.
Fields§
§domain: StringUnique integration domain identifier (e.g. "mqtt").
name: StringHuman-readable integration name.
version: StringSemVer-ish version string (HA uses calendar-versioning, e.g. "2025.1.0").
documentation: Option<String>Optional documentation URL.
iot_class: Option<IotClass>HA iot_class — how the integration communicates with the device.
config_flow: boolWhether this integration ships a UI config flow.
integration_type: Option<IntegrationType>HOMECORE integration type (optional, defaults to Integration).
dependencies: Vec<String>Intra-HOMECORE dependencies (other plugin domains this one requires).
requirements: Vec<String>External package requirements — kept for schema compat, ignored in HOMECORE (WASM modules carry their own static deps, no pip).
wasm_module: Option<String>[HOMECORE] Relative path to the .wasm binary (absent for native plugins).
wasm_module_hash: Option<String>[HOMECORE] sha256:<hex> hash of the wasm binary.
(P4 — ENFORCED, ADR-162): verify::verify_module computes the
SHA-256 of the real .wasm bytes on load and rejects the module if
it does not equal this hash (tamper detection). See crate::verify.
wasm_module_sig: Option<String>[HOMECORE] Ed25519 signature of the wasm binary hash (ed25519:<base64>).
(P4 — ENFORCED, ADR-162): verified against publisher_key over
the SHA-256 module digest before instantiation. A bad/forged/absent
signature is rejected under the secure trust policy (the
cog-ha-matter::witness_signing Ed25519 pattern is reused).
publisher_key: Option<String>[HOMECORE] Ed25519 public key of the plugin publisher.
(P4 — ENFORCED, ADR-162): used to verify wasm_module_sig, and
checked against the host’s crate::verify::PluginPolicy trust
allowlist — an unknown publisher is rejected by the secure default.
min_homecore_version: Option<String>[HOMECORE] Minimum HOMECORE version required by this plugin.
host_imports_required: Vec<String>[HOMECORE] Subset of host functions the WASM module imports.
homecore_permissions: Vec<PermissionClaim>[HOMECORE] Coarse-grained permission claims (glob patterns).
(P5 — ENFORCED, ADR-162): state:write:<glob> (or a bare entity
glob like light.*) grants are parsed into a
crate::permissions::PermissionSet and consulted by the
hc_state_set host import. A plugin can no longer write an entity it
did not declare; a plugin with no write grants can write nothing.
cog_id: Option<String>[HOMECORE] Seed app registry cog ID for distribution.
Implementations§
Source§impl PluginManifest
impl PluginManifest
Sourcepub fn parse_json(s: &str) -> Result<Self, PluginError>
pub fn parse_json(s: &str) -> Result<Self, PluginError>
Parse a manifest.json JSON string and validate required fields.
Required fields: domain, name, version.
Trait Implementations§
Source§impl Clone for PluginManifest
impl Clone for PluginManifest
Source§fn clone(&self) -> PluginManifest
fn clone(&self) -> PluginManifest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more