Skip to content

Commit daeed8d

Browse files
author
Lucas McDonald
committed
wip
1 parent a113cc4 commit daeed8d

File tree

36 files changed

+1712
-612
lines changed

36 files changed

+1712
-612
lines changed

DynamoDbEncryption/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ PYTHON_DEPENDENCY_MODULE_NAMES := \
123123
--dependency-library-name=aws.cryptography.dbEncryptionSdk.dynamoDb.itemEncryptor=aws_database_encryption_sdk \
124124
--dependency-library-name=aws.cryptography.dbEncryptionSdk.dynamoDb.transforms=aws_database_encryption_sdk \
125125

126+
# Override default test_python to run tox environment for Dafny tests
127+
test_python:
128+
rm -rf runtimes/python/.tox
129+
python3 -m tox -c runtimes/python -e dafnytests --verbose
130+
126131
# Constants for languages that drop extern names (Python, Go)
127132

128133
DYNAMODB_TYPES_FILE_PATH=dafny/DynamoDbEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypes.dfy

DynamoDbEncryption/dafny/DynamoDbEncryption/test/DynamoToStruct.dfy

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,14 @@ module DynamoToStructTest {
376376
//= type=test
377377
//# Entries in a String Set MUST be ordered in ascending [UTF-16 binary order](./string-ordering.md#utf-16-binary-order).
378378
method {:test} TestSortSSAttr() {
379-
var stringSetValue := AttributeValue.SS(["&","。","𐀂"]);
379+
var stringSetValue := AttributeValue.SS(["&","。","\ud800\udc02"]);
380380
// Note that string values are UTF-8 encoded, but sorted by UTF-16 encoding.
381381
var encodedStringSetData := StructuredDataTerminal(value := [
382382
0,0,0,3, // 3 entries in set
383383
0,0,0,1, // 1st entry is 1 byte
384384
0x26, // "&" in UTF-8 encoding
385385
0,0,0,4, // 2nd entry is 4 bytes
386-
0xF0,0x90,0x80,0x82, // "𐀂" in UTF-8 encoding
386+
0xF0,0x90,0x80,0x82, // "\ud800\udc02" in UTF-8 encoding
387387
0,0,0,3, // 3rd entry is 3 bytes
388388
0xEF,0xBD,0xA1 // "。" in UTF-8 encoding
389389
],
@@ -395,7 +395,7 @@ module DynamoToStructTest {
395395

396396
var newStringSetValue := StructuredToAttr(encodedStringSetData);
397397
expect newStringSetValue.Success?;
398-
expect newStringSetValue.value == AttributeValue.SS(["&","𐀂","。"]);
398+
expect newStringSetValue.value == AttributeValue.SS(["&","\ud800\udc02","。"]);
399399
}
400400

401401
//= specification/dynamodb-encryption-client/ddb-attribute-serialization.md#set-entries
@@ -415,11 +415,11 @@ module DynamoToStructTest {
415415

416416
method {:test} TestSetsInListAreSorted() {
417417
var nSetValue := AttributeValue.NS(["2","1","10"]);
418-
var sSetValue := AttributeValue.SS(["&","。","𐀂"]);
418+
var sSetValue := AttributeValue.SS(["&","。","\ud800\udc02"]);
419419
var bSetValue := AttributeValue.BS([[1,0],[1],[2]]);
420420

421421
var sortedNSetValue := AttributeValue.NS(["1","10","2"]);
422-
var sortedSSetValue := AttributeValue.SS(["&","𐀂","。"]);
422+
var sortedSSetValue := AttributeValue.SS(["&","\ud800\udc02","。"]);
423423
var sortedBSetValue := AttributeValue.BS([[1],[1,0],[2]]);
424424

425425
var listValue := AttributeValue.L([nSetValue, sSetValue, bSetValue]);
@@ -444,11 +444,11 @@ module DynamoToStructTest {
444444

445445
method {:test} TestSetsInMapAreSorted() {
446446
var nSetValue := AttributeValue.NS(["2","1","10"]);
447-
var sSetValue := AttributeValue.SS(["&","。","𐀂"]);
447+
var sSetValue := AttributeValue.SS(["&","。","\ud800\udc02"]);
448448
var bSetValue := AttributeValue.BS([[1,0],[1],[2]]);
449449

450450
var sortedNSetValue := AttributeValue.NS(["1","10","2"]);
451-
var sortedSSetValue := AttributeValue.SS(["&","𐀂","。"]);
451+
var sortedSSetValue := AttributeValue.SS(["&","\ud800\udc02","。"]);
452452
var sortedBSetValue := AttributeValue.BS([[1],[1,0],[2]]);
453453

454454
var mapValue := AttributeValue.M(map["keyA" := sSetValue, "keyB" := nSetValue, "keyC" := bSetValue]);
@@ -490,7 +490,7 @@ module DynamoToStructTest {
490490
method {:test} TestSortMapKeys() {
491491
var nullValue := AttributeValue.NULL(true);
492492

493-
var mapValue := AttributeValue.M(map["&" := nullValue, "。" := nullValue, "𐀂" := nullValue]);
493+
var mapValue := AttributeValue.M(map["&" := nullValue, "。" := nullValue, "\ud800\udc02" := nullValue]);
494494

495495
// Note that the string values are encoded as UTF-8, but are sorted according to UTF-16 encoding.
496496
var encodedMapData := StructuredDataTerminal(
@@ -500,7 +500,7 @@ module DynamoToStructTest {
500500
0x26, // "&" UTF-8 encoded
501501
0,0, 0,0,0,0, // null value
502502
0,1, 0,0,0,4, // 2nd key is a string 4 bytes long
503-
0xF0, 0x90, 0x80, 0x82, // "𐀂" UTF-8 encoded
503+
0xF0, 0x90, 0x80, 0x82, // "\ud800\udc02" UTF-8 encoded
504504
0,0, 0,0,0,0, // null value
505505
0,1, 0,0,0,3, // 3rd key is a string 3 bytes long
506506
0xEF, 0xBD, 0xA1, // "。"

DynamoDbEncryption/runtimes/python/pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,35 @@ include = ["**/internaldafny/generated/*.py"]
1414
python = "^3.11.0"
1515
aws-cryptographic-material-providers = { path = "../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/runtimes/python", develop = false}
1616

17+
# Package testing
18+
19+
[tool.poetry.group.test]
20+
optional = true
21+
1722
[tool.poetry.group.test.dependencies]
1823
pytest = "^7.4.0"
24+
pytest-cov = "^6"
25+
26+
# Package release
27+
28+
[tool.poetry.group.release]
29+
optional = true
30+
31+
[tool.poetry.group.release.dependencies]
32+
poetry = "1.8.3"
33+
twine = "5.1.1"
34+
wheel = "0.38.4"
35+
36+
# Package documentation
37+
38+
[tool.poetry.group.docs]
39+
optional = true
40+
41+
[tool.poetry.group.docs.dependencies]
42+
toml = "^0.10.2"
43+
myst-parser = "^4"
44+
sphinx = "^7"
45+
sphinx_rtd_theme = "^2"
1946

2047
[build-system]
2148
requires = ["poetry-core<2.0.0"]

0 commit comments

Comments
 (0)