Skip to main content

pdsx._internal.permissioned

experimental permissioned-data helpers (com.atproto.space.*). The permissioned-data proposal is still moving and most PDS implementations do not serve the namespace at all. Everything here is built to degrade cleanly on those hosts rather than surface a raw HTTP error, so callers can offer the commands unconditionally. Detection is necessarily authenticated: PDS implementations run auth middleware before method dispatch, so an anonymous probe returns 401 on a host that supports permissioned data and 401 on one that does not. The distinguishing signal only appears once a request carries credentials. Proposal: https://github.com/bluesky-social/proposals/tree/main/0016-permissioned-data

Functions

access_jwt

pull the session JWT off an authenticated client. The token lives on client._session; client.me is a profile view and has no access_jwt, so reading it from there fails after a successful login and looks like missing credentials.

_is_unsupported

does this response mean “this PDS doesn’t do permissioned data”?

space_query

issue an authenticated permissioned-data query. Raises:
  • NotAuthenticated: if the client has no session
  • PermissionedDataUnsupported: if the PDS does not serve the namespace

_describe_error

render an atproto error body as one readable line. The raw httpx message is a URL dump with the actual reason buried in it.

supports_permissioned_data

probe whether a PDS serves the permissioned-data namespace. Uses listSpaces, which is read-only and scoped to the authenticated actor.

list_spaces

list spaces the authenticated actor owns or holds a writer repo in. Being named in a space’s member list does not put it here — that is management policy state, not actor-local space state.

list_space_records

list records in a permissioned space. Values are returned by default, per the proposal; pass exclude_values to get just collection/rkey/cid without materializing record JSON.

get_space_record

get a single record from a permissioned space.

Classes

PermissionedDataUnsupported

the target PDS does not serve com.atproto.space.*. Either the implementation lacks permissioned data entirely or an operator has disabled it. Both are reported the same way upstream.

NotAuthenticated

permissioned-data reads require an authenticated session.

SpaceQueryError

the PDS served the method and rejected the request. Distinct from PermissionedDataUnsupported: the namespace works, this particular call did not (missing space, missing record, no access).