feat: implement user SSH keys, GPG keys and email management #7
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
SSH keys authenticate git push/pull operations without passwords. GPG keys sign commits
for verification. Email management allows adding secondary addresses and controlling
which one is used for commits. All three are routine account setup operations.
Endpoints to implement
/user/keyslist_my_ssh_keys/user/keysadd_ssh_key/user/keys/{id}get_ssh_key/user/keys/{id}delete_ssh_key/user/gpg_keyslist_my_gpg_keys/user/gpg_keysadd_gpg_key/user/gpg_keys/{id}get_gpg_key/user/gpg_keys/{id}delete_gpg_key/user/emailslist_my_emails/user/emailsadd_email/user/emailsdelete_emailAcceptance Criteria
add_ssh_key(title, key)—keyis the full public key string (e.g.ssh-rsa AAAA...)add_ssh_keyreturns the created key object including its assignedidadd_gpg_key(armored_public_key)accepts full PGP armored blocklist_my_emailsreturns list withemail,verified,primaryfieldsadd_email/delete_emailacceptemails: list[str]delete_*tools return{"success": true}on 204Technical Notes
POST /user/keysbody:{"key": "ssh-rsa AAAA...", "title": "My laptop", "read_only": false}POST /user/gpg_keysbody:{"armored_public_key_gpg": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n..."}POST /user/emailsbody:{"emails": ["new@example.com"]}DELETE /user/emailssends email list in request body (unusual DELETE with body — use_call("DELETE", ...)withjson=kwarg)