feat(qobuz): track lyrics endpoint with live-verified wire DTOs

Add /track/lyricsUrl (signed RPC, method name "tracklyricsUrl") plus
the CDN document fetch through the offline choke point. Wire shapes
were validated against live captures (2026-06-10) and diverge from the
inferred yaml: numeric track_id in the step-1 envelope, CDN document
wrapped in {translation_langs, publishers, writers, original}, "wsync"
word-synced discriminator instead of "lsync" (per-word timestamps),
plain lines as objects, and miss = HTTP 404 error body mapped to a
typed Ok(None) instead of an error. Unit tests deserialize fixture
excerpts of the captures; examples/lyrics_probe.rs is the read-only
live probe used for the capture.

Also expose qbz_credentials::load_oauth_token_from_file so a stale
keyring entry cannot shadow the authoritative encrypted token file.

cc
This commit is contained in:
vicrodh committed 2026-06-10 16:03:44 -06:00
1 parent 70fe3effb7
commit 46c15f507b
12 files changed
+831

No files matched your search

+12
View File
@@ -733,6 +733,18 @@ pub fn load_oauth_token() -> Result<Option<String>, String> {
}
}
load_oauth_token_from_file()
}
/// Load the OAuth token from the encrypted file ONLY, skipping the keyring.
///
/// The file is the authoritative store (`save_oauth_token` writes it first);
/// the keyring is a best-effort cache that can go stale — e.g. an entry
/// encrypted under an older key shadows a perfectly fresh file because
/// `load_oauth_token` prefers the keyring. Callers that just watched a
/// keyring-sourced token fail authentication (and diagnostic tooling) can
/// use this to read the authoritative copy directly.
pub fn load_oauth_token_from_file() -> Result<Option<String>, String> {
let path = match get_oauth_token_path() {
Some(p) => p,
None => return Ok(None),