forked from kenzuya/unshackle
feat(remote)!: make remote serve WebSocket-only and refuse older clients with CLIENT_OUTDATED
This commit is contained in:
@@ -236,8 +236,7 @@ The CORS headers expose these headers and `Retry-After` to a browser client.
|
||||
|
||||
A `--remote` client that gets a `429` with `Retry-After` shows a countdown, waits that time
|
||||
(one hour at most), and then sends the request again. It stops after 3 waits for one request.
|
||||
The keep-alive, the poll for CDM calls, the health check and the drain check do not wait: each
|
||||
tries again at its next interval.
|
||||
The health check does not wait: it tries again at its next interval.
|
||||
|
||||
!!! warning "`429` is not the `RATE_LIMITED` error body"
|
||||
`RATE_LIMITED` in [Errors](errors.md) is a *service* rate limit that a handler raises, and it
|
||||
|
||||
@@ -50,7 +50,7 @@ All are `GET`, except the two `drain` routes.
|
||||
| `/api/dashboard/status` | Version, `code_hash`, bind host and port, `mode` (`full`, `api_only`, `remote_only`), uptime, `requests_total`, `requests_rejected` (401s), `requests_by_key` (label → count), `errors` (error counts by service tag, then by `error_code`), configured service count (the same services as `/api/dashboard/services`), session count, `max_sessions` (`null` when the operator configured no limit), `session_ttl`, job counts by status. `draining` is `true` while a drain is on. The service count includes services that failed to import - use `/api/dashboard/services` for the number that loaded. |
|
||||
| `POST /api/dashboard/drain` | Starts a drain before a restart and returns the `/status` body. The server then refuses each new remote session, download job and job retry with `SERVER_DRAINING` (409). Open remote sessions and jobs continue, and each open remote session gets a warning in its service log, which the client shows to the user. Poll `/status` until `sessions` and the queued and downloading jobs are 0, then restart. The drain ends when the process stops. A second call changes nothing. |
|
||||
| `DELETE /api/dashboard/drain` | Cancels the drain and returns the `/status` body. The server accepts new work again. |
|
||||
| `/api/dashboard/sessions` | Every live remote session: `id`, `owner` (username or masked key), `creator_ip`, `service`, `title_id`, `titles`, `tracks`, `title` (the display name of the title the client is on: the last one it asked tracks for, else the first resolved title), `auth_status`, `auth_error`, `server_account` (the server profile lent to the remote session, else `null`), `server_cdm` (`false` when the client's own device licenses the remote session), `server_cdm_max_height` (the tallest video the server CDM licenses live, else `null`), `client`, `actions`, `created_at` and `last_accessed` (ISO 8601) with `created_ts` and `last_accessed_ts` (Unix epoch, the same clock as log `ts`), `age_seconds`, `idle_seconds`, `log_seq`. `client` is whatever the remote client sent as `client` in its session create request. The CLI sends `version`, `code_hash` (the commit the client runs, `null` when its source cannot be read), `platform` and `argv`. `argv` is the command line the user ran: proxy and URL userinfo, secret query parameters and credential values become `***`, home and install paths shorten as in the logs, and the line is cut at 3000 characters. An older client sends less or nothing and the field is `{}`. `log_seq` is the last sequence number in the remote session's service log - poll `/api/dashboard/sessions/{id}/logs` when it changes. `actions` is the session's request log, newest last, capped at 500: `ts`, `method`, `action` (`titles`, `tracks`, `segments`, `license`, `prompt`, …), `query`, `status`, `ms`, `bytes_in`, `bytes_out`. |
|
||||
| `/api/dashboard/sessions` | Every live remote session: `id`, `owner` (username or masked key), `creator_ip`, `service`, `title_id`, `titles`, `tracks`, `title` (the display name of the title the client is on: the last one it asked tracks for, else the first resolved title), `auth_status`, `auth_error`, `server_account` (the server profile lent to the remote session, else `null`), `server_cdm` (`false` when the client's own device licenses the remote session), `server_cdm_max_height` (the tallest video the server CDM licenses live, else `null`), `client`, `actions`, `created_at` and `last_accessed` (ISO 8601) with `created_ts` and `last_accessed_ts` (Unix epoch, the same clock as log `ts`), `age_seconds`, `idle_seconds`, `log_seq`. `client` is whatever the remote client sent as `client` in its session create request. The CLI sends `version`, `code_hash` (the commit the client runs, `null` when its source cannot be read), `platform` and `argv`. `argv` is the command line the user ran: proxy and URL userinfo, secret query parameters and credential values become `***`, home and install paths shorten as in the logs, and the line is cut at 3000 characters. An older client sends less or nothing and the field is `{}`. `log_seq` is the last sequence number in the remote session's service log - poll `/api/dashboard/sessions/{id}/logs` when it changes. `actions` is the session's request log, newest last, capped at 500: `ts`, `method`, `action` (`titles`, `tracks`, `segments`, `license`, …), `query`, `status`, `ms`, `bytes_in`, `bytes_out`. |
|
||||
| `/api/dashboard/jobs` | Every download job with full detail, regardless of owner. Empty in `--remote-only` mode. |
|
||||
| `/api/dashboard/logs` | `{"seq": N, "records": [...]}`: the last 1000 log records. `?since=<seq>` returns only newer records; `?level=WARNING` sets the minimum level; `?logger=serve` keeps one logger and its children. `ts` is a Unix epoch in seconds. |
|
||||
| `/api/dashboard/cdm-logs` | `{"seq": N, "records": [...], "sessions": [...]}`: the last 5000 calls to the Widevine and PlayReady CDM device routes, and the open sessions of each device. `?since=<seq>` returns only newer records. See [CDM calls](#cdm-calls). |
|
||||
@@ -111,12 +111,12 @@ GET /api/dashboard/sessions/{session_id}/logs?since=12
|
||||
```
|
||||
|
||||
The field name is `records`, the same one `/api/dashboard/logs` uses, so one dashboard reads
|
||||
both logs the same way. Each record has the shape the client route `/api/session/{id}/logs`
|
||||
returns. `last_seq` is the buffer's own last sequence number, so an empty page still reports
|
||||
both logs the same way. Each record has the fields of a `log` message on the remote session
|
||||
channel. `last_seq` is the buffer's own last sequence number, so an empty page still reports
|
||||
the true value.
|
||||
|
||||
Reading is a cursor read, not a drain: the client draining the same buffer still gets every
|
||||
record. It also does not refresh the remote session's idle timer, so polling a remote session here
|
||||
Reading is a cursor read, not a drain: the remote session channel still sends every record to
|
||||
the client. It also does not refresh the remote session's idle timer, so polling a remote session here
|
||||
never keeps it alive or makes it look active.
|
||||
|
||||
!!! note "`log_seq` is a poll trigger, not a push"
|
||||
|
||||
@@ -121,6 +121,7 @@ while the server restarts.
|
||||
| `FORBIDDEN` | 403 | The action is not allowed. Raised by server-side gates (per-key restrictions on CDM or credential overrides) and by remote session IP binding. |
|
||||
| `SERVER_CDM_CAPPED` | 403 | The server CDM does not license live above the `server_cdm_max_height` of the API key. `details.reason` is `server_cdm_max_height` (with `details.max_height`), `client_device`, for a remote session where the client's own device licenses, or `server_device`, for a remote session that runs on the server's device. A remote client licenses the track with its own device, except for `server_device`: then only its own vaults can supply the key. |
|
||||
| `GEOFENCE` | 403 | The title is not available in the applicable region. |
|
||||
| `CLIENT_OUTDATED` | 426 | The remote client is older than the server accepts: its create has no `session_id`, or it calls a service route of a remote session without the remote session channel. Update the client. |
|
||||
| `NOT_FOUND` | 404 | A requested resource (title, history entry, and so on) does not exist. |
|
||||
| `NO_CONTENT` | 404 | The request was valid but produced nothing: no matching titles, tracks, episodes, or keys. |
|
||||
| `JOB_NOT_FOUND` | 404 | The referenced download job does not exist. |
|
||||
|
||||
@@ -24,9 +24,6 @@ in the wire form of `unshackle/core/wire.py`. To set up `dl --remote`, read
|
||||
| `GET` | `/api/tunnel` | [The WebSocket of a `--local-proxy` tunnel](#get-apitunnel). |
|
||||
| `GET` | `/api/tunnel/check` | [The exit IP address through a tunnel](#get-apitunnelcheck). |
|
||||
| `GET` | `/api/session/{session_id}/channel` | [The remote session channel](#get-apisessionsession_idchannel): the messages the server starts, and the client's answers. |
|
||||
| `GET` | `/api/session/{session_id}/prompt` | [The login state and a waiting prompt](#get-apisessionsession_idprompt), the polling fallback of the remote session channel. |
|
||||
| `POST` | `/api/session/{session_id}/prompt` | [Answer a prompt](#post-apisessionsession_idprompt), the polling fallback. |
|
||||
| `GET` | `/api/session/{session_id}/logs` | [Service log records](#get-apisessionsession_idlogs), the polling fallback. |
|
||||
| `GET` | `/api/session/{session_id}/titles` | [The titles](#get-apisessionsession_idtitles). |
|
||||
| `POST` | `/api/session/{session_id}/tracks` | [The tracks, chapters and manifests of a title](#post-apisessionsession_idtracks). |
|
||||
| `POST` | `/api/session/{session_id}/segments` | [The URL, DRM, headers and cookies of the selected tracks](#post-apisessionsession_idsegments). |
|
||||
@@ -63,9 +60,9 @@ DELETE /api/session/{id} → the end, with the changed cache files
|
||||
`error_code` from `APIErrorCode`. The server never answers with a `5xx` status.
|
||||
- **Body size.** The create request and `POST /api/search` take a body of up to 8 MiB, the
|
||||
`samples` route up to 16 MiB, and every other route up to 1 MiB.
|
||||
- **A route that the server lacks.** A client counts an optional call (the segment filter, a bad
|
||||
content key report, the log poll) as empty only when the server answers `404` with no
|
||||
`error_code`. Any other error stops the call.
|
||||
- **Older clients.** The server accepts only the current client flow. A create without
|
||||
`session_id`, and a service route of a remote session whose client never opened the remote session
|
||||
channel, get `426 CLIENT_OUTDATED`.
|
||||
|
||||
### Slow responses
|
||||
|
||||
@@ -91,15 +88,14 @@ The login state (`AuthStatus`) tells where the login of a remote session stands:
|
||||
| `authenticated` | The login succeeded. The service routes answer. |
|
||||
| `failed` | The login failed. `error` gives the reason, and each service route answers `AUTH_FAILED`. |
|
||||
|
||||
`pending_input` is not a login state: the prompt route reports it while a prompt or a CDM call
|
||||
waits for the client. The login state stays `authenticating` during that time. Each service route
|
||||
A prompt or a CDM call that waits for the client does not change the login state: it stays
|
||||
`authenticating` during that time. Each service route
|
||||
(`titles`, `tracks`, `segments`, `segment_filter`, `samples`, `license`, `keys`, `keys/bad`) answers
|
||||
`400 INVALID_INPUT` while the login state is `authenticating`, and `401 AUTH_FAILED` after a failed
|
||||
login.
|
||||
|
||||
A prompt waits up to 600 seconds for its answer. When the time ends, the login fails. A prompt after
|
||||
the login (in the titles, tracks or licence step) goes to the client on an open remote session channel.
|
||||
Without the channel it fails at once, because the client polls for prompts only during the login.
|
||||
the login (in the titles, tracks or licence step) goes to the client on the remote session channel.
|
||||
|
||||
A CDM call goes to the client in any login state. A call that no client takes within 10 seconds fails,
|
||||
because no client listens. A call that a client took waits 60 seconds for its answer. An answer to a
|
||||
@@ -115,7 +111,7 @@ create request, for the whole remote session:
|
||||
| Server CDM | `server_cdm` | The server's device, live, up to the licence cap of the API key. The server vault answers first. |
|
||||
| Client device | `client_device` | The client's own device, through the licence relay. The service sees a stand-in for that device. With `server_vault`, the server vault answers first. |
|
||||
| Lent device | `lent_device` | Nobody licenses live: the service runs on the server's device, and the content keys come only from a vault. |
|
||||
| No device | `no_device` | No server CDM, and no client device that the service can see: the create had no `cdm_type`, or no `cdm_relay: true`. A client with a CDM licenses through the licence relay. |
|
||||
| No device | `no_device` | No server CDM, and no client device that the service can see: the create had no `cdm_type`. A client with a CDM licenses through the licence relay. |
|
||||
|
||||
The create response gives the mode in four fields, and the client reads them back:
|
||||
|
||||
@@ -126,15 +122,14 @@ The create response gives the mode in four fields, and the client reads them bac
|
||||
| `server_vault` | `false` | the grant | the grant | `false` |
|
||||
| `server_cdm_max_height` | the licence cap, or `null` | the licence cap, or `null` | the licence cap, or `null` | the licence cap, or `null` |
|
||||
|
||||
The client reads the no-device mode, and a create response without `server_cdm` and
|
||||
`server_device`, as the client-device mode.
|
||||
The client reads the no-device mode as the client-device mode.
|
||||
|
||||
The server picks the server CDM when the API key has the `server_cdm` grant for the service, unless
|
||||
the client sends `server_cdm: false` with a `cdm_type`, or `quality` asks for more than the licence
|
||||
cap with a `cdm_type`. Above the licence cap without a `cdm_type`, the server refuses the create
|
||||
with `403 SERVER_CDM_CAPPED`. A request that sets one of the service's `SERVER_DEVICE_OPTIONS` keeps the
|
||||
server CDM. Without the server CDM, a create with `cdm_type` and `cdm_relay: true` (or with a
|
||||
licence cap) gets the client-device mode, and any other create gets the no-device mode. A service
|
||||
server CDM. Without the server CDM, a create with `cdm_type` gets the client-device mode, and any other
|
||||
create gets the no-device mode. A service
|
||||
that calls `lend_server_device()` turns a client-device mode into the lent-device mode.
|
||||
|
||||
The user's view of each mode is in [Who licenses the tracks](../../guide/remote-sessions.md#who-licenses-the-tracks).
|
||||
@@ -147,8 +142,7 @@ limit, the server ends the remote session.
|
||||
|
||||
| State | When | Limit |
|
||||
|---|---|---|
|
||||
| awaited | The client gave the remote session its ID in the create request, and has sent no request and opened no remote session channel since | 150s |
|
||||
| polling | The client has had no remote session channel | The TTL rule only |
|
||||
| awaited | The client has opened no remote session channel since the create request | 150s |
|
||||
| present | The remote session channel is open | None |
|
||||
| away | The remote session channel closed with any code except 1000, the connection broke, or the server closed the channel | 180s, or half of `session_ttl` when that is more |
|
||||
| left | The client closed the remote session channel with code 1000 | 90s |
|
||||
@@ -187,7 +181,7 @@ the cache directory of the remote session. A request that waits for the remote s
|
||||
|
||||
Before a restart the operator can start a drain. A create request then gets `409 SERVER_DRAINING`,
|
||||
and the requests of open remote sessions continue. The server tells each client with the `drain`
|
||||
message of the remote session channel and the `draining` field of the info route.
|
||||
message of the remote session channel.
|
||||
|
||||
---
|
||||
|
||||
@@ -203,7 +197,7 @@ the background, and answers at once with the login state `authenticating`. The b
|
||||
|---|---|
|
||||
| `service` | Required. The service tag, in any case, or an alias. |
|
||||
| `title_id` | Required. The title ID or URL, as for `dl`. |
|
||||
| `session_id` | The ID that the client gives the remote session: the canonical text of a version 4 UUID. Without it, the server makes the ID. |
|
||||
| `session_id` | Required. The ID that the client gives the remote session: the canonical text of a version 4 UUID. Without it, the create gets `426 CLIENT_OUTDATED`. |
|
||||
| `credentials` | `{username, password, extra?}` for the profile. |
|
||||
| `cookies` | The Netscape cookie file of the profile, zlib-compressed and base64-encoded. |
|
||||
| `cache` | The cache files of the service: a map of cache key to the zlib-compressed, base64-encoded file. See [Cache files](#cache-files). |
|
||||
@@ -214,7 +208,6 @@ the background, and answers at once with the login state `authenticating`. The b
|
||||
| `proxy_region` | The country code that the client resolved `proxy` from. For a server-account service, the server matches it against its own accounts. |
|
||||
| `server_cdm` | `false` when the client declines the server CDM. |
|
||||
| `cdm_type` | The DRM system of the client's CDM (`widevine`, `playready`), or the id of a DRM plugin. |
|
||||
| `cdm_relay` | `true` when the client answers CDM calls. A plugin `cdm_type` gets no relay. |
|
||||
| `cdm_security_level`, `cdm_system_id`, `cdm_device_type` | The device facts of the client's CDM. `cdm_system_id` and `cdm_device_type` are for Widevine only. |
|
||||
| `service_config` | The identity config keys that the service lists in `client_config`, and the client's `preferences` block. At most 16384 bytes of JSON. |
|
||||
| `plugins` | The DRM plugins of the client: id to `{version, device?}`. `device` holds the plain values of the device attributes that the plugin names in `device_facts`. At most 16384 bytes of JSON. |
|
||||
@@ -226,8 +219,8 @@ the background, and answers at once with the login state `authenticating`. The b
|
||||
`session_id` lets the client delete the remote session before the create answers. A second create
|
||||
with the same ID from the same API key and IP address ends the first one if the first one has not
|
||||
answered, and replaces its remote session when the new one is stored. A second create that fails
|
||||
leaves that remote session open. A remote session with an ID from the client ends when the client
|
||||
sends no request for it and opens no remote session channel within 150 seconds of the create.
|
||||
leaves that remote session open. A remote session ends when the client opens no remote session channel within 150 seconds of the
|
||||
create.
|
||||
|
||||
`dl_params` holds `lang`, `v_lang`, `a_lang` and `s_lang` (arrays of language strings), `acodec` (an
|
||||
array of audio codec names or `dl -a` aliases such as `ddp`), and `forced_subs` and `exact_lang`
|
||||
@@ -293,6 +286,7 @@ keys from track data, and keeps the cache on the server.
|
||||
| `400` | `INVALID_SERVICE` | An unknown service, or one that the API key may not use. |
|
||||
| `403` | `FORBIDDEN` | Another API key or another IP address has the `session_id`. |
|
||||
| `404` | `SESSION_NOT_FOUND` | A `DELETE` or a newer create with the same `session_id` ended this create. |
|
||||
| `426` | `CLIENT_OUTDATED` | No `session_id`: the client is older than the server accepts. |
|
||||
| `409` | `SERVER_DRAINING` | The server drains before a restart. |
|
||||
|
||||
### `GET /api/tunnel`
|
||||
@@ -348,27 +342,26 @@ Each message is a JSON text frame with a `type` field (`ChannelMessage`):
|
||||
|---|---|---|---|
|
||||
| `prompt` | server | `id`, `prompt`, `qr` | The service asks the user for input. `qr`, when present, is the text of a QR code to draw with it. |
|
||||
| `cdm_call` | server | `id`, `call` | The service calls the client's CDM. `call` has the shape of [`cdm_call`](#cdm-calls). |
|
||||
| `log` | server | `seq`, `level`, `message`, `ts`, `qr` | One record of the service log, as the logs route gives it. `qr`, when present, is the text of a QR code to draw under the message. |
|
||||
| `log` | server | `seq`, `level`, `message`, `ts`, `qr` | One record of the service log. `qr`, when present, is the text of a QR code to draw under the message. |
|
||||
| `status` | server | `status`, `error` | The login state, on attach and at each change. |
|
||||
| `drain` | server | `draining` | The operator started or stopped a drain before a restart. |
|
||||
| `answer` | client | `id`, `response`, `error` | The answer to the `prompt` or `cdm_call` with this `id`. The answer to a CDM call is its JSON object as a string. `error` says why the client cannot answer a prompt, and the service stops at once. |
|
||||
|
||||
When the client attaches, the server first sends the log records after `since`, the drain state, the
|
||||
prompts and CDM calls that the client did not answer, and the login state. A log record can arrive
|
||||
twice after a reconnect: the client skips a `seq` it already has. Each prompt and CDM call goes to one
|
||||
path only: the remote session channel, or the prompt route.
|
||||
twice after a reconnect: the client skips a `seq` it already has. A prompt or CDM call waits on the
|
||||
server while the remote session channel is down, and goes out when the client attaches again.
|
||||
|
||||
The server closes the remote session channel with code `4404` when the remote session ends. The client then
|
||||
stops reconnecting, and its next request finds the remote session gone. The server sends a ping after
|
||||
20 seconds without data.
|
||||
|
||||
The client uses the polling fallback (the prompt and logs routes, and a keep-alive request to the info
|
||||
route at a third of `expires_in`) in these cases:
|
||||
|
||||
- A gateway in front of the server refuses the WebSocket upgrade, or the connection fails, at the
|
||||
create. The client then polls for the life of the process.
|
||||
- The remote session channel drops. The client polls until it reconnects, with a backoff from 1 to 30
|
||||
seconds.
|
||||
The client opens the remote session channel right after the create answers, and keeps it open for the
|
||||
life of the remote session. When the channel drops, the client connects again with a backoff from 1 to
|
||||
30 seconds. A refused upgrade at the start ends the run with an error that names the host and the
|
||||
status. A service route (`titles`, `tracks`, `segments`, `segment_filter`, `samples`, `license`,
|
||||
`keys` and `keys/bad`) of a remote session whose client never opened the channel gets
|
||||
`426 CLIENT_OUTDATED`.
|
||||
|
||||
| Status | Error code | Meaning |
|
||||
| --- | --- | --- |
|
||||
@@ -376,82 +369,6 @@ route at a third of `expires_in`) in these cases:
|
||||
| `403` | `FORBIDDEN` | The remote session belongs to another API key or IP address. |
|
||||
| `404` | `SESSION_NOT_FOUND` | No such remote session. |
|
||||
|
||||
### `GET /api/session/{session_id}/prompt`
|
||||
|
||||
The polling fallback of the remote session channel: the login state, and the prompt or CDM call that waits
|
||||
for the client (`PromptReply`). A client without the remote session channel polls it every 2 seconds during
|
||||
the login, and every 0.5 seconds while one of its requests runs service code, so that it takes each
|
||||
CDM call within the 10 seconds of the pickup.
|
||||
|
||||
```json
|
||||
{ "status": "authenticating" }
|
||||
{ "status": "pending_input", "prompt": "Enter code: " }
|
||||
{ "status": "pending_input", "prompt": "Scan the code, then press Enter", "qr": "https://login.example/scan" }
|
||||
{ "status": "pending_input", "prompt": "...", "cdm_call": { "op": "challenge", "drm": "widevine", "init_data": "...", "license_type": "OFFLINE", "privacy_mode": true, "service_certificate": "..." } }
|
||||
{ "status": "authenticated" }
|
||||
{ "status": "failed", "error": "Invalid credentials" }
|
||||
```
|
||||
|
||||
#### CDM calls
|
||||
|
||||
A `cdm_call` comes first, in any login state. Its `op` is `challenge`, `keys` (parse a licence and return its keys) or `close`. The
|
||||
client answers it with a JSON object in `response`: `{"session": "...", "challenge": "<base64>"}` for
|
||||
`challenge`, `{"keys": [{"kid", "type", "key", "permissions"}]}` for `keys`, `{}` for `close`, or
|
||||
`{"error": "..."}` when its CDM refuses. A `keys` answer holds only the Widevine `OPERATOR_SESSION` and
|
||||
`SIGNING` keys, never a content key, and the client refuses a PlayReady `keys` call. An answered call
|
||||
stops waiting at once, so a client that polls again at once does not get it two times.
|
||||
|
||||
| Status | Error code | Meaning |
|
||||
| --- | --- | --- |
|
||||
| `200` | - | The login state, and the waiting prompt or CDM call. |
|
||||
| `403` | `FORBIDDEN` | The remote session belongs to another API key or IP address. |
|
||||
| `404` | `SESSION_NOT_FOUND` | No such remote session. |
|
||||
|
||||
### `POST /api/session/{session_id}/prompt`
|
||||
|
||||
Answer the waiting prompt or CDM call. Body: `{ "response": "..." }` (`PromptAnswer`).
|
||||
|
||||
=== "Response `200`"
|
||||
|
||||
```json
|
||||
{ "status": "accepted" }
|
||||
```
|
||||
|
||||
| Status | Error code | Meaning |
|
||||
| --- | --- | --- |
|
||||
| `200` | - | Answer accepted. |
|
||||
| `400` | `INVALID_INPUT` | No `response`, or no prompt waits. |
|
||||
| `404` | `SESSION_NOT_FOUND` | No such remote session. |
|
||||
|
||||
### `GET /api/session/{session_id}/logs`
|
||||
|
||||
The polling fallback of the remote session channel: the records of the service's own log (`LogsReply`).
|
||||
Pass `since=<seq>` to get only the records after the last sequence number. The route answers in each
|
||||
login state, `failed` too.
|
||||
|
||||
=== "Response `200`"
|
||||
|
||||
```json
|
||||
{
|
||||
"session_id": "d4e5f6a7-...",
|
||||
"logs": [
|
||||
{ "seq": 1, "level": "INFO", "message": "Signed in as profile 'Main'", "ts": 1724990000.1 },
|
||||
{ "seq": 2, "level": "WARNING", "message": " - The service returned no streams", "ts": 1724990002.7 }
|
||||
],
|
||||
"last_seq": 2
|
||||
}
|
||||
```
|
||||
|
||||
The buffer keeps the newest 500 records. Only the logger of the service is copied: the core loggers
|
||||
stay on the server, and the HTTP requests that the server makes for the service never reach the
|
||||
client. A server-account remote session sends no log records, because the output of its login can
|
||||
carry the identity of the operator's account.
|
||||
|
||||
| Status | Error code | Meaning |
|
||||
| --- | --- | --- |
|
||||
| `200` | - | Records, oldest first (an empty list when nothing is new). |
|
||||
| `404` | `SESSION_NOT_FOUND` | No such remote session. |
|
||||
|
||||
### `GET /api/session/{session_id}/titles`
|
||||
|
||||
The titles of an authenticated remote session (`TitlesReply`), each in the wire form. A slow answer
|
||||
@@ -741,8 +658,7 @@ client never learns the server vault names.
|
||||
|
||||
### `GET /api/session/{session_id}`
|
||||
|
||||
Remote session info (`SessionInfo`). The client also uses it as the keep-alive of the polling
|
||||
fallback.
|
||||
Remote session info (`SessionInfo`).
|
||||
|
||||
=== "Response `200`"
|
||||
|
||||
@@ -751,17 +667,11 @@ fallback.
|
||||
"session_id": "d4e5f6a7-...",
|
||||
"service": "EXAMPLE",
|
||||
"valid": true,
|
||||
"expires_in": 300,
|
||||
"draining": false,
|
||||
"track_count": 4,
|
||||
"title_count": 10
|
||||
}
|
||||
```
|
||||
|
||||
`expires_in` is the configured `session_ttl`, not the seconds that remain for this remote session.
|
||||
`draining` is `true` after the operator starts a drain before a restart. The client checks it before
|
||||
each title.
|
||||
|
||||
| Status | Error code | Meaning |
|
||||
| --- | --- | --- |
|
||||
| `200` | - | Info returned. |
|
||||
|
||||
Reference in New Issue
Block a user