You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var updateResult := wClient.UpdateItem(updateInput);
878
+
if writeConfig.config.attributeActionsOnEncrypt[attributeToUpdate] == SE.ENCRYPT_AND_SIGN || writeConfig.config.attributeActionsOnEncrypt[attributeToUpdate] == SE.SIGN_ONLY {
879
+
expect updateResult.Failure?, "UpdateItem should have failed for signed item.";
880
+
// This error is of type DynamoDbEncryptionTransformsException
881
+
// but AWS SDK wraps it into its own type for which customers should be unwrapping.
882
+
// In test vectors, we still have to change the error from AWS SDK to dafny so it turns out to be OpaqueWithText.
883
+
expect updateResult.error.OpaqueWithText?, "Error should have been of type OpaqueWithText";
884
+
var hasDynamoDbEncryptionTransformsException? := String.HasSubString(updateResult.error.objMessage, "Update Expressions forbidden on signed attributes");
885
+
expect hasDynamoDbEncryptionTransformsException?.Some?, "Error might is not be of type DynamoDbEncryptionTransformsException";
var deleteResult := wClient.DeleteItem(deleteInput);
913
+
expect attributeToDelete in writeConfig.config.attributeActionsOnEncrypt, "`attributeToDelete` not found in attributeActionsOnEncrypt of config.";
914
+
if writeConfig.config.attributeActionsOnEncrypt[attributeToDelete] == SE.ENCRYPT_AND_SIGN {
915
+
expect deleteResult.Failure?, "DeleteItem should have failed.";
916
+
// This error is of type DynamoDbEncryptionTransformsException
917
+
// but AWS SDK wraps it into its own type for which customers should be unwrapping.
918
+
// In test vectors, we still have to change the error from AWS SDK to dafny so it turns out to be OpaqueWithText.
919
+
expect deleteResult.error.OpaqueWithText?, "Error should have been of type OpaqueWithText";
920
+
var hasDynamoDbEncryptionTransformsException? := String.HasSubString(deleteResult.error.objMessage, "Condition Expressions forbidden on encrypted attributes");
921
+
expect hasDynamoDbEncryptionTransformsException?.Some?, "Error might is not be of type DynamoDbEncryptionTransformsException";
expect deleteResult.Success?, "DeleteItem should have succeeded.";
924
+
expect deleteResult.value.Attributes.Some?, "DeleteItemOutput should have had some attribute because ReturnValues was setas `ALL_OLD` in DeleteItemInput";
925
+
expect HashName in deleteResult.value.Attributes.value, "Deleted item does not have right partition key:" + HashName;
926
+
expect deleteResult.value.Attributes.value[HashName] == records[i].item[HashName], "Wrong item was deleted.";
927
+
} else {
928
+
expect deleteResult.Failure?, "DeleteItem should have failed.";
929
+
expect deleteResult.error.ConditionalCheckFailedException?, "DeleteItem should have failed with ConditionalCheckFailedException";
var deleteResultForWithoutConditionExpressionCase := wClient.DeleteItem(deleteInputWithoutConditionExpression);
946
+
expect deleteResultForWithoutConditionExpressionCase.Success?, "DeleteItem should have succeeded.";
947
+
expect deleteResultForWithoutConditionExpressionCase.value.Attributes.Some?, "DeleteItemOutput should have had some attribute because ReturnValues was setas `ALL_OLD` in DeleteItemInput";
948
+
if attributeToDelete in records[i].item {
949
+
expect HashName in deleteResultForWithoutConditionExpressionCase.value.Attributes.value, "Deleted item does not have right partition key:" + HashName;
950
+
expect deleteResultForWithoutConditionExpressionCase.value.Attributes.value[HashName] == records[i].item[HashName], "Wrong item was deleted.";
0 commit comments