Lexrpc

Latest version: v1.0

Safety actively analyzes 681775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.0

* Add full [lexicon schema validation](https://atproto.com/specs/lexicon) for records and XRPC method parameters, input, and output. Includes primitive and `object` types, `ref`s and `union`s, string formats, type-specific constraints, etc.
* Dependencies: switch from `dag-cbor` to `libipld`, for performance.
* `client`:
* Add new `decode` kwarg to subscription methods to control whether DAG-CBOR messages should be decoded into native dicts for header and payload.
* `flask_server`: add new top-level `subscribers` attr that tracks clients connected (subscribed) to each event stream.
* `server`:
* Add `status` param to `Redirect`.

0.7

Notable changes

* Fix websocket subscription server hang with blocking server XRPC methods due to exhausting worker thread pool ([8](https://github.com/snarfed/lexrpc/issues/8)).
* Add `truncate` kwarg to `Client` and `Server` constructors to automatically truncate (ellipsize) string values that are longer than their ``maxGraphemes`` or ``maxLength`` in their lexicon. Defaults to `False`.
* Add new `base.XrpcError` exception type for named errors in method definitions.
* `flask_server`:
* Handle `base.XrpcError`, convert to [JSON error response](https://atproto.com/specs/xrpc#error-responses) with `error` and `message` fields.
* `Client`:
* Bug fix for calls with binary inputs that refresh the access token. Calls with binary input now buffer the entire input in memory. ([snarfed/bridgy1670](https://github.com/snarfed/bridgy/issues/1670))
* Bug fix: omit null (`None`) parameters instead of passing them with string value `None`.
* Update bundled `app.bsky` and `com.atproto` lexicons, as of [bluesky-social/atproto15cc6ff37c326d5c186385037c4bfe8b60ea41b1](https://github.com/bluesky-social/atproto/commit/15cc6ff37c326d5c186385037c4bfe8b60ea41b1).

0.6

Notable changes

* Drop `typing-extensions` version pin now that [typing-validation has been updated to be compatible with it](https://github.com/hashberg-io/typing-validation/issues/1).
* Update bundled `app.bsky` and `com.atproto` lexicons, as of [bluesky-social/atprotof45eef3](https://github.com/bluesky-social/atproto/commit/f45eef3414f8827ba3a6958a7040c7e38bfd6282).

0.5

Notable changes

* `Client`:
* Support binary request data automatically based on input type, eg `dict` vs `bytes`.
* Add new `headers` kwarg to `call` and auto-generated lexicon method calls, useful for providing an explicit `Content-Type` when sending binary data.
* Bug fix: don't infinite loop if `refreshSession` fails.
* Other minor authentication bug fixes.

0.4

Notable changes

* Bundle [the official lexicons](https://github.com/bluesky-social/atproto/tree/main/lexicons/) for `app.bsky` and `com.atproto`, use them by default.
* `Base`:
* Expose lexicons in `defs` attribute.
* `Client`:
* Add minimal auth support with `access_token` and `refresh_token` constructor kwargs and `session` attribute. If you use a `Client` to call `com.atproto.server.createSession` or `com.atproto.server.refreshSession`, the returned tokens will be automatically stored and used in future requests.
* Bug fix: handle trailing slash on server address, eg `http://ser.ver/` vs `http://ser.ver`.
* Default server address to official `https://bsky.social` PDS.
* Add default `User-Agent: lexrpc (https://lexrpc.readthedocs.io/)` request header.
* `Server`:
* Add new `Redirect` class. Handlers can raise this to indicate that the web server should serve an HTTP redirect. [Whether this is official supported by the XRPC spec is still TBD.](https://github.com/bluesky-social/atproto/discussions/1228)
* `flask_server`:
* Return HTTP 405 error on HTTP requests to subscription (websocket) XRPCs.
* Support the new `Redirect` exception.
* Add the `error` field to the JSON response bodies for most error responses.

0.3

Notable changes

* Add array type support.
* Add support for non-JSON input and output encodings.
* Add `subscription` method type support over websockets.
* Add `headers` kwarg to `Client` constructor.
* Add new `Server.register` method for manually registering handlers.
* Bug fix for server `method` decorator.

Page 1 of 2

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.