Releases: snarfed/lexrpc
Releases · snarfed/lexrpc
Release list
v2.2:
Notable changes
- Schema validation:
- Fix crash (
KeyError) when validating ablobvalue inside an open union; now raisesValidationErrorfor invalid blob refs.
- Fix crash (
client:- For websocket event streams, close the websocket connection when a non-
ConnectionClosedexception is raised. - Use the lexicon method's
input.encodingas theContent-Typerequest header. Client.__init__: newrequests_sessionkwarg, an optional :class:requests.Sessionto use for HTTP requests.
- For websocket event streams, close the websocket connection when a non-
server:Server.call: unknown parameters not in the lexicon are now silently ignored instead of raisingValidationError. Background.
flask_server:- Close websocket connections with reason 1011 for unknown/not implemented endpoint NSIDs.
- Update bundled lexicons:
- Bluesky PBC's (
app.bsky.*etc) at cf4843c site.standard.*at 549453elexicon.community.*at 91c50cb
- Bluesky PBC's (
v2.1:
Notable changes
- Bundle new lexicons:
lexicon.community.*, as of 2bf2cbb.site.standard.*, from lexicon.garden, as of 2026-02-03.
- Update bundled Bluesky PBC lexicons (
app.bsky,com.atproto, etc.) as of 19ecf5f. base.load_lexicons: ignore non-lexicon files.- Schema validation:
- For the
uristring format, handle URLs with brackets (eg]) in the hostname, eghttps://example.com]. - Don't require
$typein event stream subscription payloads. - Bug fixes for unions and arrays.
- Ignore
maxGraphemeson non-string fields. - Allow
type: permission-set.
- For the
v2.0:
Breaking changes:
- For queries with non-JSON outputs,
Client.callnow returnsrequests.Responseinstead of the raw output bytes. This gives callers access to the HTTP response headers, includingContent-Type.
Non-breaking changes:
Client:- Handle non-JSON output encodings.
- Don't attempt to refresh access token when a
com.atproto.identityprocedure fails, eg when the PLC code is wrong. - Accept arbitrary
kwargsin theClientconstructor, pass them through torequests.get/post.
flask_server:init_flask: addlimit_ipskwarg for whether to allow more than one connection to event stream subscription methods per client IP.
v1.1:
Notable changes
- Schema validation:
- Validate subscription (event stream websocket) parameters and output message payloads in both
ClientandServer. - When
truncateis set, recurse into refs and arrays to truncate their string properties as necessary too. - Allow digits in NSID name (last segment) (background).
- Validate subscription (event stream websocket) parameters and output message payloads in both
Server: raiseValidationErroron unknown parameters.Don't allow#mainin$type(bluesky-social/atproto#1968).- Bug fix for open unions, allow types that aren't in
refs.
Client:- Include headers in websocket connections for event streams.
- Add new
authconstructor kwarg to support anyrequestsauth instance, egrequests_oauth2client.DPoPToken.
server:Redirect: Addheaderskwarg.
flask_server:- Interpret second positional arg to
ValueErrorandValidationError, ieerr.args[1], as a dict of additional HTTP headers to return with the HTTP 400 response.
- Interpret second positional arg to
v1.0
- Add full lexicon schema validation for records and XRPC method parameters, input, and output. Includes primitive and
objecttypes,refs andunions, string formats, type-specific constraints, etc. - Dependencies: switch from
dag-cbortolibipld, for performance. client:- Add new
decodekwarg to subscription methods to control whether DAG-CBOR messages should be decoded into native dicts for header and payload.
- Add new
flask_server: add new top-levelsubscribersattr that tracks clients connected (subscribed) to each event stream.server:- Add
statusparam toRedirect.
- Add
v0.7
Notable changes
- Fix websocket subscription server hang with blocking server XRPC methods due to exhausting worker thread pool (#8).
- Add
truncatekwarg toClientandServerconstructors to automatically truncate (ellipsize) string values that are longer than theirmaxGraphemesormaxLengthin their lexicon. Defaults toFalse. - Add new
base.XrpcErrorexception type for named errors in method definitions. flask_server:- Handle
base.XrpcError, convert to JSON error response witherrorandmessagefields.
- Handle
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/bridgy#1670)
- Bug fix: omit null (
None) parameters instead of passing them with string valueNone.
- Update bundled
app.bskyandcom.atprotolexicons, as of bluesky-social/atproto@15cc6ff37c326d5c186385037c4bfe8b60ea41b1.
v0.6:
Notable changes
- Drop
typing-extensionsversion pin now that typing-validation has been updated to be compatible with it. - Update bundled
app.bskyandcom.atprotolexicons, as of bluesky-social/atproto@f45eef3.
v0.5:
Notable changes
Client:- Support binary request data automatically based on input type, eg
dictvsbytes. - Add new
headerskwarg tocalland auto-generated lexicon method calls, useful for providing an explicitContent-Typewhen sending binary data. - Bug fix: don't infinite loop if
refreshSessionfails. - Other minor authentication bug fixes.
- Support binary request data automatically based on input type, eg
v0.4:
Notable changes
- Bundle the official lexicons for
app.bskyandcom.atproto, use them by default. Base:- Expose lexicons in
defsattribute.
- Expose lexicons in
Client:- Add minimal auth support with
access_tokenandrefresh_tokenconstructor kwargs andsessionattribute. If you use aClientto callcom.atproto.server.createSessionorcom.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/vshttp://ser.ver. - Default server address to official
https://bsky.socialPDS. - Add default
User-Agent: lexrpc (https://lexrpc.readthedocs.io/)request header.
- Add minimal auth support with
Server:- Add new
Redirectclass. 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.
- Add new
flask_server:- Return HTTP 405 error on HTTP requests to subscription (websocket) XRPCs.
- Support the new
Redirectexception. - Add the
errorfield to the JSON response bodies for most error responses.
v0.3:
Notable changes
- Add array type support.
- Add support for non-JSON input and output encodings.
- Add
subscriptionmethod type support over websockets. - Add
headerskwarg toClientconstructor. - Add new
Server.registermethod for manually registering handlers. - Bug fix for server
@methoddecorator.