Skip to main content

Crate leptoskit_codepush

Crate leptoskit_codepush 

Source
Expand description

leptoskit codepush uses it to pack and publish, leptoskit_axum serves it, and leptoskit_wasm consumes it on the device. It is the React Native update model applied to the interface bundle.

The app shell ships with a wasm bundle through the store; every later change ships as a release on a channel. A release is a BundleManifest describing content-hashed, gzip-compressed files packed into a single .lkb container. Clients check in with their current version and receive either an up-to-date verdict or a download plan — full bundle, or a binary Delta against the container they already run. Files are compressed in chunks that come out the same whenever their input does, so a delta carries only the chunks an update changed, and the store keeps one only when it is at most three quarters of the full bundle.

Releases live in a static layout: immutable, content-addressed files plus one index.json per channel naming the newest release. Any static file server, object store, or CDN can host a channel, and publish::publish_channel uploads one to a publish::Bucket with the index written last; publish::pull_channel seeds a store from one. leptoskit codepush serve serves the same files.

Every release is signed by its publisher, and a client stages only releases signed by a key in its TrustedKeys that are newer than what it runs, so a compromised registry can neither ship its own code nor roll a device back to an older release.

A host can also require source approvals: independent rebuilders who built the bundle from a public repository@commit, got the same files, and signed to say so. With a ProvenancePolicy, a client stages and launches only releases that enough of those approvers vouch for, so a publisher key alone can no longer ship code that was not built from public source.

ReleaseSigningKey and TrustedKeys cover signing and verification, and semver::Version names every release, so a deployment needs neither crate as a dependency of its own: both are re-exported as ed25519_dalek and semver, at the versions this crate was built against.

Re-exports§

pub use client::CodePushClient;
pub use client::FileTransport;
pub use client::SyncReport;
pub use client::Transport;
pub use client::UpdateOffer;
pub use client::UpdatePlan;
pub use delta::Delta;
pub use delta::DeltaOp;
pub use delta::apply_delta;
pub use delta::create_delta;
pub use layout::ChannelIndex;
pub use layout::ObjectKey;
pub use layout::ObjectKind;
pub use layout::StaticObject;
pub use manifest::BundleFile;
pub use manifest::BundleManifest;
pub use manifest::bundle_directory;
pub use manifest::bundle_directory_as;
pub use manifest::hash_bytes;
pub use manifest::read_container;
pub use provenance::ProvenanceConfiguration;
pub use provenance::ProvenancePolicy;
pub use provenance::ReleaseApprovals;
pub use provenance::SignedApproval;
pub use provenance::SourceApproval;
pub use provenance::VerifiedSource;
pub use publish::Bucket;
pub use publish::PublishReport;
pub use publish::PullReport;
pub use publish::publish_channel;
pub use publish::pull_channel;
pub use signing::ReleasePublicKey;
pub use signing::ReleaseSignature;
pub use signing::ReleaseSigningKey;
pub use signing::TrustedKeys;
pub use store::AttachedApprovals;
pub use store::IngestedRelease;
pub use store::ReleaseRecord;
pub use store::ReleaseStore;
pub use store::StoreError;
pub use ed25519_dalek;
pub use semver;

Modules§

client
The updater client: check, verify, download (full or delta), verify, stage.
delta
Binary deltas between bundle versions.
dev
Development guests: how leptoskit dev reloads native apps.
installed
Durable native bundle selection. A downloaded release is a trial until the host confirms its first attached frame. Use one owner on a serialized worker per directory; no UI/interpreter pointer belongs on that worker.
layout
The static registry layout: where every release file lives, so that any file server, object store, or CDN can host a channel without running code.
manifest
Release manifests and the .lkb bundle container.
provenance
Source approvals: who says a release was built from public source, not just who shipped it.
publish
Publishing a channel from a ReleaseStore to a bucket, so an object store behind a CDN can be the registry with no server running.
signing
Publisher signatures: who released a bundle, not just whether it arrived intact.
store
The publisher-side release store: versioned releases on channels, with on-ingest deltas against the previous release, kept in the static crate::layout so the store directory can be hosted as is.

Enums§

CodePushError
Errors raised across the code push crates.