Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(spotify): the client-id field had nowhere to save to

Harald840f930703bd
diff --git a/jarvis/setup/wizard.py b/jarvis/setup/wizard.py
index 3a4acf3aa6..b89f223e8f 100644
--- a/jarvis/setup/wizard.py
+++ b/jarvis/setup/wizard.py
@@ -450,6 +450,29 @@ SECRETS: list[SecretSpec] = [
optional=True,
prompt=False,
),
+ # Spotify is the one family where bring-your-own-client is not the durable
+ # fix but the ONLY option: since 2026-02-11 a Development Mode app allows
+ # five authorized users, so no shipped client could serve arbitrary
+ # downloaders. The secret is genuinely unused (PKCE) and kept only so a
+ # user who pasted one is not silently ignored.
+ SecretSpec(
+ key="spotify_oauth_client_id",
+ env_fallback="SPOTIFY_OAUTH_CLIENT_ID",
+ label="Spotify OAuth Client ID",
+ help_url="https://developer.spotify.com/dashboard",
+ required_for="Marketplace plugin (Spotify) — your own OAuth client",
+ optional=True,
+ prompt=False,
+ ),
+ SecretSpec(
+ key="spotify_oauth_client_secret",
+ env_fallback="SPOTIFY_OAUTH_CLIENT_SECRET",
+ label="Spotify OAuth Client Secret (not needed — PKCE)",
+ help_url="https://developer.spotify.com/dashboard",
+ required_for="Marketplace plugin (Spotify) — your own OAuth client",
+ optional=True,
+ prompt=False,
+ ),
# UltraWiki (semantic memory mode) — app-only slots configured from the
# UltraWiki settings section, never in the first-run wizard. The Postgres
# connection string is a credential (AP-12) and rides the same chain.
diff --git a/tests/unit/marketplace/test_oauth_client_family_secrets.py b/tests/unit/marketplace/test_oauth_client_family_secrets.py
new file mode 100644
index 0000000000..061d7a2f9b
--- /dev/null
+++ b/tests/unit/marketplace/test_oauth_client_family_secrets.py
@@ -0,0 +1,49 @@
+"""BINDING CONVENTION: a catalog OAuth family owns two writable secret keys.
+
+A plugin that declares ``oauth_client_family: "<fam>"`` promises the user a
+"use your own OAuth client" box in the Plugins view. That box does nothing
+unless ``<fam>_oauth_client_id`` / ``<fam>_oauth_client_secret`` also exist as
+wizard secrets, because ``ALLOWED_SECRET_KEYS`` — the whitelist both secret
+routes enforce — is derived from exactly that list.
+
+The failure this gate exists for shipped live on 2026-08-17: the Spotify plugin
+declared the family, the dialog rendered, the user pasted a real Client ID, and
+the write came back ``404 Unknown secret key: spotify_oauth_client_id``. Nothing
+in the catalog, the connect helper, or the frontend could have caught it — the
+two halves live in different layers and only meet at runtime.
+"""
+from __future__ import annotations
+
+from jarvis.marketplace.catalog_data import load_catalog
+from jarvis.ui.web.control_routes import ALLOWED_SECRET_KEYS
+
+
+def _declared_families() -> set[str]:
+ """Every OAuth client family the catalog declares."""
+ return {
+ family
+ for plugin in load_catalog().plugins
+ if (family := getattr(plugin, "oauth_client_family", None))
+ }
+
+
+def test_every_oauth_family_has_writable_client_secrets():
+ missing: list[str] = []
+ for family in sorted(_declared_families()):
+ for suffix in ("id", "secret"):
+ key = f"{family}_oauth_client_{suffix}"
+ if key not in ALLOWED_SECRET_KEYS:
+ missing.append(key)
+
+ assert not missing, (
+ f"OAuth client families declared in the catalog with no writable secret "
+ f"key: {missing}. Add a SecretSpec for each to _WIZARD_SECRETS in "
+ f"jarvis/setup/wizard.py, or the Plugins view offers a client field that "
+ f"answers 404 when the user saves it."
+ )
+
+
+def test_spotify_family_is_wired():
+ """The regression that motivated the gate, pinned explicitly."""
+ assert "spotify_oauth_client_id" in ALLOWED_SECRET_KEYS
+ assert "spotify_oauth_client_secret" in ALLOWED_SECRET_KEYS