feat(remote): send the client's services.<TAG>.preferences to the server in every licensing mode

This commit is contained in:
imSp4rky
2026-12-04 14:27:48 -07:00
parent 6d04d19239
commit 89b3e77d18
11 changed files with 286 additions and 19 deletions
+24 -2
View File
@@ -376,7 +376,7 @@ licence at all: each content key comes from the server vault or the client's own
and a content key that no vault holds stops the download with an error that names its KID,
when the client knows it. The create response sets `server_device` to `true` for such a
remote session. The service then uses the server's own config: the client's identity
values do not apply. The client reads the
values do not apply, but its preferences do (see [Your preferences](#your-preferences)). The client reads the
server vault only when the API key has the `server_vault` grant (or `server_cdm`); without
it, the client reads only its own vaults. The login tokens of such a remote session hold the
server's device identity, so the server keeps them: `DELETE` returns no cache files, and the
@@ -388,6 +388,27 @@ HTTP session headers and `track.data` lose their secret-looking keys, as for a s
vault first. A track that no server vault holds goes back to your device. See
[`server_vault`](../../reference/configuration/services.md).
### Your preferences
The `preferences` block of a service is the place for user choices, such as a metadata
language or a subtitle format. It is not an identity, so it crosses `--remote` in every
licensing mode, whatever CDM the client has, and no service declares anything for it:
- The client sends each entry of its own `services: <TAG>: preferences:` block in
`unshackle.yaml` that is a string, a number or a boolean. It leaves out other entries and
logs one debug line for each.
- The server merges the entries key by key over its own `preferences` block for that
service. An entry that the client sends replaces the server's value, and a config key that
the client does not send keeps the server's value. The entries never count as an identity,
and they stay when the service builds the remote session on the server's device.
- The server refuses a `preferences` value that is not an object of strings, numbers and
booleans with `INVALID_INPUT`.
A service reads its preferences from `self.config["preferences"]`, locally and over
`--remote` alike. Keep a value that changes the server's account (a profile, an account
type) out of `preferences` unless every client of the server may choose it: a server
account is shared, and the service can store the choice in its cache.
---
## Remote session lifecycle and expiry
@@ -497,7 +518,8 @@ session when the new one is stored, and the server answers the ID of another API
`no_proxy`, `profile`, `cache` (a map of `filename → base64(zlib(bytes))`),
`client_region`, `server_cdm` (`false` when the user picked the local CDM), `cdm_type`, `cdm_security_level`, `cdm_relay` (`true` when the client
answers CDM calls; a plugin `cdm_type` gets no relay), `cdm_system_id` and `cdm_device_type` (Widevine only), `service_config`
(the identity config keys the service lists in `client_config`), `plugins` (the version of each DRM plugin of the
(the identity config keys the service lists in `client_config`, and the client's
[preferences](#your-preferences)), `plugins` (the version of each DRM plugin of the
client and the values of the plugin device attributes that the plugin names in `device_facts`; see
[endpoints](endpoints.md#post-apisessioncreate)), `client` (a freeform identity
object the dashboard shows as sent), and the track-selection hints `range_`, `vcodec`,