Skip to content

Commit 652299c

Browse files
m
1 parent 736b2fe commit 652299c

File tree

5 files changed

+38
-7
lines changed

5 files changed

+38
-7
lines changed

TestVectors/Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ TRANSPILE_TESTS_IN_RUST=1
77
include ../SharedMakefile.mk
88

99
PROJECT_SERVICES := \
10-
DDBEncryption
10+
DDBEncryption \
11+
WrappedDynamoDbItemEncryptor
1112

1213
MAIN_SERVICE_FOR_RUST := DDBEncryption
1314

1415
SMITHY_MODEL_ROOT := $(PROJECT_ROOT)/DynamoDbEncryption/dafny/DynamoDbEncryption/Model
1516
OUTPUT_LOCAL_SERVICE_DDBEncryption := --local-service-test
17+
OUTPUT_LOCAL_SERVICE_WrappedDynamoDbItemEncryptor := --local-service-test
1618

1719
SERVICE_NAMESPACE_DDBEncryption=aws.cryptography.dbEncryptionSdk.dynamoDb
20+
SERVICE_NAMESPACE_WrappedDynamoDbItemEncryptor=aws.cryptography.dbEncryptionSdk.dynamoDb.itemEncryptor
1821

1922
MAX_RESOURCE_COUNT=10000000
2023
# Order is important
@@ -81,6 +84,17 @@ SERVICE_DEPS_DDBEncryption := \
8184
DynamoDbEncryption/dafny/DynamoDbEncryption \
8285
submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders \
8386

87+
SERVICE_DEPS_WrappedDynamoDbItemEncryptor := \
88+
submodules/MaterialProviders/AwsCryptographyPrimitives \
89+
submodules/MaterialProviders/ComAmazonawsKms \
90+
submodules/MaterialProviders/ComAmazonawsDynamodb \
91+
submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders \
92+
submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore \
93+
DynamoDbEncryption/dafny/StructuredEncryption \
94+
DynamoDbEncryption/dafny/DynamoDbEncryption \
95+
DynamoDbEncryption/dafny/DynamoDbItemEncryptor \
96+
submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders \
97+
8498
transpile_implementation_rust: _remove_wrapped_client_rust
8599

86100
_remove_wrapped_client_rust:

TestVectors/dafny/DDBEncryption/src/CreateWrappedItemEncryptor.dfy

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module {:extern} CreateWrappedItemEncryptor {
1313

1414
// The `ensures` clause is copy-pasted from the DynamoDbItemEncryptor client method's `ensures` clause.
1515
method {:extern} CreateWrappedItemEncryptor(config: ENC.DynamoDbItemEncryptorConfig)
16-
returns (output: Result<ENC.IDynamoDbItemEncryptorClient, AwsCryptographyDbEncryptionSdkDynamoDbTypes.Error>)
16+
returns (output: Result<ENC.IDynamoDbItemEncryptorClient, ENC.Error>)
1717
requires config.keyring.Some? ==>
1818
config.keyring.value.ValidState()
1919
requires config.cmm.Some? ==>
@@ -63,8 +63,4 @@ module {:extern} CreateWrappedItemEncryptor {
6363
==>
6464
&& var config := (output.value as DynamoDbItemEncryptor.DynamoDbItemEncryptorClient).config;
6565
&& config.plaintextOverride.FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ?
66-
{
67-
var encryptor :- expect DynamoDbItemEncryptor.DynamoDbItemEncryptor(config);
68-
return Success(encryptor);
69-
}
7066
}

TestVectors/dafny/DDBEncryption/src/JsonConfig.dfy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ module {:options "-functionSyntax:4"} JsonConfig {
351351
plaintextOverride := plaintextOverride
352352
);
353353
var enc : ENC.IDynamoDbItemEncryptorClient :- expect CreateWrappedItemEncryptor.CreateWrappedItemEncryptor(encryptorConfig);
354-
// var enc : ENC.IDynamoDbItemEncryptorClient :- expect DynamoDbItemEncryptor.DynamoDbItemEncryptor(encryptorConfig);
355354
assert enc is DynamoDbItemEncryptor.DynamoDbItemEncryptorClient;
356355
var encr := enc as DynamoDbItemEncryptor.DynamoDbItemEncryptorClient;
357356
return Success(encr);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
4+
include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
5+
include "../src/Index.dfy"
6+
abstract module WrappedAbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorService {
7+
import opened Wrappers
8+
import opened StandardLibrary.UInt
9+
import opened UTF8
10+
import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes
11+
import WrappedService : AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorService
12+
function method WrappedDefaultDynamoDbItemEncryptorConfig(): DynamoDbItemEncryptorConfig
13+
method {:extern} WrappedDynamoDbItemEncryptor(config: DynamoDbItemEncryptorConfig := WrappedDefaultDynamoDbItemEncryptorConfig())
14+
returns (res: Result<IDynamoDbItemEncryptorClient, Error>)
15+
ensures res.Success? ==>
16+
&& fresh(res.value)
17+
&& fresh(res.value.Modifies)
18+
&& fresh(res.value.History)
19+
&& res.value.ValidState()
20+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Empty stub expected by Smithy-Dafny
2+
module WrappedItemEncryptor {}

0 commit comments

Comments
 (0)