AgentBlueprintProtocol.Compatibility (Agent Blueprint Protocol v1.1.0)

Copy Markdown View Source

This module compares manifest build identities with identities observed by a host.

Use it when checking whether a Deployment matches an environment report.

This module does not authorize operations.

Example

{:ok, deployment} =
  AgentBlueprintProtocol.Deployment.decode(
    File.read!(Application.app_dir(:agent_blueprint_protocol, "priv/examples/echo-deployment.json"))
  )
observed = %AgentBlueprintProtocol.Compatibility.Observed{identities: []}
match?({:error, %AgentBlueprintProtocol.Error{}}, AgentBlueprintProtocol.Compatibility.verify(deployment, observed))

Summary

Functions

Reports whether a version spelling identifies one exact version.

Compares a Deployment’s build identities with those reported by a host.

Functions

exact?(identity)

(since 1.0.0)
@spec exact?(term()) :: boolean()

Reports whether a version spelling identifies one exact version.

Example

AgentBlueprintProtocol.Compatibility.exact?(%{
  kind: "package",
  name: "example.package",
  version: "1.2.3",
  digest: "sha-256:example"
})

verify(deployment, arg2)

(since 1.0.0)

Compares a Deployment’s build identities with those reported by a host.

Example

{:ok, deployment} =
  AgentBlueprintProtocol.Deployment.decode(
    File.read!(Application.app_dir(:agent_blueprint_protocol, "priv/examples/echo-deployment.json"))
  )

observed = %AgentBlueprintProtocol.Compatibility.Observed{identities: []}
match?({:error, %AgentBlueprintProtocol.Error{}}, AgentBlueprintProtocol.Compatibility.verify(deployment, observed))