chitose.com.atproto.server package#
Submodules#
chitose.com.atproto.server.activate_account module#
chitose.com.atproto.server.check_account_status module#
chitose.com.atproto.server.confirm_email module#
chitose.com.atproto.server.create_account module#
chitose.com.atproto.server.create_app_password module#
chitose.com.atproto.server.create_invite_code module#
chitose.com.atproto.server.create_invite_codes module#
chitose.com.atproto.server.create_session module#
chitose.com.atproto.server.deactivate_account module#
chitose.com.atproto.server.defs module#
- class chitose.com.atproto.server.defs.InviteCode(code: str, available: int, disabled: bool, for_account: str, created_by: str, created_at: str, uses: list[InviteCodeUse])#
Bases:
Object- to_dict() dict[str, Any]#
chitose.com.atproto.server.delete_account module#
chitose.com.atproto.server.delete_session module#
chitose.com.atproto.server.describe_server module#
chitose.com.atproto.server.get_account_invite_codes module#
chitose.com.atproto.server.get_service_auth module#
chitose.com.atproto.server.get_session module#
chitose.com.atproto.server.list_app_passwords module#
chitose.com.atproto.server.refresh_session module#
chitose.com.atproto.server.request_account_delete module#
chitose.com.atproto.server.request_email_confirmation module#
chitose.com.atproto.server.request_email_update module#
chitose.com.atproto.server.request_password_reset module#
chitose.com.atproto.server.reserve_signing_key module#
chitose.com.atproto.server.reset_password module#
chitose.com.atproto.server.revoke_app_password module#
chitose.com.atproto.server.update_email module#
Module contents#
- class chitose.com.atproto.server.Server_(call: Callable[[str, list[tuple[str, str | None | int | list[str]]], bytes | dict[str, Any] | None, dict[str, str]], bytes], subscribe: Callable[[str, list[tuple[str, str | None | int | list[str]]], Callable[[str | bytes], None]], None])#
Bases:
objectWe recommend calling methods in this class via the chitose.BskyAgent class instead of creating instances of this class directly.
- activate_account() bytes#
Activates a currently deactivated account. Used to finalize account migration after the account’s repo is imported and identity is setup.
- check_account_status() bytes#
Returns the status of an account, especially as pertaining to import or recovery. Can be called many times over the course of an account migration. Requires auth and can only be called pertaining to oneself.
- confirm_email(email: str, token: str) bytes#
Confirm an email using a token from com.atproto.server.requestEmailConfirmation.
- create_account(handle: str, email: str | None = None, did: str | None = None, invite_code: str | None = None, verification_code: str | None = None, verification_phone: str | None = None, password: str | None = None, recovery_key: str | None = None, plc_op: Any | None = None) bytes#
Create an account. Implemented by PDS.
- Parameters:
handle – Requested handle for the account.
did – Pre-existing atproto DID, being imported to a new account.
password – Initial account password. May need to meet instance-specific password strength requirements.
recovery_key – DID PLC rotation key (aka, recovery key) to be included in PLC creation operation.
plc_op – A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented.
- create_app_password(name: str, privileged: bool | None = None) bytes#
Create an App Password.
- Parameters:
name – A short name for the App Password, to help distinguish them.
privileged – If an app password has ‘privileged’ access to possibly sensitive account state. Meant for use with trusted clients.
- create_invite_code(use_count: int, for_account: str | None = None) bytes#
Create an invite code.
- create_invite_codes(code_count: int, use_count: int, for_accounts: list[str] | None = None) bytes#
Create invite codes.
- create_session(identifier: str, password: str, auth_factor_token: str | None = None) bytes#
Create an authentication session.
- Parameters:
identifier – Handle or other identifier supported by the server for the authenticating user.
- deactivate_account(delete_after: str | None = None) bytes#
Deactivates a currently active account. Stops serving of repo, and future writes to repo until reactivated. Used to finalize account migration with the old host after the account has been activated on the new host.
- Parameters:
delete_after – A recommendation to server as to how long they should hold onto the deactivated account before deleting.
- delete_account(did: str, password: str, token: str) bytes#
Delete an actor’s account with a token and password. Can only be called after requesting a deletion token. Requires auth.
- delete_session() bytes#
Delete the current session. Requires auth.
- describe_server() bytes#
Describes the server’s account creation requirements and capabilities. Implemented by PDS.
- get_account_invite_codes(include_used: bool | None = None, create_available: bool | None = None) bytes#
Get all invite codes for the current account. Requires auth.
- Parameters:
create_available – Controls whether any new ‘earned’ but not ‘created’ invites should be created.
- get_service_auth(aud: str, exp: int | None = None, lxm: str | None = None) bytes#
Get a signed token on behalf of the requesting DID for the requested service.
- Parameters:
aud – The DID of the service that the token will be used to authenticate with
exp – The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope.
lxm – Lexicon (XRPC) method to bind the requested token to
- get_session() bytes#
Get information about the current auth session. Requires auth.
- list_app_passwords() bytes#
List all App Passwords.
- refresh_session() bytes#
Refresh an authentication session. Requires auth using the ‘refreshJwt’ (not the ‘accessJwt’).
- request_account_delete() bytes#
Initiate a user account deletion via email.
- request_email_confirmation() bytes#
Request an email with a code to confirm ownership of email.
- request_email_update() bytes#
Request a token in order to update email.
- request_password_reset(email: str) bytes#
Initiate a user account password reset via email.
- reserve_signing_key(did: str | None = None) bytes#
Reserve a repo signing key, for use with account creation. Necessary so that a DID PLC update operation can be constructed during an account migraiton. Public and does not require auth; implemented by PDS. NOTE: this endpoint may change when full account migration is implemented.
- Parameters:
did – The DID to reserve a key for.
- reset_password(token: str, password: str) bytes#
Reset a user account password using a token.
- revoke_app_password(name: str) bytes#
Revoke an App Password by name.
- update_email(email: str, email_auth_factor: bool | None = None, token: str | None = None) bytes#
Update an account’s email.
- Parameters:
token – Requires a token from com.atproto.sever.requestEmailUpdate if the account’s email has been confirmed.