@@ -39,13 +39,16 @@ SELECT count(*) FROM user_gpg_keys WHERE user_id = $1 AND revoked_at IS NULL; |
| 39 | -- name: GetUserGPGKey :one | 39 | -- name: GetUserGPGKey :one |
| 40 | -- Scoped single-key lookup for REST GET-by-id. user_id filter prevents | 40 | -- Scoped single-key lookup for REST GET-by-id. user_id filter prevents |
| 41 | -- cross-user reads (existence-leak-safe: returns no row if the id | 41 | -- cross-user reads (existence-leak-safe: returns no row if the id |
| 42 | --- belongs to another user). | 42 | +-- belongs to another user). Excludes soft-deleted rows so the public |
| | 43 | +-- surface mirrors a hard delete from the consumer's perspective; |
| | 44 | +-- verification (which needs historical attribution) uses |
| | 45 | +-- GetUserGPGKeyForVerification which has no revoked filter. |
| 43 | SELECT id, user_id, name, fingerprint, key_id, armored, | 46 | SELECT id, user_id, name, fingerprint, key_id, armored, |
| 44 | can_sign, can_encrypt_comms, can_encrypt_storage, can_certify, can_authenticate, | 47 | can_sign, can_encrypt_comms, can_encrypt_storage, can_certify, can_authenticate, |
| 45 | uids, subkeys, primary_algo, | 48 | uids, subkeys, primary_algo, |
| 46 | created_at, last_used_at, revoked_at, expires_at | 49 | created_at, last_used_at, revoked_at, expires_at |
| 47 | FROM user_gpg_keys | 50 | FROM user_gpg_keys |
| 48 | -WHERE id = $1 AND user_id = $2; | 51 | +WHERE id = $1 AND user_id = $2 AND revoked_at IS NULL; |
| 49 | | 52 | |
| 50 | -- name: GetUserGPGKeyForVerification :one | 53 | -- name: GetUserGPGKeyForVerification :one |
| 51 | -- Non-user-scoped lookup used by the verification path. Unlike | 54 | -- Non-user-scoped lookup used by the verification path. Unlike |