spoolframe-protocol 0.16.4-beta.1

The spoolframe/client/1 wire protocol.
Documentation
//! 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`].

pub mod artwork;
pub mod codec;
pub mod device_sign_in;
pub mod downloads;
pub mod experimental;
pub mod features;
pub mod federation;
pub mod fingerprint;
mod home_view;
pub mod invite;
pub mod invite_admin;
pub mod lan;
pub mod media;
pub mod messages;
pub mod pairing;
pub mod passkeys;
mod plan_summary;
pub mod playback;
pub mod playlists;
pub mod plex;
pub mod policy;
pub mod portable;
pub mod previews;
pub mod relay_access;
pub mod resource;
pub mod rpc;
pub mod search;
mod search_view;
pub mod server_id;
pub mod streams;

#[cfg(feature = "uniffi")]
uniffi::setup_scaffolding!();

pub use artwork::{ArtworkReply, ArtworkRequest, ArtworkResponse, ArtworkSize};
pub use features::{Feature, Features};
pub use home_view::{Featured, FeaturedLimits, FeaturedRow};
pub use media::{MAX_READ, MediaRead, MediaReadReply, MediaReadResponse, PlaybackHandle};
pub use messages::{
    AddressNetwork, AuthMethod, BeginInvitePasskey, ChangePassword, ConfirmPassword, DeviceAddress,
    DeviceInfo, DeviceSignInRequest, Error, Event, Hello, HomeScreen, InviteLookupOutcome,
    LoginPassword, LookupInvite, MAX_HELLO_TEXT, ManifestKind, NextMode, PROTOCOL_VERSION,
    PinProof, PinState, PortableSignIn, PortableTie, RedeemInvite, RedeemInviteWithPasskey,
    RedeemPortableInvite, Reply, Request, RequestEnvelope, Response, SUBTITLE_CHUNK, ServerInfo,
    ServerRow, SessionId, SessionInfo, TrackPreferencesInfo, TrustedProfile, UserSummary,
    WhoAmIReply,
};
pub use passkeys::{
    FinishPasskeyRegistration, FinishPasskeySignIn, LEGACY_APP_RP_ID, MAX_NAME_CHARS, NONCE_LEN,
    PasskeyCreation, PasskeyInfo, PasskeyRegistrationBegun, PasskeyRequest, PasskeySignInBegun,
    app_passkey_challenge, fit_name, is_app_rp_id,
};
pub use plan_summary::{
    AudioSummary, PlanKind, PlanSummary, SubtitleHow, SubtitleSummary, VideoSummary,
};
pub use playback::{
    AudioAction, BitmapSubtitles, ChosenTracks, ConvertedAudio, ConvertedSubtitle, ConvertedVideo,
    PlannedAudio, PlannedSubtitle, PlaybackPlan, Quality, Rung, Selection, SubtitleAction,
    SubtitleDelivery, TrackReason,
};
pub use plex::{PlexLink, PlexSyncSummary};
pub use portable::{
    CredentialError, DevicePublicKey, InvalidDevicePublicKey, InvalidPortableUserId,
    PORTABLE_USER_ID_LEN, PortableIdentityState, PortableUserId, RevokedKey, StateError, TieProof,
    TieProofError, UserDeviceCredential, tie_message,
};
pub use previews::{PreviewTile, Previews};
pub use search::{
    Copies, SearchCounts, SearchGroup, SearchHit, SearchRequest, SearchResults, TitleCopy,
    TopResult,
};
pub use search_view::{HiddenUnder, PlayFromChoice};
pub use server_id::{APP_RP_DOMAIN, InvalidServerId, SERVER_ID_LEN, ServerId};

/// Development ALPN. Breaking revisions currently retain `/1` and require
/// a coordinated server/SDK update; [`PROTOCOL_VERSION`] identifies the revision.
pub const CLIENT_ALPN: &[u8] = b"spoolframe/client/1";

/// The ALPN of server-to-server federation, version 1:
/// [`federation`]. Experimental: a server whose
/// `experimental.federation` is off refuses it with
/// [`close::UNSUPPORTED_PROTOCOL`].
pub const FEDERATION_ALPN: &[u8] = b"spoolframe/federation/1";

/// The ALPN a device pairs with a portable identity's phone on,
/// directly, with no server: [`pairing`].
pub use pairing::PAIR_ALPN;

/// QUIC application close codes a Spoolframe peer sends, with a
/// human-readable reason beside them.
pub mod close {
    /// The ALPN is known but this peer does not serve it.
    pub const UNSUPPORTED_PROTOCOL: u32 = 1;
    /// The server holds as many connections from devices with no session
    /// as it takes. A device that is signed in is always let in;
    /// one that is not tries again later.
    pub const BUSY: u32 = 2;
    /// The device's last live session on this server ended (signed out,
    /// revoked, or its user disabled). It may connect again, as a device
    /// that is not signed in.
    pub const SIGNED_OUT: u32 = 3;
    /// Federation: the dialling server's endpoint is paired under
    /// another server id. Refused every time.
    pub const SERVER_ID_CHANGED: u32 = 4;
    /// Federation: the two servers no longer pair; the one closing
    /// revoked its side.
    pub const UNPAIRED: u32 = 5;
}