docs: add missing 404 status rows for BeginRegistration and ChangePassword#157
Merged
veverkap merged 2 commits intoApr 28, 2026
Conversation
…dling docs handler/passkey.go (commit 6864a5d) now returns HTTP 404 when the authenticated user is not found in BeginRegistration, instead of 500. Update docs/handler/passkeys.md to: - Add BeginRegistration | 404 Not Found | User not found - Narrow BeginRegistration 500 condition to exclude the user-not-found case handler/auth.go (commit 6864a5d) now returns HTTP 404 when the authenticated user is not found in ChangePassword, instead of 500. Update docs/handler/auth.md to: - Add ChangePassword | 404 Not Found | User not found handler/auth.go (commit a0c3d03) changed Logout to log a warning via slog when session deletion fails with an unexpected error, and silently ignore ErrNotFound. Update the session-tracking section to document this operational behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates handler reference documentation to reflect recently added 404 Not Found responses and to clarify Logout session-deletion logging behavior, keeping the published HTTP status tables aligned with current handler implementations.
Changes:
- Add a
BeginRegistration | 404 Not Found | User not foundrow and refine the500condition wording indocs/handler/passkeys.md. - Add a
ChangePassword | 404 Not Found | User not foundrow indocs/handler/auth.md. - Expand the
Logoutsession-tracking description to mention ignoringErrNotFoundand logging unexpected deletion errors viaslogwhile still returning HTTP 200.
Show a summary per file
| File | Description |
|---|---|
| docs/handler/passkeys.md | Adds missing 404 row for BeginRegistration and updates 500-row condition text. |
| docs/handler/auth.md | Adds missing 404 row for ChangePassword and clarifies Logout session-deletion behavior in the session-tracking section. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
…ntext in Logout note
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.
What changed
Two recent code fixes (commit
6864a5dc) mappedauth.ErrNotFoundto HTTP 404 in two handlers that previously only returned 500 for all store errors. The HTTP status code tables in the reference docs were not updated to reflect these new 404 paths.docs/handler/passkeys.md—BeginRegistrationBeginRegistration | 404 Not Found | User not foundrow500row condition to remove "Failed to fetch user" (a non-ErrNotFoundfetch error is now the only remaining 500 path for that operation)docs/handler/auth.md—ChangePasswordChangePassword | 404 Not Found | User not foundrowdocs/handler/auth.md—Logoutsession-tracking descriptionA separate fix (commit
a0c3d033) changedLogoutto emit aslog.WarnContextwhenDeleteSessionreturns an unexpected error, and to silently ignoreErrNotFound(session already expired or revoked). The HTTP response is always 200 OK, but operators monitoring logs should know when to expect this warning. Updated the bullet point in the "Session tracking and refresh token rotation" section.Why these are important
Incorrect HTTP status tables lead developers to write overly broad error handlers (e.g., retrying on 404 instead of surfacing "user not found") and produce misleading observability dashboards. These gaps are documentation bugs equivalent to failing tests.
Testing
Documentation-only change; no code was modified. Verified against the implementation in
handler/passkey.goandhandler/auth.go.Warning
The following domain was blocked by the firewall during workflow execution:
proxy.golang.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Greptile Summary
This documentation-only PR adds missing HTTP 404 status rows for
BeginRegistrationandChangePassword, and clarifiesLogoutsession-deletion logging behaviour. All three changes have been verified against the corresponding implementation inhandler/passkey.goandhandler/auth.goand are accurate.Confidence Score: 5/5
Documentation-only PR with all changes verified against the implementation — safe to merge.
No code changes; all three documentation updates accurately reflect the existing handler logic confirmed by direct code inspection.
No files require special attention.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[BeginRegistration] --> B{WebAuthn nil?} B -->|Yes| C[503 Service Unavailable] B -->|No| D{name empty or >100 chars?} D -->|Yes| E[400 Bad Request] D -->|No| F[FindByID] F -->|ErrNotFound| G[404 Not Found] F -->|Other error| H[500 Internal Server Error] F -->|OK| I[ListCredentialsByUser] I -->|Error| H I -->|OK| J[WebAuthn.BeginRegistration] J -->|Error| H J -->|OK| K[StoreChallenge] K -->|Error| H K -->|OK| L[200 OK] M[ChangePassword] --> N{Missing fields?} N -->|Yes| O[400 Bad Request] N -->|No| P[FindByID] P -->|ErrNotFound| Q[404 Not Found] P -->|Other error| R[500 Internal Server Error] P -->|OK| S{Wrong password?} S -->|Yes| T[401 Unauthorized] S -->|No| U[UpdatePassword] U -->|Error| R U -->|OK| V[200 OK] W[Logout] --> X[DeleteSession] X -->|ErrNotFound| Y[silently ignored → 200 OK] X -->|Other error| Z[slog.WarnContext → 200 OK] X -->|OK| AA[200 OK]Reviews (2): Last reviewed commit: "docs: qualify ErrNotFound as auth.ErrNot..." | Re-trigger Greptile