docs: add api-devices.md covering devices & prekeys endpoints (#433) - #521
Open
JesseJohn7 wants to merge 1 commit into
Open
docs: add api-devices.md covering devices & prekeys endpoints (#433)#521JesseJohn7 wants to merge 1 commit into
JesseJohn7 wants to merge 1 commit into
Conversation
…stia#433) Documents every route in routes/devices.ts (list, register, revoke, logout-everywhere, prekey upload) and the legacy public-key lookup in routes/userDevices.ts: request/response shapes, status codes, and ownership/auth checks per route. Covers the signed-vs-one-time prekey distinction, the 200-key cap and trimming behavior, and documents revocation side effects (prekey deletion, device_revoked:* publish, key-change system event) as part of DELETE /:id and logout-everywhere. Linked from the root README's new Documentation section, alongside the previously-unlinked e2ee-onboarding.md. Closes codebestia#433
|
@JesseJohn7 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
apps/backend/docs/api-devices.md, documenting every route inroutes/devices.tsand the legacy alias route inroutes/userDevices.ts,verified against the current implementation of both files.
Coverage
GET /devices,POST /devices,DELETE /devices/:id,POST /devices/logout-everywhere,POST /devices/:id/prekeys— fullrequest/response shapes, status codes, and ownership/auth checks for each
GET /user-devices/:id/public-key— the one route remaining in thelegacy
userDevices.tsrouter, including its cross-userconversation-membership gate (distinct from every other route on this
page, which is same-user-only)
add-to-pool-and-ignore-conflicts, and why only the signed prekey is
signature-verified
available = 200 - currentCountmath, the
422when already at cap, and the silent-trim behavior(
capped/uploadedOneTimePreKeysin the response) when a batch wouldexceed the remaining headroom
DELETE /:idandlogout-everywhere: prekey row deletion, same-node andcross-node (Redis pub/sub) forced disconnect, and the
device_revokedkey-change system event fan-out into every shared conversation
Cross-links
## 📚 Documentationsection in the root READMEe2ee-onboarding.mdVerification
.tsfiles modifiednpx tsc --noEmit,npm test— unaffected by this change; pleaseconfirm green in CI
Closes #433