Repository navigation
fix(core): send DynamoDB's text for a B value that does not decode - #1260
LeeroyHannigan wants to merge 47 commits into
Conversation
…rules
A Query with a KeyConditionExpression did not check a key condition value's
type against the key attribute's AttributeDefinitions type, and did not check
that an N value in ExpressionAttributeValues is a number. The storage layer
compared the value's inner text with the stored key and ignored the type tag,
so {"N": "bob"} on an S partition key read the bob partition while
authorization bound no dynamodb:LeadingKeys value to it, and a sort key value
of another type answered InternalServerError on SQLite.
Add the two checks the service applies before it reads a row, on the
expression path (crates/engine/src/query_key_values.rs):
- an N value in ExpressionAttributeValues that is not a number answers
"The parameter cannot be converted to a numeric value: <value>" (the
overflow and 38-digit texts for those cases; an empty value answers the
message with the colon). The check covers the whole map, including NS
members and values nested in L and M, whether the key condition, the
filter or nothing reads them, with the walk PutItem and UpdateItem already
use. It runs at request time after the Limit and expression parameter mix
checks and before the table lookup, which moves those two checks ahead of
the table lookup as well. The server runs the same request-time checks
ahead of the IAM decision, so a principal under any LeadingKeys fence form
gets ValidationException and no items;
- a key condition value whose type is not the key attribute's type answers
"One or more parameter values were invalid: Condition parameter type does
not match schema type", for the partition key, the sort key under every
comparison operator, both BETWEEN bounds, the begins_with prefix and
multi-attribute index keys, after the key schema, filter, projection,
unused value and Select checks and before the ExclusiveStartKey check. When
a compared placeholder is undefined the check returns without a verdict and
the undefined placeholder is reported.
Measured on the service on 2026-10-24 (113 requests, each sent twice). The
legacy KeyConditions path is unchanged; its checks land with #507. Scan is
unchanged. Unit tests at the checks and a dual-target wire test file,
tests/test_query_key_value_types.py, which fails on main.
… service's order The server ran its pre-IAM checks only when the body deserialized as QueryInput, and the engine checked the ReturnConsumedCapacity and Select enums before them, so a Query carrying an invalid Select and an N value that is not a number answered the Select message, or AccessDeniedException for a principal whose LeadingKeys fence needs a value. The checks now read the raw body in the service's order, measured 2026-10-24: Limit, the expression and non-expression parameter mix, ReturnConsumedCapacity, every number in ExpressionAttributeValues, then Select. The engine and the server run the same function.
…y sentence matches the other backends
…ort a shape fault ahead of the request-time checks The request-time number check refused an N value written with a Unicode decimal digit (fullwidth, Arabic-Indic, Devanagari) that the service accepts as the digit it stands for, so a Query that returns rows on the service answered ValidationException here. The check now folds every general category Nd digit to ASCII before the number rules run and echoes the value as the request wrote it when the rules refuse it; the Nd zero code points of Unicode 15.0 live in a module of their own. The fold applies to the check only: the handler and the server's key binding read the value as written. The write paths are unchanged. The checks run on the raw body before deserialization, so a field of the wrong JSON type elsewhere in the body (a string ExpressionAttributeValues beside a Limit of 0, a string ExpressionAttributeNames beside a malformed N, a numeric Select) answered the check's ValidationException where the service and the previous release answered SerializationException. When a check fails, the body is now deserialized as the typed input and a SerializationException from that is returned instead; a ValidationException the deserializer raises does not preempt the check, and a body that passes every check is not deserialized twice. The server's call before dispatch goes through the same function. Measured against the service on 2026-10-25 (11:31 UTC) on tables with S/N and S/S keys, each request twice. Unit tests cover the digit table, the folded check and the shape-fault order; the wire file gains the measured rows for both.
…ks, and assert only acceptance for Unicode digits
The shape-fault pass returned the deserializer's SerializationException for an
AttributeValue with an unknown type descriptor, so Limit 0 beside {"X": "1"}
changed class. The service answers the Limit ValidationException for that
body (measured 2026-10-25), and the check's answer is returned again.
The Unicode digit tests asserted that a key condition or filter written with
a Unicode digit reads the item stored with the ASCII digit. This change makes
the request-time check accept such a value; it does not change how the
handler reads it, so the tests assert only that the value is accepted. A new
test checks that a partition key value written with Unicode digits returns no
item of a partition a ForAllValues LeadingKeys fence keeps the caller from.
Conflict in crates/server/src/request_helpers.rs (authorize_request): main moves the ARN shape checks and the GetRecords iterator decode ahead of the dev-mode return. The resolution keeps the main version and puts the Query request checks of this branch after the tag ARN shape check and before validate_operation_arns. Thus the Query checks also run in dev mode.
Main changes resolve_multipart to take the HASH and the RANGE attribute names (#429). The multi-attribute HASH test now gives r as the RANGE attribute, as its attribute definitions do.
…l as the service does On a single-attribute key schema, the later check of this branch now reports a wrong type in a key condition expression, as the service does. The early check from main still runs there for legacy KeyConditions, which the later check skips. The begins_with refusal now reads the type of the value instead of the type of the sort key.
…rder comments Two new rows send begins_with with an N value on an attribute that is not in the key schema. One row uses a table with an S sort key and the other uses a table with an N sort key. The service refuses both requests with the begins_with operand type message. The comments in handle_query now say that the classifier checks the values of legacy KeyConditions. They also say which attribute definitions it uses for each kind of key schema. The doc of resolve_key_schema_with now says where the service reports a wrong type on a single-attribute key schema (measured 2026-11-06).
…rder - Report an invalid ReturnConsumedCapacity ahead of the expression and non-expression parameter mix. - Check the numbers in each ExpressionAttributeValues entry on its own. A value that does not deserialize no longer turns the check off for the others, in the handler and before authorization. - Beside a value the service cannot read as one type, answer in the service's order. Such a value is a null, or holds no known type descriptor, more than one, or an unknown one beside a known one. Select, ReturnConsumedCapacity and Limit come together, with the Limit text that names the value. The parameter mix comes next, then the first value with a fault and its placeholder. A value the service cannot read comes ahead of a number fault in another value. - In the shape fault check, replace only the parts of such a value that the service cannot read. A field of the wrong JSON type in the rest of the value still answers SerializationException. - Count a decimal digit only below U+10000, as the service does. The check refuses a digit from U+104A0 up. - Echo a refused number with each decimal digit folded to ASCII. - Add rows for legacy KeyConditions and for a multi-attribute key schema beside a non-key clause. Skip the second type check where the classifier checked the values. - Delete the LeadingKeys test tables when a call raises. - Give the checks for values the service cannot read their own module and tests. Move the request order unit tests and the shape fault and LeadingKeys Python tests to files of their own.
The comment above the Query request checks in authorize_request said that they run for every principal. They run after the cross-account refusal, so a table ARN in another account gets AccessDeniedException without them. The service runs them first for a body it can read. Main has the same order for every Query check, and the call does not move. The comment now states this. The comment above the key value type gate in handle_query now states the service's order for legacy KeyConditions. For a legacy value of the wrong type on a single-attribute key schema, the service reports the projection, Select, filter, QueryFilter and unused-value checks first. The classifier's check answers ahead of them, as on main. The doc comment of the Query number check is about the ExpressionAttributeValues contains invalid value wrapper. It said that on Query the service adds the wrapper only for a value it cannot read as one type. The service also adds it beside a Limit above 2147483647 (measured 2026-11-12), and the comment now says so. validate_key_condition_types now calls check_key_value_type for each value it compares. This removes type_matches and resolve_attr_name, which repeated check_key_value_type and resolve_path_attr_name. check_key_value_type returns KEY_CONDITION_TYPE_MISMATCH in place of a second copy of the text. No answer changes. validate_attribute_number in the core validation module is private again. An earlier commit of this branch made it public, and nothing outside that file calls it.
first_fault returned the more than one datatypes text as soon as a value
held two type descriptors. It did not read their payloads. The service
reads every payload first. On Query, the service gives one answer for
:v set to {"N": "bob", "S": "x"} and for {"S": "x", "N": "bob"}. The
answer is "ExpressionAttributeValues contains invalid value: The
parameter cannot be converted to a numeric value: bob for key :v".
{"N": "1", "S": "x"} answers the more than one datatypes text. The
service names a null or an empty value inside an L beside an S in the
same way. It reads N ahead of NS, and NS and M ahead of L, in either
member order (each request measured twice on 2026-11-19).
first_fault now reads the payloads in the order of TYPE_DESCRIPTORS,
which agrees with those pairs. It returns the more than one datatypes
text only when no payload has a fault.
The doc comment of the Query number check said that the service adds
the wrapper on UpdateItem. On the service, :v set to {"N": "bob"} in
UpdateItem gets no wrapper, in SET a = :v and in a ConditionExpression
that reads :v. The answer is "1 validation error detected: The
parameter cannot be converted to a numeric value: bob". The comment no
longer names UpdateItem.
The request-time Query checks had no ExpressionAttributeNames step, so an
invalid names key beside {"N": "bob"} answered the numeric text. The
service and main answer `ExpressionAttributeNames contains invalid key:
Syntax error; key: "a"`.
validate_names runs the ExpressionAttributeNames deserializer on the raw
body and returns its ValidationException. Both paths of the checks call it
after the parameter mix and ahead of the values.
The service checks in the same order: it reports a Limit of 0, an invalid
ReturnConsumedCapacity and the mix ahead of an invalid key. The key comes
ahead of an N value that is not a number and of a duplicate NS. It also
comes ahead of an invalid Select and of a value the service cannot read as
one type. With KeyConditions and no KeyConditionExpression, the service
still reports the key. Each request went to the service twice on
2026-11-19, with the names map first and last in the body.
On Query, {"S": null} beside an invalid Select answered
`SerializationException: S value must be a string`. The request checks
read {"S": null} as an S, so the Select check failed. The shape fault check
then read the S payload as a JSON type fault. Main answers the Select text,
as the service does.
The service reads a type descriptor with a null payload as absent. To the
service, {"S": null} is a value it cannot read as one type, and the request
takes that order of checks. Beside an invalid Select it answers the Select
text. Beside a Limit of 0 it answers the Limit text that names the value.
Alone it answers `ExpressionAttributeValues contains invalid value:
Supplied AttributeValue is empty, must contain exactly one of the supported
datatypes for key :v`. The service accepts {"S": null, "N": "1"} in a
FilterExpression. Each request went to the service twice on 2026-11-19.
unreadable counts a type descriptor with a null payload as a part the
service cannot read, while first_fault and make_readable skip it.
On Query, an empty name in ExpressionAttributeNames beside a value the
service cannot read as one type answered the empty name text. The service
answers the value's text. For {"#a": ""} beside {"X": "1"} it answers
`ExpressionAttributeValues contains invalid value: Supplied AttributeValue
is empty, must contain exactly one of the supported datatypes for key :x`.
Beside {}, {"N": "1", "S": "x"}, a null and {"S": null}, the same names map
answers that value's text. Beside {"X": "1"}, {"#a": "", "b": "c"} answers
`ExpressionAttributeNames contains invalid key: Syntax error; key: "b"`.
Beside {"S": "a", "X": "1"}, which has no fault of its own, {"#a": ""}
answers the empty name text. Each body went to the service twice, with the
names map first and last, on 2026-11-19.
On that path the service checks the keys of the names map ahead of the
values. Those checks refuse an invalid key, a key over 255 bytes and an
empty map. The service makes the empty name check after the values.
unreadable_value_checks now runs the key checks ahead of the values. It
runs them through the same deserializer, with each name replaced. The whole
names check runs after the values.
The unit tests share one set of message texts, and the names tests are one
table of rows. The handler and pre-IAM comments point to
validate_query_request_body, whose doc lists the order of the checks.
The doc of validate_query_request_body said that the service makes the request-time checks first on a Query that names a table ARN in another account. The measurement covers a body the service can read, and the doc now says so. The doc of validate_names now lists the check on a key over 255 bytes, which the deserializer makes and which validate_name_keys names. Step 5 of the unreadable_value_checks doc is three sentences. The first list in the docstring of TestExpressionAttributeNamesOrder now covers readable values only. The docstring also gives the place of the key checks beside a value the service cannot read. No code or test row changes.
ExtendDB answered a B value that does not decode as base64 with the decoder's error text. The text followed the prefix "Start of structure or map found where not expected:". DynamoDB answers such a value with a SerializationException and a text of its own, measured in us-east-1 on 20 November 2026. The text depends on the length of the value in UTF-8 bytes. One byte gets "Buffer is too short for base64 encoding". The value "==" gets no message. Other values whose length is not a multiple of 4 get "Base64 encoded length is expected a multiple of 4 bytes but found: n". Otherwise, a value whose bytes before its closing "=" run are base64 characters gets "Invalid last non-pad Base64 character dectected". Any other value gets no message. One helper now decodes a B value, a BS member and a PartiQL parameter, and gives these texts. The engine sends them without the prefix, and an empty text as no message. The values accepted do not change. Fixes #1189.
The previous commit moved _raw_query out of test_query_value_shapes.py as client_post in raw_signed_request.py. test_query_leading_keys_values.py still imported _raw_query, so the wire suite failed to collect. It now imports client_post and sends its Query row through it.
Main is at c8e66fb, three commits past e8b5f10: #1465, #1515 and #1411. #1411 adds a v1.2.0 entry at the top of "Behavior Changes by Release" in docs/manuals/07-upgrade-manual.md, above the entry of #606. Git merged the file with no conflict, so the order is #1411, #606, then the entry of this branch. No other file has changes on both sides.
Add a v1.2.0 entry at the top of "Behavior Changes by Release" in docs/manuals/07-upgrade-manual.md, above the entries of main and #1260. It gives the values that 1.1.0 refused and this branch reads, the bytes they store, and the requests that still need the padding.
The base brings main at c8e66fb through #1260, with #1465, #1515 and #1411, and adds the v1.2.0 entry of #1313 to docs/manuals/07-upgrade-manual.md. Git merged the manual with no conflict. The order of the v1.2.0 entries is #1313, #1411, #606, #1260, then the entry of this branch. No other file has changes on both sides.
The base brings a new BatchWriteItem check. It reads a fault ahead of a B in request order, also inside a value. The base also adds a sentence to its v1.2.0 entry. The merge has no conflict. Git merged the upgrade manual, where both sides changed other lines. The base adds the new sentence to the entry of #1313. This branch has its entry below the entry of #1260. No other file has changes on both sides.
The v1.2.0 entry of #1260 ended with "An ImportTable line with such a value keeps its 1.1.0 answer, Invalid DynamoDB item at line N". The entry of this branch says that such a line now ends the reading of its file. The sentence in the entry of #1260 now gives the 1.1.0 answer and the new one. The request answers HTTP 200, and the import ends FAILED. The entry of this branch now also says what a file that starts with a UTF-8 byte order mark gets. The reader does not take U+FEFF as JSON, so the reading ends at line 1 and the import ends FAILED. No measured file started with a byte order mark.
LJMart11
left a comment
There was a problem hiding this comment.
Checked at 2044c36 against the list from 639ff59.
This follow-up merges main again and adds the v1.2.0 upgrade-manual entry for the new SerializationException texts of a B value that does not decode. Confirmed: tests/test_binary_base64.py passes 47 of 47 on PostgreSQL and on SQLite; with is_base64_refusal disabled at crates/engine/src/lib.rs:260, 44 of the 47 fail and 3 pass, so the suite pins the branch; extenddb-core and extenddb-engine tests pass on the merged head (1261 and 981 unit tests, 0 failed).
Previous items: 1 fixed.
navareamol
left a comment
There was a problem hiding this comment.
The unit test comment says every value in the table was measured on 2026-11-20 or 2026-11-25. I think 12 of the 50 values are not in the description or in tests/test_binary_base64.py: =, Y=, !=, ===, A==, YR=, ====, =====, ======, A===, AB== and AAB=. Their answers come from the rule in decode_base64. For example ==== gets "Invalid last non-pad Base64 character dectected" only because trimming the = signs leaves nothing, and the other all-= values get the length text. Has anyone measured these on the live service? If yes, can they go in the wire file with the date? If not, can the comment stop saying they were measured?
The description counts 49 measured requests, 41 of them PutItem. tests/test_binary_base64.py has 47 rows and 39 PutItem. Which two requests are not in the file, or is the count off?
On a build of this head, all 31 request shapes I tried (item, key, ExpressionAttributeValues, Expected, ScanFilter, ExclusiveStartKey, transactions, batch and PartiQL parameters) give the same text for the same value, so I have no finding there.
I will approve once the 12 values are measured or the comment no longer claims they were.
Main is at b6c8595, three commits past c8e66fb: #1446, #1531 and #1466. #1446 and #1531 add two v1.2.0 entries at the top of "Behavior Changes by Release" in docs/manuals/07-upgrade-manual.md, above the entry of #1411. Git merged the file with no conflict. The order is #1531, #1446, #1411, #606, then the entry of this branch, which does not change. No other file has changes on both sides.
The unit table a_value_that_is_not_base64_gets_the_service_text holds 14 values that tests/test_binary_base64.py did not have: AA==, AAA=, =, Y=, !=, ===, A==, YR=, =====, ======, ====, A===, AB== and AAB=. The unit test also checks a BS with YQ== and !!!!, which had no row either. DynamoDB answered a PutItem with each of these on 20 November 2026, from 17:14 to 17:15 UTC, on a table that does not exist. Each request went out twice and got the same answer both times. AA== and AAA= decode and get ResourceNotFoundException. The other values and the BS get the text of the unit table. The wire file now has a row for each, so each of the 50 values of the unit table has a row there.
The base brings main at b6c8595 through #1260, with #1446, #1531 and #1466. It also brings the 15 new rows of #1260 in tests/test_binary_base64.py. One file conflicted: docs/manuals/07-upgrade-manual.md. #1446 and #1531 add two v1.2.0 entries at the top of "Behavior Changes by Release", where this branch adds its entry. The merge keeps the two entries of main first, then the entry of this branch, then the entry of #1313. Git merged tests/test_binary_base64.py at other lines. No other file has changes on both sides.
The base brings main at b6c8595 through #1260, with #1446, #1531 and #1466, and the 15 new rows of #1260 in tests/test_binary_base64.py. The merge has no conflict. Git merged the upgrade manual, where both sides changed other lines. The base adds the two entries of main above the entry of #1313, and this branch has its entry below the entry of #1260. No other file has changes on both sides.
The base brings main at b6c8595 through #1260 and #1313, with #1446, #1531 and #1466. It also brings the 15 new rows of #1260 in tests/test_binary_base64.py. One file conflicted: docs/manuals/07-upgrade-manual.md. #1446 and #1531 add two v1.2.0 entries at the top of "Behavior Changes by Release", where this branch adds its entry. The merge keeps the two entries of main first, then the entry of this branch, then the entry of #1355. No other file has changes on both sides.
The branch also merges main at b6c8595 in 6927648, with no conflict. |
|
Checked at Fixed:
Disputed: none. Needs-human: none. |
Main is at 5826e1b, one commit past b6c8595: #1087. #1087 adds its v1.2.0 entry to "Behavior Changes by Release" in docs/manuals/07-upgrade-manual.md after the other v1.2.0 entries of main, where this branch has its entry. That is the one conflict. The merge keeps both entries without change: the entry of #1087 first, then the entry of this branch, before the v1.1.0 entries. No other file has changes on both sides.
Changes since the last review
docs/manuals/07-upgrade-manual.md, where this PR has its entry. That is the one conflict. The merge keeps both entries without change: the entry of fix(storage-sqlite): keep each partition key in one parallel Scan segment #1087 first, then the entry of this PR, above the v1.1.0 entries. No other file has changes on both sides, and the lines that this PR changes against main are the same before and after the merge. The gates on cae2363:cargo +1.97.0 fmt --all -- --checkis clean..github/workflows/clippy.ymlwith-D warnings, on the whole workspace as CI runs them, are clean.cargo test -p extenddb-wasm-adapterpasses, with itsparitycorpus test.cargo test -p extenddb-storage-postgres --test doc_version_literalspasses.tests/test_binary_base64.py,tests/test_query_value_shapes.pyandtests/test_query_leading_keys_values.pypassed 177 tests each.python3 -m pytest --collect-only -qcollects 7403 tests intests/and 820 intests/pythonwith no error.tests/test_binary_base64.py, under a comment with the date. The unit tablea_value_that_is_not_base64_gets_the_service_textholds 14 values that the file did not have:AA==,AAA=,=,Y=,!=,===,A==,YR=,=====,======,====,A===,AB==andAAB=. The unit test also checks aBSwithYQ==and!!!!, which had no row either. DynamoDB answered each of them on 20 November 2026, between 17:14 and 17:15 UTC, as the second table of Why gives. Now each of the 50 values of the unit table has a row in the file, which has 62 rows, 54 of them PutItem.cargo +1.97.0 fmt --all -- --checkis clean..github/workflows/clippy.ymlwith-D warnings, on the whole workspace as CI runs them, are clean.cargo +1.94.0 check --all-targetsis clean onextenddb-coreandextenddb-engine.cargo test -p extenddb-wasm-adapterpasses, with itsparitycorpus test.cargo test -p extenddb-storage-postgres --test doc_version_literalspasses..github/workflows/wasm.ymlis clean.tests/test_binary_base64.py,tests/test_query_value_shapes.py,tests/test_query_leading_keys_values.py,tests/test_partiql_requests.pyandtests/test_attribute_value_validation.pypassed 408 tests each.python3 -m pytest --collect-only -qcollects 7366 tests intests/and 820 intests/pythonwith no error.What
For a
Bvalue or aBSmember that does not decode as base64, ExtendDB now sends DynamoDB's text in the SerializationException. Before this change, the text was "Start of structure or map found where not expected: invalid base64: " and the decoder's error.decode_base64incrates/core/src/types/attribute_value.rsdecodes with the sameSTANDARDdecoder as before, so the values that decode do not change. For a value that does not decode, it gives DynamoDB's text by the length of the value in UTF-8 bytes:Buffer is too short for base64 encoding==Base64 encoded length is expected a multiple of 4 bytes but found: <length>=characters is in[A-Za-z0-9+/]Invalid last non-pad Base64 character dectected(DynamoDB's spelling)The helper replaces three copies of
invalid base64: {e}: theBarm offrom_descriptor,binary_set, andcheck_base64incrates/core/src/partiql/params.rs. This PR deletescheck_base64.serialization_exceptionincrates/engine/src/lib.rssends these texts without the "Start of structure or map found where not expected: " prefix, and an empty text as no message. Other texts keep the prefix.deserialize_error, the PutItem read and the PartiQL parameter check call it.In the tests,
client_postintests/raw_signed_request.pyreplaces_raw_queryoftests/test_query_value_shapes.py. The new filetests/test_binary_base64.pyuses it, and so doestests/test_query_leading_keys_values.py.The v1.2.0 entry "a
Bvalue that does not decode gets theSerializationExceptiontext of DynamoDB" indocs/manuals/07-upgrade-manual.mdgives the change for an upgrade.The issue measured its three Query requests on the branch of #544, which was the base of this PR until #544 merged. On main at deed346, before #544, they got a ValidationException.
Why
Fixes #1189
DynamoDB's answers, measured in us-east-1 on 20 November 2026, each request twice with the same answer both times. The 49 requests went to a table that does not exist. There were 41 PutItem, 1 GetItem, 5 Query and 2 ExecuteStatement requests, each with a
Bvalue or aBSmember. The 5 Query requests include the 3 requests of the issue.Bvaluesa,Y,!Buffer is too short for base64 encoding!!,YR,é(2 bytes in UTF-8)Base64 encoded length is expected a multiple of 4 bytes but found: 2abcde,YQ==and a newline,Y Q==... found: 5Y===,YR==,YWJjYR==,YWF=,YWJj====Invalid last non-pad Base64 character dectected!!!!,YQ==YQ==,-_-_,YQ=A,!!==,YWJ!,éé,😀YWJj,YQ==,YWE=The text is the same for a value in a
BS, anMor anL.Later on 20 November 2026, between 17:14 and 17:15 UTC, 16 more PutItem requests went to a table that does not exist. Each request went out twice and got the same answer both times:
Bvalues=Buffer is too short for base64 encodingY=,!=... found: 2===,A==,YR=... found: 3=====... found: 5======... found: 6====,A===,AB==,AAB=Invalid last non-pad Base64 character dectected==, and aBSwithYQ==and!!!!AA==,AAA=On 25 November 2026, a PutItem with
//==and one with++==gotInvalid last non-pad Base64 character dectected, each sent twice.tests/test_binary_base64.pyhas a row for each request of the two tables and of 25 November. The exceptions are the five values that DynamoDB reads, which "Not in this PR" names.ExtendDB on #544 gave 3 of the 49 requests DynamoDB's answer: the 3 values that decode. With this change, 44 of the 49 get it, and so do the 16 later requests and the 2 of 25 November.
Conflicts
On 4 December 2026,
git merge-treecompared cae2363 and main with each of the 221 open PRs. This PR adds a conflict with seven of them:crates/engine/src/put_item.rs. fix(expression): operator cap, syntax error wording, PutItem map keys #558 replaces the PutItem read closure that this PR changes. On a rebase, take fix(expression): operator cap, syntax error wording, PutItem map keys #558's side: its read callscrate::deserialize_error, which sends these texts.crates/core/src/partiql/params.rs. fix(server): read request members in the client's order on every build #781 conflicts with main in the imports of that file already, and this PR adds two conflict hunks there with each of them. Both movecheck_typesandcheck_base64tocrates/core/src/serde_helpers.rs. On a rebase, make the movedcheck_typescalldecode_base64, and dropcheck_base64. Otherwise a copy of the old text comes back.tests/raw_signed_request.py. Each adds a function or a docstring sentence at the place where this PR addsclient_post. On a rebase, keep both.crates/core/src/partiql/params.rs. fix(core): refuse a null element of an L or a null member of an M #1437 adds an import ofcrate::serde_helpersnext touse crate::types::AttributeValue;, and this PR addsdecode_base64to that line. On a rebase, keep both imports.crates/core/src/types/mod.rs. fix(core): read each ExclusiveStartKey value's descriptors as DynamoDB does #1444 addspub(crate) use attribute_value::from_descriptor;above thepub use attribute_value::{...}line, and this PR addsdecode_base64andis_base64_refusalto that line. On a rebase, keep both.The v1.2.0 entry sits below the v1.2.0 entries of main in "Behavior Changes by Release" in
docs/manuals/07-upgrade-manual.md, above the v1.1.0 entries. Other open PRs add their entries at the same place. Whichever PR merges second keeps both entries.Not in this PR
DynamoDB accepts
YQ,YQ=,Y=Q=,YWJjZAandYWJjZA=, and the decoder refuses them (#1258). With this change, ExtendDB still refuses them, with the text of their length or with no message.Testing done
All runs below are on 7f2465d, the head before the merges of main. "Changes since the last review" gives the runs on the commits since the last review.
cargo +1.97.0 test -p extenddb-core --lib: 1147 passed, 1 ignored.cargo +1.97.0 test -p extenddb-engine --lib: 928 passed.cargo +1.97.0 clippy -p extenddb-core -p extenddb-engine --all-targets -- -D warnings, the same forextenddb-enginewith--features extenddb-engine/backup-test-hooks, the same forextenddb-corewith--no-default-features,cargo +1.91.1 check -p extenddb-core -p extenddb-engine --all-targetsandcargo +1.97.0 fmt --all -- --checkare clean.cargo +1.97.0 clippy --locked -p extenddb-wasm-adapter --lib --release --target wasm32-unknown-unknown -- -D warnings, is clean.a_value_that_is_not_base64_gets_the_service_textholds 50 values. Each value goes throughdecode_base64, and through the deserializer as aB, aBSmember, and a value in anMand anL. Withdecode_base64changed back to the old text, this test and theparams.rstesta_value_of_the_wrong_json_type_is_found_ahead_of_any_other_problemfail. With/left out of the last character rule, the test fails at//==, and with+left out, at++==.tests/test_binary_base64.py(47 rows),tests/test_query_value_shapes.py,tests/test_query_leading_keys_values.py,tests/test_partiql_requests.pyandtests/test_attribute_value_validation.pypassed 393 tests.python3 -m pytest --collect-only -qcollects 7013 tests intests/and 672 intests/pythonwith no error.The line counts count the Python files and the Rust lines of an inline test module as tests. At cae2363 against main: production +58 -30, tests +261 -34, docs +14 -0.
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
Breaking changes
A request with a
Bvalue or aBSmember that does not decode still gets a SerializationException. Its message is now DynamoDB's text, or no message. Before, the message was "Start of structure or map found where not expected: invalid base64: " and the decoder's error. A client that reads the old text gets the new one. The values that decode and the stored data do not change. The v1.2.0 entry ofdocs/manuals/07-upgrade-manual.mdgives the change.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.