From 0aee1d13b7d7285fc10a5099f7d5863334506a5a Mon Sep 17 00:00:00 2001 From: Rishav karanjit Date: Fri, 31 May 2024 08:56:34 -0700 Subject: [PATCH 1/3] chore(release): 3.5.0 (#1074) * chore(release): 3.5.0 ## [3.5.0](https://github.com/aws/aws-database-encryption-sdk-dynamodb/compare/v3.4.0...v3.5.0) (2024-05-30) ### Features * **DynamoDbEncryption:** Add GetEncryptedDataKeyDescription operation ([#856](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/856)) ([8f8471a](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/8f8471a479d9e7526dd8aaa6f34c906d2a0e2dbb)) * improve verification ([#1020](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1020)) ([cbde4ef](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/cbde4efbd83c57bbbfb96358219dd421141f1da3)) * simplify structured encryption ([#866](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/866)) ([a70a569](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/a70a569d632d051710cfeb37ce27c8785bdba7c2)) ### Maintenance * allow Legacy to use subclass of DynamoDBEncryptor ([#1073](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1073)) ([135acd9](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/135acd9871698e76228d6c3ce925bcf589df39c6)) * bump MPL to 1.4 ([#1067](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1067)) ([51bbab5](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/51bbab5589a5db611a3b7564a1c9703fb0de1a23)) * **Java-Release:** update release commands and use SNAPSHOT builds ([#995](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/995)) ([ac9b79e](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/ac9b79eb18e1904962223e6add153fd49a0f188e)) * reformat and enforce formatting ([#1035](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1035)) ([8a76a9d](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/8a76a9db2e6427b46748b07e654edaf855cd4338)) * verify with Dafny 4.6 ([#1072](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1072)) ([9db6e78](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/9db6e78ee01583dd04238252c939277636fc06ad)) --- CHANGELOG.md | 16 ++++++++++++++++ DynamoDbEncryption/runtimes/net/AssemblyInfo.cs | 2 +- .../runtimes/net/DynamoDbEncryption.csproj | 2 +- Makefile | 2 +- project.properties | 2 +- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c2f1af75..38ddd5b64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [3.5.0](https://github.com/aws/aws-database-encryption-sdk-dynamodb/compare/v3.4.0...v3.5.0) (2024-05-30) + +### Features + +- **DynamoDbEncryption:** Add GetEncryptedDataKeyDescription operation ([#856](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/856)) ([8f8471a](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/8f8471a479d9e7526dd8aaa6f34c906d2a0e2dbb)) +- Bump MPL to 1.4 ([#1067](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1067)) ([51bbab5](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/51bbab5589a5db611a3b7564a1c9703fb0de1a23)). This provides three new KMSConfiguration options when constructing a KeyStore (see https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-hierarchical-keyring.html). To KmsKeyArn are added KmsMRKeyArn, Discovery and MrDiscovery. + +### Maintenance + +- improve verification ([#1020](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1020)) ([cbde4ef](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/cbde4efbd83c57bbbfb96358219dd421141f1da3)) +- simplify structured encryption ([#866](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/866)) ([a70a569](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/a70a569d632d051710cfeb37ce27c8785bdba7c2)) +- allow Legacy to use subclass of DynamoDBEncryptor ([#1073](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1073)) ([135acd9](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/135acd9871698e76228d6c3ce925bcf589df39c6)) +- **Java-Release:** update release commands and use SNAPSHOT builds ([#995](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/995)) ([ac9b79e](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/ac9b79eb18e1904962223e6add153fd49a0f188e)) +- reformat and enforce formatting ([#1035](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1035)) ([8a76a9d](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/8a76a9db2e6427b46748b07e654edaf855cd4338)) +- verify with Dafny 4.6 ([#1072](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1072)) ([9db6e78](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/9db6e78ee01583dd04238252c939277636fc06ad)) + ## [3.4.0](https://github.com/aws/aws-database-encryption-sdk-dynamodb/compare/v3.3.0...v3.4.0) (2024-04-30) ### Notes diff --git a/DynamoDbEncryption/runtimes/net/AssemblyInfo.cs b/DynamoDbEncryption/runtimes/net/AssemblyInfo.cs index d7de01780..27c94053d 100644 --- a/DynamoDbEncryption/runtimes/net/AssemblyInfo.cs +++ b/DynamoDbEncryption/runtimes/net/AssemblyInfo.cs @@ -3,5 +3,5 @@ [assembly: AssemblyTitle("AWS.Cryptography.DbEncryptionSDK.DynamoDb")] // This should be kept in sync with the version number in MPL.csproj -[assembly: AssemblyVersion("3.4.0")] +[assembly: AssemblyVersion("3.5.0")] diff --git a/DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj b/DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj index 4f22b5d57..19227f499 100644 --- a/DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj +++ b/DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj @@ -5,7 +5,7 @@ false true - 3.4.0 + 3.5.0 AWS.Cryptography.DbEncryptionSDK.DynamoDb AWS.Cryptography.DbEncryptionSDK.DynamoDb diff --git a/Makefile b/Makefile index c1806faab..be1c87250 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ generate_properties_file: "; setup_semantic_release: - npm i --no-save semantic-release @semantic-release/changelog semantic-release-replace-plugin conventional-changelog-conventionalcommits @semantic-release/git + npm i --no-save semantic-release @semantic-release/changelog semantic-release-replace-plugin conventional-changelog-conventionalcommits@7.0.2 @semantic-release/git run_semantic_release: npx semantic-release --no-ci diff --git a/project.properties b/project.properties index 010f6a408..e1db77aed 100644 --- a/project.properties +++ b/project.properties @@ -1,4 +1,4 @@ -projectJavaVersion=3.4.0-SNAPSHOT +projectJavaVersion=3.5.0 mplDependencyJavaVersion=1.4.0 dafnyRuntimeJavaVersion=4.2.0 smithyDafnyJavaConversionVersion=0.1 From 6f2825e198c84a5b20d50e49188b5d9004a1b71a Mon Sep 17 00:00:00 2001 From: Andrew Jewell <107044381+ajewellamz@users.noreply.github.com> Date: Tue, 4 Jun 2024 11:53:24 -0400 Subject: [PATCH 2/3] chore: update project.properties to be SNAPSHOT (#1087) --- project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.properties b/project.properties index e1db77aed..2d56d3114 100644 --- a/project.properties +++ b/project.properties @@ -1,4 +1,4 @@ -projectJavaVersion=3.5.0 +projectJavaVersion=3.5.0-SNAPSHOT mplDependencyJavaVersion=1.4.0 dafnyRuntimeJavaVersion=4.2.0 smithyDafnyJavaConversionVersion=0.1 From 862420ef12ef1e764327671d839be451a7579bda Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Tue, 4 Jun 2024 15:32:51 -0700 Subject: [PATCH 3/3] chore: Fix nightly build (aside from verification) (#1029) Makes the same changes around avoiding direct calls to instantiate parameterized datatypes in Java code as in https://github.com/aws/aws-cryptographic-material-providers-library/pull/195, plus some CI configuration fixes. Dry runs of nightly builds: * [Library Java tests](https://github.com/aws/aws-database-encryption-sdk-dynamodb/actions/runs/9104958211) * [Java Examples](https://github.com/aws/aws-database-encryption-sdk-dynamodb/actions/runs/9106211948) * [test dotnet](https://github.com/aws/aws-database-encryption-sdk-dynamodb/actions/runs/9100864042) Will leave fixing the verification for a separate PR since this was already a fair bit of work :) --- .github/actions/polymorph_codegen/action.yml | 1 + .github/workflows/ci_examples_java.yml | 9 ++ .github/workflows/ci_test_java.yml | 2 +- .github/workflows/ci_test_net.yml | 2 +- .github/workflows/ci_verification.yml | 2 +- .../src/InternalLegacyOverride.dfy | 37 ++++++ .../legacy/InternalLegacyOverride.java | 106 ++++++++++-------- .../runtimes/net/DynamoDbEncryption.csproj | 26 ++++- project.properties | 1 + 9 files changed, 137 insertions(+), 49 deletions(-) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index f5801d9df..6f7a64fa5 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -116,6 +116,7 @@ runs: make -C submodules/MaterialProviders/AwsCryptographicMaterialProviders setup_prettier make -C submodules/MaterialProviders/ComAmazonawsKms setup_prettier make -C submodules/MaterialProviders/ComAmazonawsDynamodb setup_prettier + make -C submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders setup_prettier - name: Regenerate Java code using smithy-dafny # npx seems to be unavailable on Windows GHA runners, diff --git a/.github/workflows/ci_examples_java.yml b/.github/workflows/ci_examples_java.yml index 31fed0070..15f849ee9 100644 --- a/.github/workflows/ci_examples_java.yml +++ b/.github/workflows/ci_examples_java.yml @@ -60,6 +60,15 @@ jobs: # A && B || C is the closest thing to an if .. then ... else ... or ?: expression the GitHub Actions syntax supports. dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }} + - name: Regenerate code using smithy-dafny if necessary + if: ${{ github.event_name == 'schedule' || inputs.nightly }} + uses: ./.github/actions/polymorph_codegen + with: + dafny: ${{ env.DAFNY_VERSION }} + library: DynamoDbEncryption + diff-generated-code: false + update-and-regenerate-mpl: true + - name: Build and locally deploy dependencies for examples shell: bash working-directory: ./DynamoDbEncryption diff --git a/.github/workflows/ci_test_java.yml b/.github/workflows/ci_test_java.yml index 75f16f491..4a9b44de0 100644 --- a/.github/workflows/ci_test_java.yml +++ b/.github/workflows/ci_test_java.yml @@ -55,7 +55,7 @@ jobs: dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }} - name: Regenerate code using smithy-dafny if necessary - if: ${{ inputs.nightly }} + if: ${{ github.event_name == 'schedule' || inputs.nightly }} uses: ./.github/actions/polymorph_codegen with: dafny: ${{ env.DAFNY_VERSION }} diff --git a/.github/workflows/ci_test_net.yml b/.github/workflows/ci_test_net.yml index 8835ab6b8..a697f596d 100644 --- a/.github/workflows/ci_test_net.yml +++ b/.github/workflows/ci_test_net.yml @@ -60,7 +60,7 @@ jobs: dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }} - name: Regenerate code using smithy-dafny if necessary - if: ${{ inputs.nightly }} + if: ${{ github.event_name == 'schedule' || inputs.nightly }} uses: ./.github/actions/polymorph_codegen with: dafny: ${{ env.DAFNY_VERSION }} diff --git a/.github/workflows/ci_verification.yml b/.github/workflows/ci_verification.yml index 31b53fcae..a9855fd7b 100644 --- a/.github/workflows/ci_verification.yml +++ b/.github/workflows/ci_verification.yml @@ -53,7 +53,7 @@ jobs: dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.6.0' }} - name: Regenerate code using smithy-dafny if necessary - if: ${{ inputs.nightly }} + if: ${{ github.event_name == 'schedule' || inputs.nightly }} uses: ./.github/actions/polymorph_codegen with: dafny: ${{ env.DAFNY_VERSION }} diff --git a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/InternalLegacyOverride.dfy b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/InternalLegacyOverride.dfy index 1078bde53..0747a009f 100644 --- a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/InternalLegacyOverride.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/InternalLegacyOverride.dfy @@ -22,6 +22,43 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencry predicate method {:extern} IsLegacyInput(input: Types.DecryptItemInput) + // The following functions are for the benefit of the extern implementation to call, + // avoiding direct references to generic datatype constructors + // since their calling pattern is different between different versions of Dafny + // (i.e. after 4.2, explicit type descriptors are required). + + static function method CreateBuildSuccess(value: Option): Result, Types.Error> { + Success(value) + } + + static function method CreateBuildFailure(error: Types.Error): Result, Types.Error> { + Failure(error) + } + + static function method CreateInternalLegacyOverrideSome(value: InternalLegacyOverride): Option { + Some(value) + } + + static function method CreateInternalLegacyOverrideNone(): Option { + None + } + + function method CreateEncryptItemSuccess(value: Types.EncryptItemOutput): Result { + Success(value) + } + + function method CreateEncryptItemFailure(error: Types.Error): Result { + Failure(error) + } + + function method CreateDecryptItemSuccess(value: Types.DecryptItemOutput): Result { + Success(value) + } + + function method CreateDecryptItemFailure(error: Types.Error): Result { + Failure(error) + } + } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/java/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/internaldafny/legacy/InternalLegacyOverride.java b/DynamoDbEncryption/runtimes/java/src/main/java/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/internaldafny/legacy/InternalLegacyOverride.java index 176d9533a..b7ee420dc 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/java/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/internaldafny/legacy/InternalLegacyOverride.java +++ b/DynamoDbEncryption/runtimes/java/src/main/java/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/internaldafny/legacy/InternalLegacyOverride.java @@ -1,5 +1,19 @@ package software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.legacy; +/** + * This file does *NOT* import a lot of things. + * This is because it is dealing with converting + * between different versions of the same name. + * The DynamoDbItemEncryptor module has Dafny and Java versions + * of the same type. + * This means that `EncryptItemOutput` for example + * needs to be disambiguated between the Dafny version and the Java version. + * In order to make it clearer at each call-site exactly what is happening + * the full import is used. + * IDEs tend to fight this so I'm sorry. + */ + +import StandardLibraryInternal.InternalResult; import Wrappers_Compile.Option; import Wrappers_Compile.Result; import com.amazonaws.services.dynamodbv2.datamodeling.encryption.DynamoDBEncryptor; @@ -16,22 +30,9 @@ import software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.LegacyPolicy; import software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.ToNative; import software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error; -/** - * This file does *NOT* import a lot of things. - * This is because it is dealing with converting - * between different versions of the same name. - * The DynamoDbItemEncryptor module has Dafny and Java versions - * of the same type. - * This means that `EncryptItemOutput` for example - * needs to be disambiguated between the Dafny version and the Java version. - * In order to make it clearer at each call-site exactly what is happening - * the full import is used. - * IDEs tend to fight this so I'm sorry. - */ - import software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoAction; -public class InternalLegacyOverride { +public class InternalLegacyOverride extends _ExternBase_InternalLegacyOverride { private DynamoDBEncryptor encryptor; private Map> actions; @@ -69,7 +70,7 @@ public static TypeDescriptor _typeDescriptor() { ); } - public Boolean IsLegacyInput( + public boolean IsLegacyInput( software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemInput input ) { //= specification/dynamodb-encryption-client/decrypt-item.md#determining-legacy-items @@ -94,7 +95,9 @@ > EncryptItem( ) { // Precondition: Policy MUST allow the caller to encrypt. if (!_policy.is_FORCE__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT()) { - return createFailure("Legacy Policy does not support encrypt."); + return CreateEncryptItemFailure( + createError("Legacy Policy does not support encrypt.") + ); } try { @@ -124,9 +127,9 @@ > EncryptItem( software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.ToDafny.EncryptItemOutput( nativeOutput ); - return Result.create_Success(dafnyOutput); + return CreateEncryptItemSuccess(dafnyOutput); } catch (Exception ex) { - return Result.create_Failure(Error.create_Opaque(ex)); + return CreateEncryptItemFailure(Error.create_Opaque(ex)); } } @@ -146,7 +149,9 @@ > DecryptItem( !_policy.is_FORCE__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT() && !_policy.is_FORBID__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT() ) { - return createFailure("Legacy Policy does not support decrypt."); + return CreateDecryptItemFailure( + createError("Legacy Policy does not support decrypt.") + ); } try { Map< @@ -175,9 +180,9 @@ > DecryptItem( software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.ToDafny.DecryptItemOutput( nativeOutput ); - return Result.create_Success(dafnyOutput); + return CreateDecryptItemSuccess(dafnyOutput); } catch (Exception ex) { - return Result.create_Failure(Error.create_Opaque(ex)); + return CreateDecryptItemFailure(Error.create_Opaque(ex)); } } @@ -186,7 +191,7 @@ public static Result, Error> Build( ) { // Check for early return (Postcondition): If there is no legacyOverride there is nothing to do. if (encryptorConfig.dtor_legacyOverride().is_None()) { - return Result.create_Success(Option.create_None()); + return CreateBuildSuccess(CreateInternalLegacyOverrideNone()); } final software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.LegacyOverride legacyOverride = encryptorConfig.dtor_legacyOverride().dtor_value(); @@ -198,43 +203,48 @@ public static Result, Error> Build( // Precondition: The encryptor MUST be a DynamoDBEncryptor if (!isDynamoDBEncryptor(maybeEncryptor)) { - return createFailure("Legacy encryptor is not supported"); + return CreateBuildFailure( + createError("Legacy encryptor is not supported") + ); } // Preconditions: MUST be able to create valid encryption context - final Result maybeEncryptionContext = + final InternalResult maybeEncryptionContext = legacyEncryptionContext(encryptorConfig); - if (maybeEncryptionContext.is_Failure()) { - return Result.create_Failure(maybeEncryptionContext.dtor_error()); + if (maybeEncryptionContext.isFailure()) { + return CreateBuildFailure(maybeEncryptionContext.error()); } // Precondition: All actions MUST be supported types - final Result>, Error> maybeActions = - legacyActions(legacyOverride.dtor_attributeActionsOnEncrypt()); - if (maybeActions.is_Failure()) { - return Result.create_Failure(maybeEncryptionContext.dtor_error()); + final InternalResult< + Map>, + Error + > maybeActions = legacyActions( + legacyOverride.dtor_attributeActionsOnEncrypt() + ); + if (maybeActions.isFailure()) { + return CreateBuildFailure(maybeEncryptionContext.error()); } final InternalLegacyOverride internalLegacyOverride = new InternalLegacyOverride( (DynamoDBEncryptor) maybeEncryptor, - maybeActions.dtor_value(), - maybeEncryptionContext.dtor_value(), + maybeActions.value(), + maybeEncryptionContext.value(), legacyOverride.dtor_policy() ); - return Result.create_Success(Option.create_Some(internalLegacyOverride)); + return CreateBuildSuccess( + CreateInternalLegacyOverrideSome(internalLegacyOverride) + ); } // Everything below this point is an implementation detail - public static Result createFailure(String message) { + public static Error createError(String message) { final DafnySequence dafnyMessage = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( message ); - final Error dafnyEx = Error.create_DynamoDbItemEncryptorException( - dafnyMessage - ); - return Result.create_Failure(dafnyEx); + return Error.create_DynamoDbItemEncryptorException(dafnyMessage); } public static boolean isDynamoDBEncryptor( @@ -253,7 +263,10 @@ public static DafnySequence ToDafnyString(String s) { ); } - public static Result legacyEncryptionContext( + public static InternalResult< + EncryptionContext, + Error + > legacyEncryptionContext( software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DynamoDbItemEncryptorConfig config ) { try { @@ -272,13 +285,16 @@ public static Result legacyEncryptionContext( .build() : encryptionContextBuilder.build(); - return Result.create_Success(encryptionContext); + return InternalResult.success(encryptionContext); } catch (Exception ex) { - return Result.create_Failure(Error.create_Opaque(ex)); + return InternalResult.failure(Error.create_Opaque(ex)); } } - public static Result>, Error> legacyActions( + public static InternalResult< + Map>, + Error + > legacyActions( DafnyMap< ? extends DafnySequence, ? extends CryptoAction @@ -311,14 +327,14 @@ public static Result>, Error> legacyActions( } }; attributeActionsOnEncrypt.forEach(buildLegacyActions); - return Result.create_Success(legacyActions); + return InternalResult.success(legacyActions); } catch (IllegalArgumentException ex) { final Error dafnyEx = Error.create_DynamoDbItemEncryptorException( ToDafnyString(ex.getMessage()) ); - return Result.create_Failure(dafnyEx); + return InternalResult.failure(dafnyEx); } catch (Exception ex) { - return Result.create_Failure(Error.create_Opaque(ex)); + return InternalResult.failure(Error.create_Opaque(ex)); } } diff --git a/DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj b/DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj index 19227f499..97376ee32 100644 --- a/DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj +++ b/DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj @@ -31,11 +31,35 @@ CS0105,CS0618 + + + + $([System.IO.File]::ReadAllText('$(MSBuildProjectDirectory)/../../../project.properties')) + + + $([System.Text.RegularExpressions.Regex]::Split("$(projectProperties)", "dafnyVersion=")[1]) + + + $([System.Text.RegularExpressions.Regex]::Split("$(dropBeforeDafnyVersionProperty)", "\n")[1]) + + - +