Skip to content

fix(core): send UnrecognizedClientException in the coral.service namespace - #1330

Open
LeeroyHannigan wants to merge 1 commit into
mainfrom
fix/1303-unrecognized-client-namespace
Open

LeeroyHannigan wants to merge 1 commit into
mainfrom
fix/1303-unrecognized-client-namespace

Conversation

@LeeroyHannigan

Copy link
Copy Markdown
Collaborator

What

ExtendDB now sends UnrecognizedClientException with the __type com.amazon.coral.service#UnrecognizedClientException, as DynamoDB does. Before this change, the __type was com.amazonaws.dynamodb.v20120810#UnrecognizedClientException. The status and the message do not change.

DynamoDbError::full_error_type in crates/core/src/error/mod.rs now lists the variant in the com.amazon.coral.service# arm. The new line goes between two existing lines, and no existing line changes. A new table test, error_types_carry_the_namespace_the_service_sends, pins the measured namespace, one row per measured error.

Four code paths in crates/auth answer UnrecognizedClientException. Each answer goes through the one writer of __type in the server, which calls full_error_type, so each path now sends the new namespace.

Fixes #1303

Why

These are DynamoDB's answers, measured in us-east-1 on 21 November 2026. Each request was a DescribeTable of a table that does not exist. The Authorization header named the documented example key and a signature of 64 zeros, so the requests used no credential. Each request went out twice and got the same answer both times.

Date headers DynamoDB ExtendDB on main ExtendDB with this PR
X-Amz-Date of the send time and a Date header in the HTTP date form com.amazon.coral.service#UnrecognizedClientException, X-Amz-Crc32 3880715766 com.amazonaws.dynamodb.v20120810#UnrecognizedClientException, X-Amz-Crc32 727384629 the same body as DynamoDB, X-Amz-Crc32 3880715766
A Date header of the send time in the basic form, and no X-Amz-Date the same as the row above IncompleteSignatureException IncompleteSignatureException

Each answer is HTTP 400 with the message The security token included in the request is invalid., except the two IncompleteSignatureException cells. main does not read a Date header in the basic form, which is #1289. Its fix, #1306, gives that request the key lookup. With this PR merged onto #1306's head, both rows give DynamoDB's body byte for byte.

Testing done

  • cargo test -p extenddb-core -p extenddb-auth -p extenddb-server --no-fail-fast: auth 533 and 14 passed, core 1147, server 513. On this host 5 backup_store::tests fail on every branch, because uid 65534 owns /local/home.
  • cargo +1.97.0 clippy -p extenddb-core -p extenddb-auth -p extenddb-server --all-targets -- -D warnings and cargo +1.97.0 fmt --all -- --check are clean.
  • With the new arm line removed, the new test row fails.
  • SQLite servers built from this change and from main got the two requests of the table twice each. They also got a request with an X-Amz-Date 20 minutes old and a request with a session token beside a long-term key. Both reach UnrecognizedClientException, with the new namespace on this change and the old one on main.
  • Against the server of this change, tests/test_auth_error_fidelity.py and tests/test_sigv4_scope_date.py passed 35 tests.

The runs above used the previous revision of the commit, which differs in two comments. On the last revision, cargo test -p extenddb-core --lib error:: passed 3 tests, and clippy on the crate and cargo fmt --check are clean.

Line counts, with the lines after #[cfg(test)] counted as tests: production +2, tests +13.

This PR adds no conflict with main or with the 14 open PRs that change crates/core/src/error/mod.rs.

Not in this PR:

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.

…space

ExtendDB sent UnrecognizedClientException with the __type
com.amazonaws.dynamodb.v20120810#UnrecognizedClientException. DynamoDB
sends com.amazon.coral.service#UnrecognizedClientException, with the same
HTTP 400 and the same message. Measured in us-east-1 on 21 Nov 2026 with
DescribeTable requests of a table that does not exist, signed with an
access key the service does not know; each request went out twice and got
the same answer both times.

DynamoDbError::full_error_type now lists UnrecognizedClientException in
the com.amazon.coral.service# arm. A table test in the error module pins
the measured namespace, one row per measured error.

Fixes #1303.

@LJMart11 LJMart11 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed at 975dbaa. Core, auth and server tests ran, and the new namespace test fails when the arm is removed. Review covered the upgrade notes and the PR body's test counts.

1 finding is left inline.

Docs — outside the diff

  1. docs/manuals/07-upgrade-manual.md:385 — Add a Behavior Changes by Release entry for the __type change of UnrecognizedClientException, from com.amazonaws.dynamodb.v20120810# to com.amazon.coral.service#. The PR body marks breaking changes as noted, but the section at line 385 has no entry for this release, and clients that match the full __type string on the old value will stop matching after upgrade. One short entry would close it.

}
}

/// The `__type` the service sends for each error measured outside the

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The PR body gives auth 533 passed and server 513 for cargo test -p extenddb-core -p extenddb-auth -p extenddb-server --no-fail-fast. This head runs 518 server tests, and auth lib gives 532 passed and 1 failed (secmem::tests::init_refuses_under_a_low_memlock_limit_then_starts_unlocked), with no backup_store failures. Updating the counts would close it.

@navareamol navareamol self-assigned this Dec 3, 2026

@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 two wire test files named in the description do not detect this change. I ran both on a server built from main and the same 35 tests pass, because they compare the error type with endswith and never read the namespace. The only test that can fail is the new unit row on full_error_type(). Could you add a check in test_auth_error_fidelity.py that the unknown key answer has __type equal to com.amazon.coral.service#UnrecognizedClientException, so the server path is pinned and not only the helper?

The description says the four auth paths now send DynamoDB's namespace. One of the four is the stale date answer, and I get a different error type for it from the live service (unsigned request, example key, date 20 minutes old, us-east-1, 2026-12-03, twice): com.amazon.coral.service#InvalidSignatureException "Signature expired". So for that path the PR changes the namespace of an error the service does not send. Could the description say that, so a reader does not take all four paths as matched?

The comment on full_error_type still says "Verified against real DynamoDB 2026-05-04". Could it carry the 2026-11-21 date for the new entry?

I will approve once a wire level check pins the namespace.

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.

UnrecognizedClientException carries the com.amazonaws.dynamodb.v20120810 namespace, where DynamoDB sends com.amazon.coral.service

3 participants