Skip to content

Commit

Permalink
Add --local-service-test option and did polymorph
Browse files Browse the repository at this point in the history
  • Loading branch information
rishav-karanjit committed Apr 1, 2024
1 parent 5e6294a commit 0c638cb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SharedMakefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ _polymorph:
$(patsubst %, --dependent-model $(PROJECT_ROOT)/%/Model, $($(service_deps_var))) \
--namespace $($(namespace_var)) \
$(AWS_SDK_CMD) \
$(OUTPUT_LOCAL_SERVICE) \
$(OUTPUT_LOCAL_SERVICE_$(SERVICE)) \
";

# Generates all target runtime code for all namespaces in this project.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierInput;
import software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput;
import software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error;
import software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionInput;
import software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionOutput;
import software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbEncryptionClient;

public class TestDynamoDbEncryption implements IDynamoDbEncryptionClient {
Expand All @@ -38,6 +40,18 @@ public Result<CreateDynamoDbEncryptionBranchKeyIdSupplierOutput, Error> CreateDy
}
}

public Result<GetEncryptedDataKeyDescriptionOutput, Error> GetEncryptedDataKeyDescription(
GetEncryptedDataKeyDescriptionInput dafnyInput) {
software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetEncryptedDataKeyDescriptionInput nativeInput = ToNative.GetEncryptedDataKeyDescriptionInput(dafnyInput);
try {
software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetEncryptedDataKeyDescriptionOutput nativeOutput = this._impl.GetEncryptedDataKeyDescription(nativeInput);
GetEncryptedDataKeyDescriptionOutput dafnyOutput = ToDafny.GetEncryptedDataKeyDescriptionOutput(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}

public interface Builder {
Builder impl(DynamoDbEncryption impl);

Expand Down

0 comments on commit 0c638cb

Please sign in to comment.