confium_registry/lib.rs
1#![allow(rustdoc::broken_intra_doc_links)]
2#![allow(rustdoc::bare_urls)]
3#![allow(rustdoc::redundant_explicit_links)]
4#![allow(rustdoc::private_intra_doc_links)]
5#![allow(rustdoc::invalid_html_tags)]
6
7//! Client for the Confium plugin registry.
8//!
9//! The registry is a static-site catalog hosted at `registry.confium.org`
10//! (GitHub Pages). This client fetches the index, verifies publisher
11//! signatures, downloads plugin artifacts, and stages them for the Engine
12//! to load.
13//!
14//! See `TODO.roadmap/06-module-registry.md` for the registry design,
15//! including URL structure, manifest schema, trust model, and publishing
16//! flow.
17//!
18//! # Crate layout
19//!
20//! - [`client`] — the [`Client`] that resolves plugin metadata from the
21//! static site. The transport is pluggable via the [`Fetcher`] trait so
22//! tests (and offline mirrors) can inject content without a network.
23//! - [`manifest`] — typed mirrors of the TOML documents served by the
24//! registry (`index.toml`, per-plugin `index.toml`, `manifest.toml`,
25//! `trust-roots.toml`).
26//! - [`install`] — install an artifact to the local plugin directory,
27//! resolving versions and (once signature verification ships) checking
28//! the trust policy.
29//! - [`trust`] — the [`TrustStore`] that persists the user's trusted
30//! publishers under `~/.config/confium/trust/`.
31//! - [`verify`] — cryptographic ([`verify::verify_signature`]) and
32//! policy ([`verify::check`]) layers for PGP signature verification.
33//! The crypto layer prefers in-process RNP via `libloading` and falls
34//! back to `gpg --verify` when `librnp` isn't available.
35
36pub mod client;
37pub mod error;
38pub mod install;
39pub mod manifest;
40pub mod paths;
41pub mod trust;
42pub mod verify;
43
44pub use client::{Client, Fetcher, MemoryFetcher};
45pub use error::{Error, Result};
46pub use install::{InstalledRecord, install};
47pub use manifest::{
48 AlgorithmMap, Artifact, ConfiumMeta, IndexEntry, Manifest, PluginIndex, TrustRoot,
49 TrustRootsFile, VersionEntry,
50};
51pub use paths::{config_dir, plugin_install_dir, plugins_dir, trust_dir};
52pub use trust::{TrustStore, TrustStoreEntry};
53pub use verify::{Verification, verify_signature};
54
55/// The default registry base URL.
56///
57/// Mirrors the canonical endpoint documented in
58/// `TODO.roadmap/06-module-registry.md`. Callers can override this when
59/// constructing a [`Client`] (e.g. for a mirror).
60pub const DEFAULT_REGISTRY_URL: &str = "https://registry.confium.org";