docs: document missing HTTP status codes and response shapes#56
Merged
Conversation
- AuthHandler: note 201 on Signup, response bodies for Logout and ChangePassword, 404 note for RefreshToken without Sessions - APIKeyHandler: note 204 No Content on Delete - PasskeyHandler: document BeginRegistration/BeginAuthentication response shape (session_id + options), note 204 on DeleteCredential, add response comment for Enabled Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates README.md to fill gaps in documented HTTP status codes and response bodies/shapes for key auth, API key, and passkey endpoints, making it easier for clients to implement against the API without reading server source.
Changes:
- Document missing success status codes (e.g.,
201 Created,204 No Content) forSignup,APIKey.Create,APIKey.Delete, and passkey credential delete. - Document success response bodies for
LogoutandChangePassword. - Document passkey begin-ceremony response shape (
session_id+options) and how it maps to the finish endpoints and WebAuthn browser APIs.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds missing HTTP status notes and response shapes for Auth/API key/Passkey handler endpoints, including passkey begin-ceremony response documentation. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
Contributor
|
Fixed: updated the JSON comment to use the proper WebAuthn type names |
Replace the ambiguous "RequestOptions" comment with the correct PublicKeyCredentialCreationOptions / PublicKeyCredentialRequestOptions type names to avoid confusing implementers.
…sponse types Merge conflict in README.md: HEAD had a prose intro + JSON example for begin-ceremony endpoints; origin/main added a comprehensive route/status table. Kept both: usage instructions precede the table so implementers see the session_id/options flow alongside the full status-code reference.
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
Fills documentation gaps in
README.mdidentified during a documentation sweep. No code changes — README only.Changes
AuthHandlerSignup— added201 Createdstatus note (was undocumented)Logout— added success response body{"message":"logged out"}ChangePassword— added success response body{"message":"password updated"}RefreshToken— added note that404is returned whenSessionsisnilAPIKeyHandlerDelete— added204 No Contentsuccess status note (consistent with SessionHandler docs style)PasskeyHandlerEnabled— added inline response shape{"enabled": true|false}in route tableBeginRegistration/BeginAuthentication— added inline response shape{"session_id":"...","options":{...}}in route tableDeleteCredential— added204 No Contentsuccess status notesession_id+options), explaining howsession_idmaps to the finish endpoint query parameter and howoptionsmaps to the browser WebAuthn API callWhy it matters
The passkey two-step ceremony (
BeginRegistration → FinishRegistration,BeginAuthentication → FinishAuthentication) requires clients to:session_idfrom the begin response and pass it as a query parameter to the finish endpointoptionsdirectly tonavigator.credentials.create/navigator.credentials.getNeither the response shape nor this flow was documented, making it impossible to implement without reading the source code.
Greptile Summary
Documentation-only PR that fills gaps in
README.mdforAuthHandler,APIKeyHandler, andPasskeyHandler. All added status codes and response shapes were verified against the actual handler implementations and are accurate.Confidence Score: 5/5
Safe to merge — documentation-only change with no code modifications.
Every documented status code and response shape was cross-checked against the corresponding handler implementation and found to be correct. No code is changed, so there is no regression risk.
No files require special attention.
Important Files Changed
Sequence Diagram
sequenceDiagram participant C as Client participant S as goauth Server participant PS as PasskeyStore rect rgb(200, 220, 255) Note over C,PS: Registration Ceremony C->>S: POST /auth/passkey/register/begin S->>PS: Store challenge S-->>C: 200 {session_id, options: PublicKeyCredentialCreationOptions} C->>C: navigator.credentials.create(options) C->>S: POST /auth/passkey/register/finish?session_id=id S->>PS: Load and delete challenge S-->>C: 201 PasskeyCredentialDTO end rect rgb(220, 255, 220) Note over C,PS: Authentication Ceremony C->>S: POST /auth/passkey/login/begin S->>PS: Store challenge S-->>C: 200 {session_id, options: PublicKeyCredentialRequestOptions} C->>C: navigator.credentials.get(options) C->>S: POST /auth/passkey/login/finish?session_id=id S->>PS: Load and delete challenge S-->>C: 200 AuthResponse token + user + HttpOnly cookie endReviews (3): Last reviewed commit: "docs: merge main — combine prose and rou..." | Re-trigger Greptile