atproto pds pds.zat.dev

eval support: test mail outbox, account self-delete with PLC tombstone #24

Closed zzstoatzz.io
Closed opened by zzstoatzz.io

Agent evals that run against a throwaway zds hit two missing pieces:

  • No test mail provider. requestPlcOperationSignature sends its code by email, and Comail is the only provider. A provider that writes mail to a local outbox would let an eval read the code.
  • No user self-delete or PLC tombstone. Only com.atproto.admin.deleteAccount exists. The reference PDS also has com.atproto.server.requestAccountDelete / deleteAccount. Without those, eval accounts and their PLC identities are left behind after each run.

Shipped in 0.7.8 (live on pds.zat.dev).

  • Test mail. ZDS_MAIL_PROVIDER=outbox keeps mail in the database instead of sending it. dev.zat.admin.listMail?to=<email> returns each message with its code, and needs the admin token.
  • Codes scoped by purpose. Codes are now issued per purpose (confirm_email, update_email, plc_operation, delete_account), as on the reference PDS. Before this, one code per account authorized all of them.
  • Self-delete. com.atproto.server.requestAccountDelete emails a delete_account code. com.atproto.server.deleteAccount takes the DID, password and code, and both behave as on the reference PDS.
  • PLC tombstone. ZDS_PLC_TOMBSTONE_ON_DELETE=true tombstones the did:plc with the PDS rotation key before deleting, whether the account deletes itself or an admin deletes it. If the directory refuses, the account stays. It's off by default, since a tombstone is permanent.

An eval host sets both ZDS_MAIL_PROVIDER=outbox and ZDS_PLC_TOMBSTONE_ON_DELETE=true. The main smoke runs that way, and walks the whole cycle: sign up, confirm the email, sign a PLC operation, self-delete, then check the tombstone.

Two bugs turned up along the way, both fixed in 0.7.8:

  • signPlcOperation returned invalid JSON (the outer object was never closed). This had been there since PLC signing landed.
  • 0.7.7's FutureCursor answer closed the socket from the wrong thread.
Sign up or Sign in to add to the discussion.