mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-25 10:25:09 +00:00
refactor(remote): keep the session protocol in core/remote_protocol.py
This commit is contained in:
@@ -12,8 +12,9 @@ reference. Each endpoint lists the specific codes it raises, and this page gives
|
||||
meanings of those codes.
|
||||
|
||||
!!! note "Where this comes from"
|
||||
`unshackle/core/api/errors.py` defines the error format, and the wrapper
|
||||
that turns raised errors into responses lives in `unshackle/core/api/routes.py`.
|
||||
`unshackle/core/api/errors.py` defines the error format, `unshackle/core/remote_protocol.py`
|
||||
defines the error codes, and the wrapper that turns raised errors into responses lives in
|
||||
`unshackle/core/api/routes.py`.
|
||||
Nothing on this page is invented. It reflects the actual server behaviour.
|
||||
|
||||
## The standard error shape
|
||||
|
||||
@@ -656,7 +656,9 @@ it before each title, so it knows of the restart before it occurs.
|
||||
### Reference client: `RemoteService`
|
||||
|
||||
Source: `unshackle/core/remote_service.py`. This is the canonical consumer of the
|
||||
remote session API and a good template for any client.
|
||||
remote session API and a good template for any client. The routes, the `AuthStatus` values,
|
||||
the error codes and the request and reply shapes that it shares with the server are in
|
||||
`unshackle/core/remote_protocol.py`.
|
||||
|
||||
- **`RemoteClient.request`** sets `X-Secret-Key` and `User-Agent: unshackle/<version>`,
|
||||
uses the server's `timeout` from `remote_services` (default 120s) as the read timeout,
|
||||
|
||||
Reference in New Issue
Block a user