Skip to content

fix(engine): refuse a table name of a bad length before the lookup - #1127

Open
LeeroyHannigan wants to merge 11 commits into
mainfrom
fix/1056-table-name-length
Open

LeeroyHannigan wants to merge 11 commits into
mainfrom
fix/1056-table-name-length

Conversation

@LeeroyHannigan

@LeeroyHannigan LeeroyHannigan commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Changes since the last review

The branch now merges main at 1e2ebdd. After the head a883891, the branch has three merges of main and three other commits:

DynamoDB gave every new answer on 3 December 2026.

What

GetItem, BatchGetItem, BatchWriteItem and TransactWriteItems now refuse a table name shorter than 3 or longer than 255 characters with ValidationException, before the table lookup. Before this change, the lookup ran and answered ResourceNotFoundException.

The check runs in the engine handlers, after they read the request. DynamoDB answers a member of the wrong JSON type with SerializationException ahead of the length, in all four operations. The server's table name gate runs before that read, so a length check there would answer ValidationException to those requests.

The bounds come from the deployment's [limits] values min_table_name_length and max_table_name_length, as in CreateTable. The texts name 3 and 255, as the sentences of validate_table_name do.

Each operation answers with DynamoDB's text:

  • GetItem: 1 validation error detected: Value 'ab' at 'tableName' failed to satisfy constraint: Member must have length greater than or equal to 3, or the less than or equal to 255 clause for a long name.
  • BatchGetItem and BatchWriteItem: the Map keys must satisfy constraint sentence at requestItems. DynamoDB quotes the whole RequestItems value there, and ExtendDB quotes the refused key alone (BatchGetItem and BatchWriteItem quote a refused RequestItems key alone, where DynamoDB quotes the whole RequestItems value #1118). With several refused keys, ExtendDB quotes the first in sorted order, so one request gets the same answer on every send.
  • TransactWriteItems: one message that lists the name fault of each action at transactItems.<n>.member.<op>.tableName, before the first action's lookup.

A name over 1024 characters gets the bound of the TableName member, which also takes a table ARN. The clause quotes no value, and it comes alone, ahead of the other name faults:

  • GetItem and PutItem: 1 validation error detected: Value at 'TableName' failed to satisfy constraint: Member must have length less than or equal to 1024.
  • BatchGetItem: Value at 'RequestItems.<key>' for each such key, in sorted order.
  • BatchWriteItem: the map key sentence with the list [Member must have length less than or equal to 1024, Member must have length greater than or equal to 1], for the smallest such key.
  • TransactWriteItems: Value at 'TransactItems.<n>.member.<Op>.TableName' for each such name, with n counted from 0.

The gate also gives the TransactWriteItems answer, when it refuses the request for a name outside the pattern or an ARN. A deployment whose max_table_name_length is above 1024 takes that maximum as the bound, so it can use the names it creates. These checks leave a value that starts with arn: to the code after them.

The name checks of TransactWriteItems and BatchWriteItem run ahead of the other request checks. TransactWriteItems checks the item count, the ClientRequestToken, the names, the one-operation check and then the attribute name sizes. BatchWriteItem checks the keys after the counts. They come ahead of a WriteRequest that holds no request, the attribute name sizes and the numbers.

In TransactWriteItems, beside a name outside the pattern, the gate now lists the other actions' names of a bad length too, as DynamoDB does. The gate uses the service's bounds, 3 and 255, for that list. ExtendDB refuses such a request for its pattern fault whatever the deployment's bounds are. The list ends at the first ARN that the ARN rules refuse. DynamoDB also lists that ARN's fault and the faults of the later actions (#1487).

An empty name gets DynamoDB's texts in three operations:

  • GetItem and PutItem: 1 validation error detected: Value at 'TableName' failed to satisfy constraint: Member must have length greater than or equal to 1.
  • DescribeTable: the length clause and the pattern clause at tableName, in one message. The gate gives this answer before authorization.

length_clause, MAP_KEYS_NAME, transact_name_location and table_name_bounds moved to extenddb_core::validation::table_name_length. The gate, the engine and the backup requests use them. The gate's one_error calls extenddb_core::error::validation_error. TableNameTooShort and TableNameTooLong use that function with the two length clauses, so core writes each clause once. One function of that module writes the Value at sentence of the member bound, for the empty name and for the name over 1024 characters.

validate_name_member in extenddb_core::validation keeps its own choice of length clause. #1137 moved it there from crates/engine/src/backup_requests.rs. Its text names the deployment's bounds, and length_clause names the service's 3 and 255, as validate_table_name does. With the default bounds, the two texts are the same.

GetItem keeps a second check of the name. The new check runs before the lookup, and validate_get_item runs validate_table_name again after it. That second call covers a table ARN, which the new check leaves to the code after the lookup.

pub mod table_name_length; sits after the pub use warm_throughput::{...}; block in crates/core/src/validation/mod.rs, out of alphabetical order. In alphabetical order the line conflicts with #485, which adds pub mod tag; at the same place.

BatchWriteItem ab with two Puts of one key also gets the map key sentence now, where main answered ResourceNotFoundException. ExtendDB checks for duplicate keys after the lookups. On 25 November 2026 DynamoDB answered this request with the map key sentence too, on both sends. It quotes the map in its WriteRequest(...) form, and ExtendDB quotes the key alone (#1118).

The WebAssembly build runs the engine without the server's gate. Its GetItem now answers a name outside the pattern with the engine's name check, as its PutItem does. The parity corpus and the table in docs/webassembly.md record the new answers of this build, the answers to a name over 1024 characters included.

Why

These are DynamoDB's answers, measured in us-east-1. The issue's rows date from 13 and 14 November 2026. On 18 November 2026, more requests went to DynamoDB. Each one went out twice and got the same answer both times:

  • A member of the wrong JSON type beside the name ab, in each of the four operations: SerializationException.
  • TransactWriteItems with ab in one action and another fault in an earlier or a later action: the length fault, in all 9 requests. The other faults were a number that does not convert, a ConditionExpression syntax error, a key without its sort key, and two operations on one item.
  • TransactWriteItems with bad name, ab and a name of 256 characters in three actions, in two orders. Each got the three faults in one message, in action order.

On 3 December 2026, 26 more requests went out twice each:

  • A name of 1025 characters in GetItem, PutItem, BatchGetItem, BatchWriteItem and TransactWriteItems: the member bound texts above. A name of 1024 characters in GetItem and TransactWriteItems: the 255 clause.
  • The member bound beside ab, beside bad name and beside an ARN of the vendor s3: the member bound alone. DynamoDB listed two such names in TransactWriteItems in action order, and two such keys in BatchGetItem in either order.
  • ab beside a 65536-byte attribute name, a 65536-byte ExpressionAttributeNames value and an action with two members in TransactWriteItems: the length fault. ab beside a 65536-byte attribute name, a WriteRequest that holds no request and a number that does not convert in BatchWriteItem: the map key sentence.
  • A 37-character ClientRequestToken beside ab, and beside an action with two members: the token text alone.

Refs #1056

The two comments of 20 November on #1056 add Query and Scan, which still look up a name of a bad length. This PR does not change them, so #1056 stays open for them. The message of the first commit carries a closing keyword for #1056. Please use What as the squash message, so that #1056 stays open after the merge.

Not in this PR

Each of these is in an open issue:

Conflicts with other open PRs

On 4 December 2026, git merge-tree of this branch at 059c6ca with each of the 213 other open PRs found these conflicts. Each one is in a file where the other PR merges with main without a conflict:

#597, #1140 and #200 conflict with main in the files where they conflict with this PR, so this PR adds no conflict to them. #633, #1100, #1117, #1142 and #1176 conflict with main in partiql/test_context.rs, where this PR takes the context of main, and this PR adds no conflict to them.

Testing done

At 059c6ca, on the merge with main 1e2ebdd:

  • cargo +1.97.0 fmt --all -- --check is clean. The two clippy commands of .github/workflows/clippy.yml with -D warnings are clean on the whole workspace, as CI runs them.
  • cargo test -p extenddb-core --lib: 1260 passed, 1 ignored. cargo test -p extenddb-engine --lib: 987 passed. cargo test -p extenddb-server --lib: 525 passed, 5 failed. The 5 are the backup_store::tests privacy tests of storage-sqlite: the two write_lock_tests fail when an ancestor of the Cargo target directory is owned by another user #1414.
  • cargo test -p extenddb-wasm-adapter: 3 unit tests and the parity corpus test pass. cargo test -p extenddb-storage-postgres --test doc_version_literals: 3 passed.
  • The clippy step of .github/workflows/wasm.yml is clean on this branch.
  • Against ExtendDB on SQLite and on PostgreSQL, built from this head, the three files of NUL table names passed 155 tests on each. fix(core): list the pattern clause for an empty name member #1228 adds the empty name row to tests/python/test_nul_table_name_fields.py, which accounts for the 8 tests over the 147 at af26a1f. The eight files of TransactWriteItems and BatchWriteItem tests passed 155 tests on each backend.
  • pytest --collect-only collected 7429 tests in tests/ and 884 in tests/python, with no error.

At af26a1f, on the merge with main db8a90d:

  • cargo test -p extenddb-core --lib: 1260 passed, 1 ignored.
  • cargo test -p extenddb-engine --lib: 983 passed.
  • cargo test -p extenddb-server --lib: 522 passed, 5 failed. The 5 are the backup_store::tests privacy tests of storage-sqlite: the two write_lock_tests fail when an ancestor of the Cargo target directory is owned by another user #1414, which fail on the build host because of the ownership of /local/home.
  • cargo test -p extenddb-wasm-adapter: 3 unit tests and the parity corpus test pass.
  • cargo +1.97.0 clippy --all-targets with -D warnings on extenddb-core, extenddb-engine, extenddb-server and extenddb-wasm-adapter is clean, with and without the backup-test-hooks feature of the engine. These crates do not depend on the Cassandra and MongoDB crates, whose test-hooks feature the other command of .github/workflows/clippy.yml turns on. cargo fmt --all with --check is clean. cargo +1.94.0 check --all-targets of the four crates passes.
  • The clippy step of .github/workflows/wasm.yml is clean on this branch.
  • cargo test -p extenddb-storage-postgres --test doc_version_literals passes.
  • Against ExtendDB on SQLite and on PostgreSQL, built from this head, tests/python/test_nul_table_names.py, tests/python/test_nul_arn_shapes.py and tests/python/test_nul_table_name_fields.py passed 147 tests on each. Eight files of TransactWriteItems and BatchWriteItem tests passed 155 tests on each backend.
  • pytest --collect-only collected 7330 tests in tests/ and 846 in tests/python, with no error.

At 16de95b, on the merge with main c057660:

  • cargo test -p extenddb-core --lib: 1260 passed, 1 ignored.
  • cargo test -p extenddb-engine --lib: 983 passed.
  • cargo test -p extenddb-server --lib: 522 passed, 5 failed. The 5 are backup_store::tests privacy tests. They fail on the build host because of the ownership of /local/home, without this change too (storage-sqlite: the two write_lock_tests fail when an ancestor of the Cargo target directory is owned by another user #1414).
  • cargo test -p extenddb-wasm-adapter: 3 unit tests and the parity corpus test pass.
  • cargo +1.97.0 clippy -p extenddb-core -p extenddb-engine -p extenddb-server --all-targets -- -D warnings, the same command with --features extenddb-engine/backup-test-hooks, and cargo fmt --all -- --check are clean. cargo +1.94.0 check -p extenddb-core -p extenddb-engine -p extenddb-server --all-targets passes.
  • The clippy step of .github/workflows/wasm.yml is clean on this branch. fix(core): read the latency segment clock through web_time #1482 fixed it on main.
  • cargo test -p extenddb-storage-postgres --test doc_version_literals passes.
  • The engine test a_name_of_a_bad_length_is_refused_before_the_lookup sends 27 rows: the length rows, the member bound rows and the order rows. It also sends a row with a member of the wrong type for each of the four operations. With the production files of the merge commit 1dbbe5b and the tests of 16de95b, 14 rows fail. Four mutants in one run each fail their own rows:
    • the bound reached at 1024 characters, with the deployment maximum ignored
    • the largest refused key in place of the smallest
    • no empty name branch
    • the names ahead of the token
  • The engine test the_deployment_bounds_decide_which_lengths_are_refused sets the bounds to 1 and 1100. CreateTable, GetItem, BatchGetItem, BatchWriteItem and TransactWriteItems then accept ab and names of 256 and 1025 characters.
  • The gate test bad_lengths_beside_a_pattern_fault_and_the_empty_describe_table_name checks the lists beside a pattern fault, the member bound beside bad name and an s3 ARN, and the empty DescribeTable name. Without the gate change, the bad name row fails.
  • Against ExtendDB on SQLite and on PostgreSQL, tests/python/test_nul_table_names.py, tests/python/test_nul_arn_shapes.py and tests/python/test_nul_table_name_fields.py passed 147 tests on each. The table TestTableNameLengths holds 26 rows: the 11 rows of the issue, 2 rows measured on 18 November and 13 rows measured on 3 December. Eight files of TransactWriteItems and BatchWriteItem tests passed 155 tests on each backend.

Line counts against main, at 059c6ca as at af26a1f and 16de95b: production +432 -80, tests +928 -20, docs +29 -7. The parity corpus counts as tests, and the docs pages and the manuals as docs.

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

Breaking changes

GetItem, BatchGetItem, BatchWriteItem and TransactWriteItems now answer a table name shorter than 3 or longer than 255 characters with ValidationException. The previous release answered ResourceNotFoundException. A name over 1024 characters gets the member bound text above in these four operations and in PutItem, where PutItem gave the 255 clause. An empty name in GetItem, PutItem and DescribeTable gets the DynamoDB texts above in place of the texts of the previous release. TransactWriteItems and BatchWriteItem answer the name ahead of the faults listed in What. The upgrade manual has the entry for 1.2.0.


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.

GetItem, BatchGetItem, BatchWriteItem and TransactWriteItems looked up a
table name shorter than 3 or longer than 255 characters. They answered
ResourceNotFoundException for it.

DynamoDB refuses such a name with ValidationException before the lookup.
It answers a member of the wrong JSON type ahead of the length.
So the handlers now check the length after the request is read.
They take the bounds from the deployment's limits, as CreateTable does.

In TransactWriteItems, DynamoDB lists the name faults of every action
in one message. Beside a name outside the pattern, the server lists the
other actions' names of a bad length too.

GetItem and PutItem answer an empty name with the text DynamoDB gives.
DescribeTable answers an empty name with the length and pattern faults,
as DynamoDB does.

Measured in us-east-1 on 13, 14 and 18 Nov 2026.

Fixes #1056.
Main at e96a60f. No file conflicted. Of the files this branch
changes, main changed three. In crates/core/src/error/messages.rs it
added validation_errors_detected and INVALID_STREAM_ARN. In
crates/engine/src/partiql/mod.rs it reads Limit with
int32_member::read. In crates/engine/src/transact_write_items.rs it
changed the fingerprint and the idempotency mismatch text. Git merged
each change beside the lines of this branch.

The WebAssembly build has no table name gate, so its GetItem now gets
the name check of the engine before the lookup. Four GetItem cases in
crates/wasm-adapter/parity/corpus.json expected
ResourceNotFoundException. They now expect the new answers: the
pattern clause for "bad name!", the length clause alone for "a!" and
for the name of 301 characters, and the length clause at TableName for
the empty name. Three new cases record the other answers that change.
These are a RequestItems key of two characters in BatchWriteItem, a
TransactWriteItems member name of two characters, and an empty
DescribeTable name.

README.md gets the same changes in its table of the checks that the
server makes and this build does not. GetItem moves to the row of the
name check of the engine. The RequestItems and TransactItems rows say
where the length check of the engine answers. The rule for several
refused values says how TransactWriteItems lists them. The empty
DescribeTable name gets its own row.
validate_request_items_keys and validate_transact_write_names each
built the pair (min_table_name_length, max_table_name_length) from the
limits. The backup requests had a function, table_name_bounds, that
builds the same pair. That function moves to
extenddb_core::validation::table_name_length. The two core checks and
the backup requests call it there.
The first branch of handle_put_item takes a TableName that is a string.
The second branch also matched a string, so it never ran. This change
deletes the second branch and its comment.
check_transact_items lists the names of the actions up to the first
ARN that the ARN rules refuse. Its comment said that it lists every
action. On 25 Nov 2026 DynamoDB listed the fault of such an ARN and
the faults of the later actions in the same message. The comment now
says where the list ends.

The security manual said that the server authorizes a name that breaks
only a length bound first, with one exception for ListStreams. The table
name gate now refuses an empty DescribeTable name before authorization,
so the manual names that exception too.
LeeroyHannigan added a commit that referenced this pull request Nov 25, 2026
The base branch now merges main at e96a60f and adds three commits
of #1127. No file conflicted. In
crates/core/src/validation/table_name_length.rs, table_name_bounds
from the base sits after count_clause from this branch. In
crates/server/src/table_name_gate.rs, the new comment of
check_transact_items from the base sits beside the utf16 argument of
this branch.

The README.md table of checks gets the change of this branch too. Its
table names row now says that the server counts the name in UTF-16
code units on CreateTable, DescribeTable, DeleteTable and UpdateTable.
The other operations count it in characters.

@demohan demohan 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.

A table name of a bad length is refused before the lookup at a883891, with no row moving away from the service. With 634 requests sent twice to us-east-1, to this head and to main on SQLite and PostgreSQL (names of 0, 1, 2, 3, 255, 256 and 1025 characters, multibyte and astral names and three table ARNs, in every operation that takes a TableName), all 267 rows main answered as the service does still match, 39 of the 48 rows this changes now match, and the two backends agree on every row. A name whose only fault is its length is still refused after authorization, as the security manual says. Seven negative controls fail as they should, the 13 new Python rows pass here and live and fail on main, and fmt, clippy and the 1.91.1 check are clean; the red wasm check is main's, fixed by #1482. The branch conflicts with main at 222d80a only in partiql/test_context.rs, against #1375; taking main's context and keeping pub(crate) builds and passes every gate, the 1.94.0 check and wasm32 clippy included, and answers 633 of 634 rows as this head does, the last changed by #1375. No merged PR covers this.

I will approve once a name over 1024 characters gets the service's 1024 clause in GetItem, BatchGetItem and TransactWriteItems, and the name check comes ahead of the faults the service reports after it in TransactWriteItems and BatchWriteItem.

/// The length clause a table name fails under the bounds `(min, max)`, in
/// characters, or `None` for a name within them.
#[must_use]
pub fn length_clause(name: &str, (min, max): (usize, usize)) -> Option<&'static str> {

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.

For a name over 1024 characters, the service answers GetItem, BatchGetItem and TransactWriteItems with Value at 'TableName' failed to satisfy constraint: Member must have length less than or equal to 1024 and no value quoted (at RequestItems.<key>, or TransactItems.<n>.member.<Op>.TableName), and in a transaction that error alone, even beside an ab name; this head gives the 255 clause. At exactly 1024 the service gives the 255 clause, as this head does.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in aedd59a. A name over 1024 characters now gets the clause of the member bound, with no value quoted, at the member as the request names it. I measured each row in us-east-1 on 3 Dec, and sent each request twice:

  • GetItem and PutItem: 1 validation error detected: Value at 'TableName' failed to satisfy constraint: Member must have length less than or equal to 1024.
  • BatchGetItem: Value at 'RequestItems.<key>', one clause for each such key. With two such keys the service listed them in either order on two sends, and ExtendDB lists them sorted.
  • BatchWriteItem: the map keys sentence at requestItems with the list [Member must have length less than or equal to 1024, Member must have length greater than or equal to 1]. ExtendDB quotes the key alone (BatchGetItem and BatchWriteItem quote a refused RequestItems key alone, where DynamoDB quotes the whole RequestItems value #1118).
  • TransactWriteItems: Value at 'TransactItems.<n>.member.<Op>.TableName', with n counted from 0, one clause for each such name. It comes alone beside an ab action, a bad name action and an ARN of the vendor s3. The gate gives this answer when it refuses the request for one of the last two.

At 1024 characters GetItem and TransactWriteItems keep the 255 clause. The checks are in crates/core/src/validation/table_name_length.rs, and the rows are in table_name_length_tests.rs, the gate test and TestTableNameLengths. A deployment whose max_table_name_length is above 1024 takes that maximum as the bound, so it can still use the names it creates.

validate_member_attribute_name_sizes(twi, &ctx.limits)?;
}

extenddb_core::validation::table_name_length::validate_transact_write_names(

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 service reports the name fault ahead of a 65536-byte attribute name, an oversized ExpressionAttributeNames value and an action with two members, all checked above this line here, so this head answers the other fault in each case; the same holds in BatchWriteItem for a 65536-byte attribute name (batch_write_item.rs:80 before :96). A 37-character ClientRequestToken stays ahead of the name on both, as it should.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 0806912. I measured these on 3 Dec, twice each, and the service answered the name ab in each row:

  • TransactWriteItems: beside a 65536-byte attribute name in a Put item, a 65536-byte ExpressionAttributeNames value, and an action with two members.
  • BatchWriteItem: beside a 65536-byte attribute name, a WriteRequest that holds no request, and a number that the service cannot read.

A 37-character ClientRequestToken came ahead of the name, and also ahead of an action with two members. So handle_transact_write_items now checks the count, the token, the names, the one-operation check and then the attribute name sizes. handle_batch_write_item checks the keys after the counts and ahead of its other checks. The number row of BatchWriteItem is a row of #1121, and the row of the token beside two members is a row of #1463. Both issues stay open for their other rows.

The service lists a 37-character token and a name over 1024 characters in one message. ExtendDB answers the token alone there, as #1463 describes for the token beside a count fault. #1463 now records that row.

/// `ValidationException` for an empty name or one that
/// [`validate_table_name`] refuses.
pub fn validate_item_table_name(name: &str, limits: &LimitsConfig) -> Result<(), DynamoDbError> {
if name.is_empty() {

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.

Optional. Three controls pass: the empty-name branch here is held only by the Python rows, .min() to .max() at line 114 passes though the body names the sorted choice of key, and the empty-name skip in transactions at line 149 is held by nothing. The comment at get_item.rs:128 and the body say an ARN is checked after the lookup; a table ARN whose name part is ab or 256 characters gets ResourceNotFoundException here and Table name of ARN must have length ... from the service, which #1282 covers.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Two of the three now have a row in table_name_length_tests.rs (aedd59a):

  • GetItem with an empty name holds the empty-name branch. With the branch removed, the row gets Value '' at 'tableName'.
  • BatchGetItem with the keys zz and ab holds the sorted choice. On 3 Dec the service answered one map keys sentence for the whole map, on both sends. ExtendDB quotes ab, and with the largest key in place of the smallest the row gets zz.

The empty-name skip in transactions stays without a row. Without the skip, an empty name gets the clause of 3 characters, and with it the request reaches the lookup. The service answers neither: it gives Value at 'TransactItems.0.member.Put.TableName' and a length of at least 1 (#1119). A row would hold one of the two answers that #1119 replaces.

A table ARN whose name part is ab or 256 characters is #1282, as you say. get_item.rs line 128 still says that the code after the lookup checks an ARN, which holds at this head.

Main at c057660. Three files conflicted.

crates/engine/src/partiql/test_context.rs: main (#1449) builds context
from crate::test_context. The merge takes the body of main and keeps
pub(crate) on context and block_on, which the table name length tests
call.

crates/engine/src/backup_requests.rs: main (#1137) moved
validate_name_member to extenddb_core::validation and kept a private
table_name_bounds. This branch moved table_name_bounds to
extenddb_core::validation::table_name_length. The merge keeps both
moves, so the file imports both functions and defines neither.

README.md: main (#1521) moved the WebAssembly section to
docs/webassembly.md. The merge takes the README.md of main. The README
changes of this branch go to docs/webassembly.md. They change the text
and the table of the checks that the server makes and this build does
not.

Main changed five other files of this branch. Git merged each change
of main beside the lines of this branch.

- crates/core/src/error/messages.rs: a message key.
- crates/engine/src/partiql/mod.rs: request_checks made pub(crate).
- crates/engine/src/transact_write_items.rs: the token comment and the
  stored token.
- crates/wasm-adapter/parity/corpus.json: corpus cases.
- docs/manuals/10-security-model.md: the authentication steps and the
  SearchVectors rows.
… bound

DynamoDB checks the TableName member against 1024 characters before it
checks the table name. It answers a name over that bound with the clause
of the member alone, with no value quoted (measured 2026-12-03):

- GetItem and PutItem: Value at 'TableName'.
- BatchGetItem: Value at 'RequestItems.<key>', one clause for each such
  key.
- BatchWriteItem: the map keys sentence at requestItems, with the list
  of the member bounds, 1024 and 1.
- TransactWriteItems: Value at 'TransactItems.<n>.member.<Op>.TableName',
  with n counted from 0, one clause for each such name. The clause comes
  alone beside a name of 2 characters, a name outside the pattern and an
  ARN that the ARN rules refuse.

A name of 1024 characters keeps the 255 clause. The engine checks give
these answers after the handler reads the request, as for the other
lengths. When
the table name gate of the server refuses a TransactWriteItems request,
it gives this answer in place of its own. A deployment whose
max_table_name_length is above 1024 takes that maximum as the bound.

validate_item_table_name writes the empty name sentence of GetItem and
PutItem with the same code, so the ItemTableNameEmpty key goes. The new
rows also hold the empty GetItem name and the sorted choice of key in
BatchGetItem. The WebAssembly build has no gate, so four corpus cases
and docs/webassembly.md record its answers to such names outside the
pattern.
DynamoDB answers a table name of a bad length ahead of these faults
(measured 2026-12-03, each request sent twice):

- TransactWriteItems: a 65536-byte attribute name in a Put item, a
  65536-byte ExpressionAttributeNames value, and an action with two
  members.
- BatchWriteItem: a 65536-byte attribute name, a WriteRequest that holds
  no request, and a number that the service cannot read.

A 37-character ClientRequestToken comes ahead of the name, and ahead of
an action with two members. So TransactWriteItems now checks the token,
then the names, then that each action holds one operation, and then the
attribute name sizes. BatchWriteItem checks the keys after the counts
and ahead of its other checks.

The BatchWriteItem number row is a row of #1121, and the row of the
token beside two members is a row of #1463. Both issues stay open for
their other rows.
The upgrade manual lists the answers that change with this branch.
GetItem, BatchGetItem, BatchWriteItem and TransactWriteItems refuse a
table name of a bad length before the lookup. A name over 1024
characters gets the member bound, and an empty name gets the texts of
DynamoDB. The name checks come ahead of the other request checks. The
entry goes above the v1.2.0 entries of main, as the newest one.
@LeeroyHannigan

Copy link
Copy Markdown
Collaborator Author

@demohan The two conditions are in the thread replies: the 1024 clause in aedd59a, and the order in 0806912. The other points of the review:

Main is at db8a90d. This branch last had main at c057660. Since
then, #1531 merged into main.

One file conflicted: docs/manuals/07-upgrade-manual.md. #1531 added its
v1.2.0 entry at the top of Behavior Changes by Release, where this
branch has its entry. The merge keeps both entries without change. The
entry of this branch stays first. The entry of #1531 comes next, above
the other v1.2.0 entries of main. The other six files of #1531 are not
files of this branch.
Main is at 1e2ebdd, ten commits past db8a90d: #1466, #1087,
#768, #1296, #1485, #1228, #1325, #1443, #1269 and the squash commit
of #1093.

One file conflicted: docs/manuals/07-upgrade-manual.md. #1093 adds its
v1.2.0 entry at the top of "Behavior Changes by Release", where this
branch has its entry. The merge keeps both entries without change. The
entry of this branch stays first. The entry of #1093 comes next, above
the other v1.2.0 entries of main. #1087 adds its entry after the other
v1.2.0 entries of main, and git merged it with no conflict.

Git merged four other files with no conflict:

- crates/core/src/validation/mod.rs: #1228 adds the pattern clause for
  an empty value in validate_name_member. This branch declares the
  table_name_length module near the top of the file.
- crates/server/src/table_name_gate.rs: #1296 adds has_no_table_member
  and an arm of check_table_name_chars for the six operations that have
  no table member. This branch checks none of those operations.
- crates/wasm-adapter/parity/corpus.json: #1087 adds a Scan case, and
  #1228 changes the text of a ListBackups case. This branch changes
  other cases.
- docs/manuals/10-security-model.md: #1325 adds the
  Content-Security-Policy line of the console. This branch changes the
  line on the requests that get an answer before the IAM decision.

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.

2 participants