Expand description
Decentralized GitHub Releases install — building block for
nexo plugin install <owner>/<repo>@<tag>.
Architecture: there is NO central catalog. Each plugin
author publishes their plugin as a GitHub Release on their
own repo, following the asset naming convention documented
in nexo-plugin-contract.md. The install CLI hits the
GitHub Releases API directly to resolve a coords string into
a verified tarball.
What this crate does:
- Parse
<owner>/<repo>@<tag>coords - Fetch the GitHub release JSON (or
/releases/latest) - Parse the release into an
nexo_ext_registry::ExtEntryusing the asset naming convention - Download the tarball matching the daemon’s target
- Stream-verify the sha256 (read from the
.sha256asset)
Cosign signature verification lives in verify, tarball
extraction in extract; the CLI wires them together.
§References
- Internal:
crates/ext-registry/— entry types. - GitHub Releases API:
https://docs.github.com/en/rest/releases/releases#get-a-release-by-tag-name - Real-world:
cargo binstall+gh extension install— per-repo binary install via GitHub Releases.
Re-exports§
pub use error::InstallError;pub use extract::extract_verified_tarball;pub use extract::ExtractInput;pub use extract::ExtractLimits;pub use extract::ExtractedPlugin;pub use extract::MAX_ENTRIES;pub use extract::MAX_ENTRY_BYTES;pub use extract::MAX_EXTRACTED_BYTES;pub use extract::MAX_TARBALL_BYTES;pub use extract_contract::ExtractContract;pub use extract_contract::PluginExtractContract;pub use extract_error::ExtractError;pub use trusted_keys::AuthorPolicy;pub use trusted_keys::TrustMode;pub use trusted_keys::TrustedKeysConfig;pub use verify::discover_cosign_binary;pub use verify::verify_plugin_signature;pub use verify::VerifiedSignature;pub use verify::VerifyInput;pub use verify_error::VerifyError;
Modules§
- error
- Error variants returned by the installer.
- extract
- Extract a sha-verified plugin tarball into the daemon’s plugin discovery directory.
- extract_
contract - Parameterized extraction contract — lets the resolve+download
pipeline serve any source-of-truth manifest, not just
nexo-plugin.toml. The same crate powers bothnexo plugin installandnexo persona installwithout two parallel copies of the GitHub Releases plumbing. - extract_
error - Error variants returned by
crate::extract::extract_verified_tarball. - trusted_
keys - Operator-side trust policy loaded from
<config_dir>/extensions/trusted_keys.toml. - verify
- Pure-Rust signature verification for plugin tarballs.
- verify_
error - Error variants returned by the cosign signature verification pipeline.
Structs§
- Installed
Tarball - Successful install — verified tarball on disk.
- Repo
Coords - Parsed
<owner>/<repo>@<tag>coordinates.tagdefaults tolatestwhen the user omits it. - Resolved
Install - Successful resolution of a release into an installable
entry. Carries enough info to call
download_and_verify. - Resolved
Release Typed - Generic resolve result carrying the typed manifest produced
by an
ExtractContract. Contracts are free to attach any in-process meaning tomanifest; the resolver only stores it. URL/size/signing fields are pre-resolved so the caller can calldownload_and_verify_urlwithout re-querying the release JSON.
Constants§
- DEFAULT_
GITHUB_ API_ BASE - Default GitHub API base URL. Override via the
NEXO_GITHUB_API_BASEenv or in tests with a wiremock URL.
Functions§
- current_
target_ triple - Detect the running daemon’s target triple. Override via
NEXO_INSTALL_TARGETenv. - download_
and_ verify - Download the resolved tarball, fetch the expected sha256
from its
.sha256sibling, stream-verify the downloaded bytes’ digest matches. Aborts and removes the partial file if the digest doesn’t match. Thin wrapper overdownload_and_verify_url. - download_
and_ verify_ url - URL-based download+verify primitive. Fetches the expected
sha256 from
sha256_url, streams the tarball fromtarball_urltodest_path, and rejects on mismatch (cleaning up the partial file). Returns the byte count. - install_
plugin - One-shot helper: parse coords, fetch release, resolve, download, verify. Equivalent to chaining the lower-level functions but matches typical CLI usage.
- resolve_
release - Resolve a plugin’s release into a downloadable entry. Thin
adapter over
resolve_release_with_contractusingPluginExtractContract; preserved for backward compat with all existing callers (src/plugin_install.rs,src/plugin_admin.rs). - resolve_
release_ with_ contract - Resolve a release into a downloadable entry parameterized
by an
ExtractContract. The contract decides which manifest asset to fetch and how to parse it; everything else (semver from tag, tarball naming with<id>-<version>- <target>.tar.gzshape,noarchfallback, sha256 sibling lookup, cosign material) is shared across all contracts.
Type Aliases§
- Plugin
Coords Deprecated - Legacy alias preserved so existing callers
(
src/plugin_install.rs,src/plugin_admin.rs) keep compiling while downstream migrations land. PreferRepoCoordsin new code.