Skip to content

Commit

Permalink
chore: Uint8Array map was not traversing maps and unions (#27071)
Browse files Browse the repository at this point in the history
We were finding blob parameter types in structures and lists, but had forgotten about maps and unions (such as used in DynamoDB).

Include those as well.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
rix0rrr authored and Mike Wrighton committed Sep 14, 2023
1 parent c6fce3a commit 7a11bf0
Show file tree
Hide file tree
Showing 113 changed files with 1,471 additions and 255 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -30945,6 +30945,72 @@ var init_parameter_types = __esm({
"InlineChunk"
]
},
"clouddirectory": {
"addfacettoobject": [
"ObjectAttributeList.*.Value.BinaryValue"
],
"attachtypedlink": [
"Attributes.*.Value.BinaryValue"
],
"batchread": [
"Operations.*.GetLinkAttributes.TypedLinkSpecifier.IdentityAttributeValues.*.Value.BinaryValue",
"Operations.*.ListIncomingTypedLinks.FilterAttributeRanges.*.Range.EndValue.BinaryValue",
"Operations.*.ListIncomingTypedLinks.FilterAttributeRanges.*.Range.StartValue.BinaryValue",
"Operations.*.ListIndex.RangesOnIndexedValues.*.Range.EndValue.BinaryValue",
"Operations.*.ListIndex.RangesOnIndexedValues.*.Range.StartValue.BinaryValue",
"Operations.*.ListOutgoingTypedLinks.FilterAttributeRanges.*.Range.EndValue.BinaryValue",
"Operations.*.ListOutgoingTypedLinks.FilterAttributeRanges.*.Range.StartValue.BinaryValue"
],
"batchwrite": [
"Operations.*.AddFacetToObject.ObjectAttributeList.*.Value.BinaryValue",
"Operations.*.AttachTypedLink.Attributes.*.Value.BinaryValue",
"Operations.*.CreateObject.ObjectAttributeList.*.Value.BinaryValue",
"Operations.*.DetachTypedLink.TypedLinkSpecifier.IdentityAttributeValues.*.Value.BinaryValue",
"Operations.*.UpdateLinkAttributes.AttributeUpdates.*.AttributeAction.AttributeUpdateValue.BinaryValue",
"Operations.*.UpdateLinkAttributes.TypedLinkSpecifier.IdentityAttributeValues.*.Value.BinaryValue",
"Operations.*.UpdateObjectAttributes.AttributeUpdates.*.ObjectAttributeAction.ObjectAttributeUpdateValue.BinaryValue"
],
"createfacet": [
"Attributes.*.AttributeDefinition.DefaultValue.BinaryValue"
],
"createobject": [
"ObjectAttributeList.*.Value.BinaryValue"
],
"createtypedlinkfacet": [
"Facet.Attributes.*.DefaultValue.BinaryValue"
],
"detachtypedlink": [
"TypedLinkSpecifier.IdentityAttributeValues.*.Value.BinaryValue"
],
"getlinkattributes": [
"TypedLinkSpecifier.IdentityAttributeValues.*.Value.BinaryValue"
],
"listincomingtypedlinks": [
"FilterAttributeRanges.*.Range.EndValue.BinaryValue",
"FilterAttributeRanges.*.Range.StartValue.BinaryValue"
],
"listindex": [
"RangesOnIndexedValues.*.Range.EndValue.BinaryValue",
"RangesOnIndexedValues.*.Range.StartValue.BinaryValue"
],
"listoutgoingtypedlinks": [
"FilterAttributeRanges.*.Range.EndValue.BinaryValue",
"FilterAttributeRanges.*.Range.StartValue.BinaryValue"
],
"updatefacet": [
"AttributeUpdates.*.Attribute.AttributeDefinition.DefaultValue.BinaryValue"
],
"updatelinkattributes": [
"AttributeUpdates.*.AttributeAction.AttributeUpdateValue.BinaryValue",
"TypedLinkSpecifier.IdentityAttributeValues.*.Value.BinaryValue"
],
"updateobjectattributes": [
"AttributeUpdates.*.ObjectAttributeAction.ObjectAttributeUpdateValue.BinaryValue"
],
"updatetypedlinkfacet": [
"AttributeUpdates.*.Attribute.DefaultValue.BinaryValue"
]
},
"cloudfront": {
"createfunction": [
"FunctionCode"
Expand Down Expand Up @@ -31023,6 +31089,106 @@ var init_parameter_types = __esm({
"CertificateWallet"
]
},
"dynamodb": {
"batchexecutestatement": [
"Statements.*.Parameters.*.B",
"Statements.*.Parameters.*.BS.*"
],
"batchgetitem": [
"RequestItems.*.Keys.*.*.B",
"RequestItems.*.Keys.*.*.BS.*"
],
"batchwriteitem": [
"RequestItems.*.*.DeleteRequest.Key.*.B",
"RequestItems.*.*.DeleteRequest.Key.*.BS.*",
"RequestItems.*.*.PutRequest.Item.*.B",
"RequestItems.*.*.PutRequest.Item.*.BS.*"
],
"deleteitem": [
"Expected.*.AttributeValueList.*.B",
"Expected.*.AttributeValueList.*.BS.*",
"Expected.*.Value.B",
"Expected.*.Value.BS.*",
"ExpressionAttributeValues.*.B",
"ExpressionAttributeValues.*.BS.*",
"Key.*.B",
"Key.*.BS.*"
],
"executestatement": [
"Parameters.*.B",
"Parameters.*.BS.*"
],
"executetransaction": [
"TransactStatements.*.Parameters.*.B",
"TransactStatements.*.Parameters.*.BS.*"
],
"getitem": [
"Key.*.B",
"Key.*.BS.*"
],
"putitem": [
"Expected.*.AttributeValueList.*.B",
"Expected.*.AttributeValueList.*.BS.*",
"Expected.*.Value.B",
"Expected.*.Value.BS.*",
"ExpressionAttributeValues.*.B",
"ExpressionAttributeValues.*.BS.*",
"Item.*.B",
"Item.*.BS.*"
],
"query": [
"ExclusiveStartKey.*.B",
"ExclusiveStartKey.*.BS.*",
"ExpressionAttributeValues.*.B",
"ExpressionAttributeValues.*.BS.*",
"KeyConditions.*.AttributeValueList.*.B",
"KeyConditions.*.AttributeValueList.*.BS.*",
"QueryFilter.*.AttributeValueList.*.B",
"QueryFilter.*.AttributeValueList.*.BS.*"
],
"scan": [
"ExclusiveStartKey.*.B",
"ExclusiveStartKey.*.BS.*",
"ExpressionAttributeValues.*.B",
"ExpressionAttributeValues.*.BS.*",
"ScanFilter.*.AttributeValueList.*.B",
"ScanFilter.*.AttributeValueList.*.BS.*"
],
"transactgetitems": [
"TransactItems.*.Get.Key.*.B",
"TransactItems.*.Get.Key.*.BS.*"
],
"transactwriteitems": [
"TransactItems.*.ConditionCheck.ExpressionAttributeValues.*.B",
"TransactItems.*.ConditionCheck.ExpressionAttributeValues.*.BS.*",
"TransactItems.*.ConditionCheck.Key.*.B",
"TransactItems.*.ConditionCheck.Key.*.BS.*",
"TransactItems.*.Delete.ExpressionAttributeValues.*.B",
"TransactItems.*.Delete.ExpressionAttributeValues.*.BS.*",
"TransactItems.*.Delete.Key.*.B",
"TransactItems.*.Delete.Key.*.BS.*",
"TransactItems.*.Put.ExpressionAttributeValues.*.B",
"TransactItems.*.Put.ExpressionAttributeValues.*.BS.*",
"TransactItems.*.Put.Item.*.B",
"TransactItems.*.Put.Item.*.BS.*",
"TransactItems.*.Update.ExpressionAttributeValues.*.B",
"TransactItems.*.Update.ExpressionAttributeValues.*.BS.*",
"TransactItems.*.Update.Key.*.B",
"TransactItems.*.Update.Key.*.BS.*"
],
"updateitem": [
"AttributeUpdates.*.Value.B",
"AttributeUpdates.*.Value.BS.*",
"Expected.*.AttributeValueList.*.B",
"Expected.*.AttributeValueList.*.BS.*",
"Expected.*.Value.B",
"Expected.*.Value.BS.*",
"ExpressionAttributeValues.*.B",
"ExpressionAttributeValues.*.BS.*",
"Key.*.B",
"Key.*.BS.*"
]
},
"ebs": {
"putsnapshotblock": [
"BlockData"
Expand Down Expand Up @@ -31063,6 +31229,11 @@ var init_parameter_types = __esm({
"Records.*.Data"
]
},
"frauddetector": {
"geteventprediction": [
"externalModelEndpointDataBlobs.*.byteBuffer"
]
},
"gamelift": {
"createscript": [
"ZipFile"
Expand All @@ -31086,10 +31257,12 @@ var init_parameter_types = __esm({
},
"glue": {
"updatecolumnstatisticsforpartition": [
"ColumnStatisticsList.*.StatisticsData.DecimalColumnStatisticsData.MaximumValue.UnscaledValue"
"ColumnStatisticsList.*.StatisticsData.DecimalColumnStatisticsData.MaximumValue.UnscaledValue",
"ColumnStatisticsList.*.StatisticsData.DecimalColumnStatisticsData.MinimumValue.UnscaledValue"
],
"updatecolumnstatisticsfortable": [
"ColumnStatisticsList.*.StatisticsData.DecimalColumnStatisticsData.MaximumValue.UnscaledValue"
"ColumnStatisticsList.*.StatisticsData.DecimalColumnStatisticsData.MaximumValue.UnscaledValue",
"ColumnStatisticsList.*.StatisticsData.DecimalColumnStatisticsData.MinimumValue.UnscaledValue"
]
},
"greengrass": {
Expand Down Expand Up @@ -31189,7 +31362,8 @@ var init_parameter_types = __esm({
"Recipient.AttestationDocument"
],
"importkeymaterial": [
"EncryptedKeyMaterial"
"EncryptedKeyMaterial",
"ImportToken"
],
"reencrypt": [
"CiphertextBlob"
Expand Down Expand Up @@ -31235,6 +31409,9 @@ var init_parameter_types = __esm({
],
"recognizeutterance": [
"inputStream"
],
"startconversation": [
"requestEventStream.AudioInputEvent.audioChunk"
]
},
"lookoutvision": {
Expand All @@ -31250,6 +31427,12 @@ var init_parameter_types = __esm({
"Body"
]
},
"medical-imaging": {
"updateimagesetmetadata": [
"updateImageSetMetadataUpdates.DICOMUpdates.removableAttributes",
"updateImageSetMetadataUpdates.DICOMUpdates.updatableAttributes"
]
},
"mobiletargeting": {
"sendmessages": [
"MessageRequest.MessageConfiguration.EmailMessage.RawEmail.Data"
Expand All @@ -31269,9 +31452,18 @@ var init_parameter_types = __esm({
"AssetBundleImportSource.Body"
]
},
"rds-data": {
"batchexecutestatement": [
"parameterSets.*.*.value.blobValue"
],
"executestatement": [
"parameters.*.value.blobValue"
]
},
"rekognition": {
"comparefaces": [
"SourceImage.Bytes"
"SourceImage.Bytes",
"TargetImage.Bytes"
],
"detectcustomlabels": [
"Image.Bytes"
Expand Down Expand Up @@ -31305,6 +31497,9 @@ var init_parameter_types = __esm({
],
"updatedatasetentries": [
"Changes.GroundTruth"
],
"startfacelivenesssession": [
"LivenessRequestStream.VideoEvent.VideoChunk"
]
},
"s3": {
Expand Down Expand Up @@ -31355,6 +31550,28 @@ var init_parameter_types = __esm({
"payload"
]
},
"sns": {
"publish": [
"MessageAttributes.*.BinaryValue"
],
"publishbatch": [
"PublishBatchRequestEntries.*.MessageAttributes.*.BinaryValue"
]
},
"sqs": {
"sendmessage": [
"MessageAttributes.*.BinaryListValues.*",
"MessageAttributes.*.BinaryValue",
"MessageSystemAttributes.*.BinaryListValues.*",
"MessageSystemAttributes.*.BinaryValue"
],
"sendmessagebatch": [
"Entries.*.MessageAttributes.*.BinaryListValues.*",
"Entries.*.MessageAttributes.*.BinaryValue",
"Entries.*.MessageSystemAttributes.*.BinaryListValues.*",
"Entries.*.MessageSystemAttributes.*.BinaryValue"
]
},
"ssm": {
"registertaskwithmaintenancewindow": [
"TaskInvocationParameters.Lambda.Payload"
Expand Down Expand Up @@ -31390,6 +31607,17 @@ var init_parameter_types = __esm({
"Document.Bytes"
]
},
"transcribe": {
"startcallanalyticsstreamtranscription": [
"AudioStream.AudioEvent.AudioChunk"
],
"startmedicalstreamtranscription": [
"AudioStream.AudioEvent.AudioChunk"
],
"startstreamtranscription": [
"AudioStream.AudioEvent.AudioChunk"
]
},
"translate": {
"importterminology": [
"TerminologyData.File"
Expand Down Expand Up @@ -31430,7 +31658,11 @@ var init_parameter_types = __esm({
"DeviceTypeAndroid.Logo",
"DeviceTypeIos.Logo",
"DeviceTypeIos.Logo2x",
"DeviceTypeIos.Logo3x"
"DeviceTypeIos.Logo3x",
"DeviceTypeLinux.Logo",
"DeviceTypeOsx.Logo",
"DeviceTypeWeb.Logo",
"DeviceTypeWindows.Logo"
]
}
};
Expand All @@ -31454,8 +31686,14 @@ function coerceToUint8Array(obj, path) {
if (path.length === 0) {
return coerceValueToUint8Array(obj);
}
if (path[0] === "*" && Array.isArray(obj)) {
return obj.map((e) => coerceToUint8Array(e, path.slice(1)));
if (path[0] === "*") {
if (Array.isArray(obj)) {
return obj.map((e) => coerceToUint8Array(e, path.slice(1)));
}
if (obj && typeof obj === "object") {
return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, coerceToUint8Array(value, path.slice(1))]));
}
return obj;
}
if (obj && typeof obj === "object") {
if (path[0] in obj) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "34.0.0",
"files": {
"e2b4766aeeab2b067017ba499fbd35f6183ad52d2f71bc62e0b7c6fe29219c01": {
"03adb2514e02907e0458bec59283658ec529425bd5df38e1194455c65dedf6ff": {
"source": {
"path": "asset.e2b4766aeeab2b067017ba499fbd35f6183ad52d2f71bc62e0b7c6fe29219c01",
"path": "asset.03adb2514e02907e0458bec59283658ec529425bd5df38e1194455c65dedf6ff",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "e2b4766aeeab2b067017ba499fbd35f6183ad52d2f71bc62e0b7c6fe29219c01.zip",
"objectKey": "03adb2514e02907e0458bec59283658ec529425bd5df38e1194455c65dedf6ff.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand All @@ -27,15 +27,15 @@
}
}
},
"138ef46e68c06b10d1d1954083ce1b05447a02cb1291c497797a82ec3d370019": {
"7dc51ef6fb06ebca692ba6e0b9e87a0de8695ceb5ad943c71586731ee9de45dd": {
"source": {
"path": "integ-cognito.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "138ef46e68c06b10d1d1954083ce1b05447a02cb1291c497797a82ec3d370019.json",
"objectKey": "7dc51ef6fb06ebca692ba6e0b9e87a0de8695ceb5ad943c71586731ee9de45dd.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "e2b4766aeeab2b067017ba499fbd35f6183ad52d2f71bc62e0b7c6fe29219c01.zip"
"S3Key": "03adb2514e02907e0458bec59283658ec529425bd5df38e1194455c65dedf6ff.zip"
},
"Handler": "index.handler",
"Role": {
Expand Down
Loading

0 comments on commit 7a11bf0

Please sign in to comment.