The client half of the host's new `os=` advert, shared once in pf-client-core: `sanitize_os` (mDNS is unauthenticated input — lowercase `[a-z0-9._-]` tokens, capped) and `os_icon_tokens`, the most-specific-first walk with the brand aliases (`macos`→apple, `steamos`→steam) every platform resolves through. `DiscoveredHost` carries the chain, `KnownHost` persists it (`serde(default)`, elided when empty — older stores load unchanged and older clients read back exactly what they wrote), `upsert` moves it only when carried, and `learn_os` mirrors `learn_mac` — no-op, no disk write when unchanged — so the mark survives the host going to sleep. GTK shells: the card's status row leads with a recolorable symbolic glyph. That needed real embedded assets — the shells had none — so `data/` gains the ten `pf-os-*-symbolic` SVGs compiled into a gresource (new build.rs, glib-build-tools) and registered on the icon theme at startup; the Adwaita theme then tints them like every other status glyph. WinUI shell: reactor renders raster-from-URI only, so the embedded mid-gray PNGs (legible on both themes) materialize once into %LOCALAPPDATA%\punktfunk\os-icons\ — the library's poster-art pattern — and the tile's status row leads with a 16px image. The couch UI plumbs `HostRow.os` (live advert preferred, else the store) for a Skia glyph that is a declared follow-up; `--list-hosts` / `hosts --json` emit the stored chain so the Decky plugin can read it. A host that advertises no `os` renders everywhere exactly as it did before the field existed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
14 lines
718 B
Rust
14 lines
718 B
Rust
//! Client identity, the known-hosts (pinned fingerprint) store, and app settings —
|
|
//! re-exported from `pf-client-core` so the shell and the spawned `punktfunk-session`
|
|
//! binary share ONE `Settings`/`KnownHosts` shape over the same files
|
|
//! (`%APPDATA%\punktfunk\client-windows-settings.json` / `client-known-hosts.json`).
|
|
//!
|
|
//! The shell is the settings file's only writer; the session only reads it. The shell's
|
|
//! former private `Settings` copy (≤ 0.8.4: `show_hud`, `engine`) is gone — old files
|
|
//! still load via a serde alias in core.
|
|
|
|
pub use pf_client_core::trust::{
|
|
hex, learn_mac, learn_os, load_or_create_identity, pair_error_message, parse_hex32, KnownHost,
|
|
KnownHosts, Settings,
|
|
};
|