Skip to main content

PluginManifest

Struct PluginManifest 

Source
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: String

Unique integration domain identifier (e.g. "mqtt").

§name: String

Human-readable integration name.

§version: String

SemVer-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: bool

Whether 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

Source

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

Source§

fn clone(&self) -> PluginManifest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PluginManifest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PluginManifest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PluginManifest

Source§

fn eq(&self, other: &PluginManifest) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for PluginManifest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PluginManifest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.