Repository navigation
fix(core): send UnrecognizedClientException in the coral.service namespace - #1330
LeeroyHannigan wants to merge 1 commit into
Conversation
…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
left a comment
There was a problem hiding this comment.
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
docs/manuals/07-upgrade-manual.md:385— Add a Behavior Changes by Release entry for the__typechange of UnrecognizedClientException, fromcom.amazonaws.dynamodb.v20120810#tocom.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__typestring 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 |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
What
ExtendDB now sends
UnrecognizedClientExceptionwith the__typecom.amazon.coral.service#UnrecognizedClientException, as DynamoDB does. Before this change, the__typewascom.amazonaws.dynamodb.v20120810#UnrecognizedClientException. The status and the message do not change.DynamoDbError::full_error_typeincrates/core/src/error/mod.rsnow lists the variant in thecom.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/authanswerUnrecognizedClientException. Each answer goes through the one writer of__typein the server, which callsfull_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
Authorizationheader 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.mainX-Amz-Dateof the send time and aDateheader in the HTTP date formcom.amazon.coral.service#UnrecognizedClientException,X-Amz-Crc323880715766com.amazonaws.dynamodb.v20120810#UnrecognizedClientException,X-Amz-Crc32727384629X-Amz-Crc323880715766Dateheader of the send time in the basic form, and noX-Amz-DateIncompleteSignatureExceptionIncompleteSignatureExceptionEach answer is HTTP 400 with the message
The security token included in the request is invalid., except the twoIncompleteSignatureExceptioncells.maindoes not read aDateheader 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 5backup_store::testsfail 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 warningsandcargo +1.97.0 fmt --all -- --checkare clean.maingot the two requests of the table twice each. They also got a request with anX-Amz-Date20 minutes old and a request with a session token beside a long-term key. Both reachUnrecognizedClientException, with the new namespace on this change and the old one onmain.tests/test_auth_error_fidelity.pyandtests/test_sigv4_scope_date.pypassed 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 andcargo fmt --checkare clean.Line counts, with the lines after
#[cfg(test)]counted as tests: production +2, tests +13.This PR adds no conflict with
mainor with the 14 open PRs that changecrates/core/src/error/mod.rs.Not in this PR:
AccessDeniedException(UpdateTable with a table ARN of an account that does not exist answers AccessDeniedException with another __type and message key than DynamoDB #1116).Checklist
cargo test --workspace)cargo fmt --check)cargo clippy -- -W clippy::pedantic)Storagetrait, auth model, on-diskformat, 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.