Skip to content

v3.1:

Latest

Choose a tag to compare

@snarfed snarfed released this 18 Oct 22:06
· 7 commits to main since this release
c90923b

Notable changes

  • Add service proxying in new xrpc_proxy module. Pass xrpc_proxy.handler to lexrpc's new flask_server.init_flask fallback kwarg to proxy methods you don't implement using service auth. Includes read-after-write for the user's own new posts, profile, likes, and reposts in a number of app.bsky.* methods.
  • Add com.atproto.identity.resolveHandle in new xrpc_identity module.
  • Add app.bsky.actor.getPreferences and putPreferences stubs in new xrpc_actor module.
  • Add new permissions module for parsing, checking, and describing OAuth permission scopes. Supports repo and rpc resources and atproto and transition:generic scopes.
  • server:
    • Allow records with missing or unknown lexicons, ie pass lexrpc's new require_lexicons=False.
    • Add new authenticate global function which clients can override to authenticate requests. It returns a (DID, OAuth scopes) tuple. The default implementation, global_token_auth, checks $REPO_TOKEN and returns (ALL_REPOS, ALL_SCOPES).
    • Add new authorize function, which checks whether the current request is allowed to do one or more writes.
  • xrpc_repo:
    • Implement applyWrites. All writes are committed atomically, in a single commit.
    • createRecord, putRecord, deleteRecord, applyWrites: enforce repo OAuth scopes. importRepo: require the $REPO_TOKEN global token, since we don't support the account:repo scope yet.
    • describeRepo: return the collections actually in the repo, even if SUPPORTED_COLLECTIONS is set. (#87)
    • createRecord, getRecord, deleteRecord, putRecord: enforce SUPPORTED_COLLECTIONS env var if set.
    • getRecord: remove fallback to AppView for records not found locally.
    • getRecord: raise named RecordNotFound error..
    • getRecord, listRecords: return native CIDs and bytes instead of ATProto-flavored JSON. lexrpc's flask_server now encodes them.
  • xrpc_sync:
    • subscribeRepos: add missing required tooBig field to emitted events.
    • getRecord: raise named RecordNotFound error..
  • storage:
    • Storage: add read_writes_since.
  • util:
    • Move Action here from storage and Write here from repo. storage.Action and repo.Write are kept as aliases.
  • datastore_storage:
    • DatastoreStorage.read_blocks_by_seq: fix bug where an abandoned generator, eg from a disconnected subscribeRepos client, could clobber an unrelated thread's ndb context.
    • AtpRemoteBlob:
      • Bump video limits up to 300MB and 10 minutes.
      • get_or_create: add content and mime_type kwargs, for creating blobs from contents we already have, without fetching them.
      • Add set_content.
      • Add remote_id property.
  • did
    • plc_operation_to_did_doc: return type: Multikey.
  • diff:
    • Diff.add_diff: don't assume all keys are shared between the two diffs.
  • mst:
    • deserialize_node_data: fix bug where layer 0 child pointers got layer=None instead of layer=-1.
  • util:
    • Add media_metadata, extracted from AtpRemoteBlob.generate_metadata.
    • service_jwt: enforce low-S signatures.
    • datetime_to_tid, tid_to_datetime: fix bug where they could be off by a microsecond, due to floating point error in the UNIX timestamp conversion.