Skip to main content

Crate spoolframe_protocol

Crate spoolframe_protocol 

Source
Expand description

The spoolframe/client/1 wire protocol: messages, framing and ALPN names.

Permissively licensed (MIT OR Apache-2.0); it is the boundary that proprietary clients talk across, so it never depends on an AGPL crate.

One connection carries many QUIC streams (streams). Every message is a length-prefixed CBOR frame (codec); the messages are in messages.

Re-exports§

pub use artwork::ArtworkReply;
pub use artwork::ArtworkRequest;
pub use artwork::ArtworkResponse;
pub use artwork::ArtworkSize;
pub use media::MAX_READ;
pub use media::MediaRead;
pub use media::MediaReadReply;
pub use media::MediaReadResponse;
pub use media::PlaybackHandle;
pub use messages::AddressNetwork;
pub use messages::AuthMethod;
pub use messages::ChangePassword;
pub use messages::ConfirmPassword;
pub use messages::DeviceAddress;
pub use messages::DeviceInfo;
pub use messages::DeviceSignInRequest;
pub use messages::Error;
pub use messages::Event;
pub use messages::Hello;
pub use messages::HomeScreen;
pub use messages::InviteLookupOutcome;
pub use messages::LoginPassword;
pub use messages::LookupInvite;
pub use messages::MAX_HELLO_TEXT;
pub use messages::ManifestKind;
pub use messages::PROTOCOL_VERSION;
pub use messages::PinProof;
pub use messages::PinState;
pub use messages::PortableSignIn;
pub use messages::PortableTie;
pub use messages::RedeemInvite;
pub use messages::RedeemPortableInvite;
pub use messages::Reply;
pub use messages::Request;
pub use messages::RequestEnvelope;
pub use messages::Response;
pub use messages::SUBTITLE_CHUNK;
pub use messages::ServerInfo;
pub use messages::ServerRow;
pub use messages::SessionId;
pub use messages::SessionInfo;
pub use messages::TrackPreferencesInfo;
pub use messages::TrustedProfile;
pub use messages::UserSummary;
pub use messages::WhoAmIReply;
pub use passkeys::FinishPasskeyRegistration;
pub use passkeys::FinishPasskeySignIn;
pub use passkeys::LEGACY_APP_RP_ID;
pub use passkeys::NONCE_LEN;
pub use passkeys::PasskeyCreation;
pub use passkeys::PasskeyInfo;
pub use passkeys::PasskeyRegistrationBegun;
pub use passkeys::PasskeyRequest;
pub use passkeys::PasskeySignInBegun;
pub use passkeys::app_passkey_challenge;
pub use passkeys::is_app_rp_id;
pub use playback::AudioAction;
pub use playback::BitmapSubtitles;
pub use playback::ChosenTracks;
pub use playback::ConvertedAudio;
pub use playback::ConvertedSubtitle;
pub use playback::ConvertedVideo;
pub use playback::PlannedAudio;
pub use playback::PlannedSubtitle;
pub use playback::PlaybackPlan;
pub use playback::Quality;
pub use playback::Rung;
pub use playback::Selection;
pub use playback::SubtitleAction;
pub use playback::SubtitleDelivery;
pub use playback::TrackReason;
pub use plex::PlexSyncSummary;
pub use portable::CredentialError;
pub use portable::DevicePublicKey;
pub use portable::InvalidDevicePublicKey;
pub use portable::InvalidPortableUserId;
pub use portable::PORTABLE_USER_ID_LEN;
pub use portable::PortableIdentityState;
pub use portable::PortableUserId;
pub use portable::RevokedKey;
pub use portable::StateError;
pub use portable::TieProof;
pub use portable::TieProofError;
pub use portable::UserDeviceCredential;
pub use portable::tie_message;
pub use previews::PreviewTile;
pub use previews::Previews;
pub use search::Copies;
pub use search::SearchCounts;
pub use search::SearchGroup;
pub use search::SearchHit;
pub use search::SearchRequest;
pub use search::SearchResults;
pub use search::TitleCopy;
pub use search::TopResult;
pub use server_id::InvalidServerId;
pub use server_id::SERVER_ID_LEN;
pub use server_id::ServerId;
pub use pairing::PAIR_ALPN;

