Skip to content

docs(core): give HTTP 400 for four auth and operation errors - #1294

Open
LeeroyHannigan wants to merge 1 commit into
mainfrom
fix/1288-error-status-docs
Open

LeeroyHannigan wants to merge 1 commit into
mainfrom
fix/1288-error-status-docs

Conversation

@LeeroyHannigan

Copy link
Copy Markdown
Collaborator

What

The doc comments of four DynamoDbError variants in crates/core/src/error/mod.rs now give HTTP 400: UnknownOperationException, IncompleteSignature, UnrecognizedClientException and InvalidSignatureException. They gave HTTP 404 or 403.

The same statuses change in docs/design/01-requirements.md (REQ-WIRE-007 and three rows of the error catalog) and in one row of the error table in docs/manuals/03-usage-guide.md.

This PR changes no code. status_code already returns 400 for these errors, and its unit test status_codes_match_sp_err_002 asserts 400 for them.

The MissingAuthenticationToken lines stay as they are, because #1290 changes them to 400.

Fixes #1288

Why

DynamoDB answers these errors with HTTP 400:

ExtendDB sends the status that status_code returns. So the comments and the docs gave a status that neither ExtendDB nor DynamoDB sends.

Testing done

  • cargo test -p extenddb-core --lib: 1146 passed, 1 ignored.
  • cargo +1.97.0 clippy -p extenddb-core --all-targets -- -D warnings and cargo +1.97.0 fmt --all -- --check are clean.
  • After this change, no text in crates/, docs/, tests/ or the top-level files gives these four errors another status than 400.

Line counts: doc comments and docs only, +9 -9.

This PR adds no conflict with the open PRs, and it merges cleanly with #1290.

Not in this PR: the error catalog names IncompleteSignature by its Rust variant, and it gives "signature mismatch" to UnrecognizedClientException, where ExtendDB answers InvalidSignatureException (#1293).

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace)
  • Code is formatted (cargo fmt --check)
  • Clippy is clean (cargo clippy -- -W clippy::pedantic)
  • I have added or updated tests for new functionality
  • I have updated documentation if behavior changed
  • Breaking changes are noted below (if any)
  • If this changes the wire protocol, Storage trait, auth model, on-disk
    format, or public CLI surface, an RFC has been accepted or is linked
    below. Otherwise, an ADR captures the decision (link below).

ADR / RFC: n/a


By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.

The doc comments of UnknownOperationException, IncompleteSignature,
UnrecognizedClientException and InvalidSignatureException gave HTTP 404
or 403. So did the error catalog and REQ-WIRE-007 in
docs/design/01-requirements.md, and the error table of
docs/manuals/03-usage-guide.md. status_code in crates/core/src/error/mod.rs
returns 400 for these errors. DynamoDB answered the first three with HTTP
400 in us-east-1 on 21 Nov 2026, and InvalidSignatureException with HTTP
400 on 23 Oct 2026.

The lines for MissingAuthenticationToken stay as they are, because the
fix for #1075 changes them.

Fixes #1288.

@navareamol navareamol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc comments and docs now match status_code and status_codes_match_sp_err_002 for the four errors, and I found no other place that gives them 403 or 404. Two description points:

  1. The description says the lines for the missing Authorization header error stay "because #1290 changes them to 400" and that this PR "merges cleanly with #1290". #1290 is already merged into main, so on main those lines are 400. Could you reword that sentence to say the lines are left alone because #1290 already changed them?
  2. The branch is 40 commits behind main and CI ran on the old base. I think a merge with main is worth doing so CI runs on the combined tree, though a trial merge here has no conflict.

I will approve once the description is corrected and the branch is updated with main.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error variant comments and the requirements table give HTTP 403 or 404 for errors that ExtendDB and DynamoDB answer with HTTP 400

2 participants