Modules§

artwork
Artwork over a resource stream (crate::streams::bi::RESOURCE).
close
QUIC application close codes a Spoolframe peer sends, with a human-readable reason beside them.
codec
Frames: a big-endian u32 length, then that many bytes of CBOR.
device_sign_in
Signing a device in by approving it on another: the code a TV shows, and the link its QR code carries.
downloads
Downloads for offline viewing (feature spoolframe:downloads): the messages of crate::Request::DownloadOptions, crate::Request::PrepareDownload, crate::Request::DownloadStatus, crate::Request::CancelDownload and crate::Request::SyncOfflineWatch, the crate::Event::DownloadChanged event, and the crate::resource::ResourceRequest::Download read.
experimental
Experimental features: messages a client and server use only when both said so in Hello.
federation
Server-to-server federation on spoolframe/federation/1: pairing two servers, and replicating what one shares with the other (SyncLibrary and the rest).
fingerprint
A server key’s fingerprint: a short code a person can compare between the server’s terminal and a client’s screen before the client pins the key.
invite
Invites: the link that finds a server from anywhere, and the code in it that lets someone make their own account there.
invite_admin
Making and managing invites from an app: the client protocol’s admin requests CreateInvite, ListInvites and RevokeInvite. These are the same invites, with the same limits, as the web UI makes; the web UI and the apps see each other’s.
lan
How a server announces itself on the LAN.
media
Playing media: playback sessions and range reads.
messages
The messages of spoolframe/client/1.
pairing
Pairing a device with a portable identity: the link a device shows as a QR code, and the frames the identity’s phone and the device then exchange over a direct Iroh connection on PAIR_ALPN. No Spoolframe server takes part.
passkeys
Passkeys in the apps, each server through a relying party of its own under spoolframe.app: ServerId::rp_id.
playback
Playback plans: how the server would play an item for this client, given what it can decode and which tracks it picked.
playlists
Playlists (feature spoolframe:playlists): ordered lists of movies, episodes and tracks a user makes, shares, pins and plays.
plex
The session user’s Plex account link, as clients may read it. Linking and unlinking are the web UI’s (<web_url>/profile): a client only shows the state, and never sees the account’s token.
policy
Request retry semantics and wait budgets shared by clients and servers. These do not change message encoding or protocol negotiation.
portable
A portable user’s identity: the public half of a root signing key the user owns, not an account any server hosts; and what that root signs: a credential for each of the user’s devices, and the state that revokes them; and the proof that ties a local account to the identity.
previews
Frame previews for scrubbing: Request::GetPreviews and its reply.
relay_access
Who a relay of the server’s own lets through.
resource
One metadata frame followed by exactly length raw bytes for every binary resource. Playback revisions are independent of encoder epochs.
rpc
The RPC stream of spoolframe/client/1. Every request goes in this wrapper: a peer that does not know it fails to decode the request, so it never loses the wrapper’s guarantees without notice.
search
Scoped, grouped search: Request::Search and its reply.
server_id
A server’s id: its name for app passkeys, apart from its key.
streams
What each QUIC stream on a connection is for. The first byte on a stream says.

Constants§

APP_RP_DOMAIN
The domain every server’s app passkeys are made under: a server’s relying party is <server id>.spoolframe.app. Every client and the admin API use this one value.
CLIENT_ALPN
Development ALPN. Breaking revisions currently retain /1 and require a coordinated server/SDK update; PROTOCOL_VERSION identifies the revision.
FEDERATION_ALPN
The ALPN of server-to-server federation, version 1: federation. Experimental: a server whose experimental.federation is off refuses it with close::UNSUPPORTED_PROTOCOL.