Skip to content

Commit f766cee

Browse files
authored
chore: Uint8Array map was not traversing maps and unions (#27071)
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*
1 parent dd93b9e commit f766cee

File tree

113 files changed

+1471
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1471
-255
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.03adb2514e02907e0458bec59283658ec529425bd5df38e1194455c65dedf6ff/index.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -30945,6 +30945,72 @@ var init_parameter_types = __esm({
3094530945
"InlineChunk"
3094630946
]
3094730947
},
30948+
"clouddirectory": {
30949+
"addfacettoobject": [
30950+
"ObjectAttributeList.*.Value.BinaryValue"
30951+
],
30952+
"attachtypedlink": [
30953+
"Attributes.*.Value.BinaryValue"
30954+
],
30955+
"batchread": [
30956+
"Operations.*.GetLinkAttributes.TypedLinkSpecifier.IdentityAttributeValues.*.Value.BinaryValue",
30957+
"Operations.*.ListIncomingTypedLinks.FilterAttributeRanges.*.Range.EndValue.BinaryValue",
30958+
"Operations.*.ListIncomingTypedLinks.FilterAttributeRanges.*.Range.StartValue.BinaryValue",
30959+
"Operations.*.ListIndex.RangesOnIndexedValues.*.Range.EndValue.BinaryValue",
30960+
"Operations.*.ListIndex.RangesOnIndexedValues.*.Range.StartValue.BinaryValue",
30961+
"Operations.*.ListOutgoingTypedLinks.FilterAttributeRanges.*.Range.EndValue.BinaryValue",
30962+
"Operations.*.ListOutgoingTypedLinks.FilterAttributeRanges.*.Range.StartValue.BinaryValue"
30963+
],
30964+
"batchwrite": [
30965+
"Operations.*.AddFacetToObject.ObjectAttributeList.*.Value.BinaryValue",
30966+
"Operations.*.AttachTypedLink.Attributes.*.Value.BinaryValue",
30967+
"Operations.*.CreateObject.ObjectAttributeList.*.Value.BinaryValue",
30968+
"Operations.*.DetachTypedLink.TypedLinkSpecifier.IdentityAttributeValues.*.Value.BinaryValue",
30969+
"Operations.*.UpdateLinkAttributes.AttributeUpdates.*.AttributeAction.AttributeUpdateValue.BinaryValue",
30970+
"Operations.*.UpdateLinkAttributes.TypedLinkSpecifier.IdentityAttributeValues.*.Value.BinaryValue",
30971+
"Operations.*.UpdateObjectAttributes.AttributeUpdates.*.ObjectAttributeAction.ObjectAttributeUpdateValue.BinaryValue"
30972+
],
30973+
"createfacet": [
30974+
"Attributes.*.AttributeDefinition.DefaultValue.BinaryValue"
30975+
],
30976+
"createobject": [
30977+
"ObjectAttributeList.*.Value.BinaryValue"
30978+
],
30979+
"createtypedlinkfacet": [
30980+
"Facet.Attributes.*.DefaultValue.BinaryValue"
30981+
],
30982+
"detachtypedlink": [
30983+
"TypedLinkSpecifier.IdentityAttributeValues.*.Value.BinaryValue"
30984+
],
30985+
"getlinkattributes": [
30986+
"TypedLinkSpecifier.IdentityAttributeValues.*.Value.BinaryValue"
30987+
],
30988+
"listincomingtypedlinks": [
30989+
"FilterAttributeRanges.*.Range.EndValue.BinaryValue",
30990+
"FilterAttributeRanges.*.Range.StartValue.BinaryValue"
30991+
],
30992+
"listindex": [
30993+
"RangesOnIndexedValues.*.Range.EndValue.BinaryValue",
30994+
"RangesOnIndexedValues.*.Range.StartValue.BinaryValue"
30995+
],
30996+
"listoutgoingtypedlinks": [
30997+
"FilterAttributeRanges.*.Range.EndValue.BinaryValue",
30998+
"FilterAttributeRanges.*.Range.StartValue.BinaryValue"
30999+
],
31000+
"updatefacet": [
31001+
"AttributeUpdates.*.Attribute.AttributeDefinition.DefaultValue.BinaryValue"
31002+
],
31003+
"updatelinkattributes": [
31004+
"AttributeUpdates.*.AttributeAction.AttributeUpdateValue.BinaryValue",
31005+
"TypedLinkSpecifier.IdentityAttributeValues.*.Value.BinaryValue"
31006+
],
31007+
"updateobjectattributes": [
31008+
"AttributeUpdates.*.ObjectAttributeAction.ObjectAttributeUpdateValue.BinaryValue"
31009+
],
31010+
"updatetypedlinkfacet": [
31011+
"AttributeUpdates.*.Attribute.DefaultValue.BinaryValue"
31012+
]
31013+
},
3094831014
"cloudfront": {
3094931015
"createfunction": [
3095031016
"FunctionCode"
@@ -31023,6 +31089,106 @@ var init_parameter_types = __esm({
3102331089
"CertificateWallet"
3102431090
]
3102531091
},
31092+
"dynamodb": {
31093+
"batchexecutestatement": [
31094+
"Statements.*.Parameters.*.B",
31095+
"Statements.*.Parameters.*.BS.*"
31096+
],
31097+
"batchgetitem": [
31098+
"RequestItems.*.Keys.*.*.B",
31099+
"RequestItems.*.Keys.*.*.BS.*"
31100+
],
31101+
"batchwriteitem": [
31102+
"RequestItems.*.*.DeleteRequest.Key.*.B",
31103+
"RequestItems.*.*.DeleteRequest.Key.*.BS.*",
31104+
"RequestItems.*.*.PutRequest.Item.*.B",
31105+
"RequestItems.*.*.PutRequest.Item.*.BS.*"
31106+
],
31107+
"deleteitem": [
31108+
"Expected.*.AttributeValueList.*.B",
31109+
"Expected.*.AttributeValueList.*.BS.*",
31110+
"Expected.*.Value.B",
31111+
"Expected.*.Value.BS.*",
31112+
"ExpressionAttributeValues.*.B",
31113+
"ExpressionAttributeValues.*.BS.*",
31114+
"Key.*.B",
31115+
"Key.*.BS.*"
31116+
],
31117+
"executestatement": [
31118+
"Parameters.*.B",
31119+
"Parameters.*.BS.*"
31120+
],
31121+
"executetransaction": [
31122+
"TransactStatements.*.Parameters.*.B",
31123+
"TransactStatements.*.Parameters.*.BS.*"
31124+
],
31125+
"getitem": [
31126+
"Key.*.B",
31127+
"Key.*.BS.*"
31128+
],
31129+
"putitem": [
31130+
"Expected.*.AttributeValueList.*.B",
31131+
"Expected.*.AttributeValueList.*.BS.*",
31132+
"Expected.*.Value.B",
31133+
"Expected.*.Value.BS.*",
31134+
"ExpressionAttributeValues.*.B",
31135+
"ExpressionAttributeValues.*.BS.*",
31136+
"Item.*.B",
31137+
"Item.*.BS.*"
31138+
],
31139+
"query": [
31140+
"ExclusiveStartKey.*.B",
31141+
"ExclusiveStartKey.*.BS.*",
31142+
"ExpressionAttributeValues.*.B",
31143+
"ExpressionAttributeValues.*.BS.*",
31144+
"KeyConditions.*.AttributeValueList.*.B",
31145+
"KeyConditions.*.AttributeValueList.*.BS.*",
31146+
"QueryFilter.*.AttributeValueList.*.B",
31147+
"QueryFilter.*.AttributeValueList.*.BS.*"
31148+
],
31149+
"scan": [
31150+
"ExclusiveStartKey.*.B",
31151+
"ExclusiveStartKey.*.BS.*",
31152+
"ExpressionAttributeValues.*.B",
31153+
"ExpressionAttributeValues.*.BS.*",
31154+
"ScanFilter.*.AttributeValueList.*.B",
31155+
"ScanFilter.*.AttributeValueList.*.BS.*"
31156+
],
31157+
"transactgetitems": [
31158+
"TransactItems.*.Get.Key.*.B",
31159+
"TransactItems.*.Get.Key.*.BS.*"
31160+
],
31161+
"transactwriteitems": [
31162+
"TransactItems.*.ConditionCheck.ExpressionAttributeValues.*.B",
31163+
"TransactItems.*.ConditionCheck.ExpressionAttributeValues.*.BS.*",
31164+
"TransactItems.*.ConditionCheck.Key.*.B",
31165+
"TransactItems.*.ConditionCheck.Key.*.BS.*",
31166+
"TransactItems.*.Delete.ExpressionAttributeValues.*.B",
31167+
"TransactItems.*.Delete.ExpressionAttributeValues.*.BS.*",
31168+
"TransactItems.*.Delete.Key.*.B",
31169+
"TransactItems.*.Delete.Key.*.BS.*",
31170+
"TransactItems.*.Put.ExpressionAttributeValues.*.B",
31171+
"TransactItems.*.Put.ExpressionAttributeValues.*.BS.*",
31172+
"TransactItems.*.Put.Item.*.B",
31173+
"TransactItems.*.Put.Item.*.BS.*",
31174+
"TransactItems.*.Update.ExpressionAttributeValues.*.B",
31175+
"TransactItems.*.Update.ExpressionAttributeValues.*.BS.*",
31176+
"TransactItems.*.Update.Key.*.B",
31177+
"TransactItems.*.Update.Key.*.BS.*"
31178+
],
31179+
"updateitem": [
31180+
"AttributeUpdates.*.Value.B",
31181+
"AttributeUpdates.*.Value.BS.*",
31182+
"Expected.*.AttributeValueList.*.B",
31183+
"Expected.*.AttributeValueList.*.BS.*",
31184+
"Expected.*.Value.B",
31185+
"Expected.*.Value.BS.*",
31186+
"ExpressionAttributeValues.*.B",
31187+
"ExpressionAttributeValues.*.BS.*",
31188+
"Key.*.B",
31189+
"Key.*.BS.*"
31190+
]
31191+
},
3102631192
"ebs": {
3102731193
"putsnapshotblock": [
3102831194
"BlockData"
@@ -31063,6 +31229,11 @@ var init_parameter_types = __esm({
3106331229
"Records.*.Data"
3106431230
]
3106531231
},
31232+
"frauddetector": {
31233+
"geteventprediction": [
31234+
"externalModelEndpointDataBlobs.*.byteBuffer"
31235+
]
31236+
},
3106631237
"gamelift": {
3106731238
"createscript": [
3106831239
"ZipFile"
@@ -31086,10 +31257,12 @@ var init_parameter_types = __esm({
3108631257
},
3108731258
"glue": {
3108831259
"updatecolumnstatisticsforpartition": [
31089-
"ColumnStatisticsList.*.StatisticsData.DecimalColumnStatisticsData.MaximumValue.UnscaledValue"
31260+
"ColumnStatisticsList.*.StatisticsData.DecimalColumnStatisticsData.MaximumValue.UnscaledValue",
31261+
"ColumnStatisticsList.*.StatisticsData.DecimalColumnStatisticsData.MinimumValue.UnscaledValue"
3109031262
],
3109131263
"updatecolumnstatisticsfortable": [
31092-
"ColumnStatisticsList.*.StatisticsData.DecimalColumnStatisticsData.MaximumValue.UnscaledValue"
31264+
"ColumnStatisticsList.*.StatisticsData.DecimalColumnStatisticsData.MaximumValue.UnscaledValue",
31265+
"ColumnStatisticsList.*.StatisticsData.DecimalColumnStatisticsData.MinimumValue.UnscaledValue"
3109331266
]
3109431267
},
3109531268
"greengrass": {
@@ -31189,7 +31362,8 @@ var init_parameter_types = __esm({
3118931362
"Recipient.AttestationDocument"
3119031363
],
3119131364
"importkeymaterial": [
31192-
"EncryptedKeyMaterial"
31365+
"EncryptedKeyMaterial",
31366+
"ImportToken"
3119331367
],
3119431368
"reencrypt": [
3119531369
"CiphertextBlob"
@@ -31235,6 +31409,9 @@ var init_parameter_types = __esm({
3123531409
],
3123631410
"recognizeutterance": [
3123731411
"inputStream"
31412+
],
31413+
"startconversation": [
31414+
"requestEventStream.AudioInputEvent.audioChunk"
3123831415
]
3123931416
},
3124031417
"lookoutvision": {
@@ -31250,6 +31427,12 @@ var init_parameter_types = __esm({
3125031427
"Body"
3125131428
]
3125231429
},
31430+
"medical-imaging": {
31431+
"updateimagesetmetadata": [
31432+
"updateImageSetMetadataUpdates.DICOMUpdates.removableAttributes",
31433+
"updateImageSetMetadataUpdates.DICOMUpdates.updatableAttributes"
31434+
]
31435+
},
3125331436
"mobiletargeting": {
3125431437
"sendmessages": [
3125531438
"MessageRequest.MessageConfiguration.EmailMessage.RawEmail.Data"
@@ -31269,9 +31452,18 @@ var init_parameter_types = __esm({
3126931452
"AssetBundleImportSource.Body"
3127031453
]
3127131454
},
31455+
"rds-data": {
31456+
"batchexecutestatement": [
31457+
"parameterSets.*.*.value.blobValue"
31458+
],
31459+
"executestatement": [
31460+
"parameters.*.value.blobValue"
31461+
]
31462+
},
3127231463
"rekognition": {
3127331464
"comparefaces": [
31274-
"SourceImage.Bytes"
31465+
"SourceImage.Bytes",
31466+
"TargetImage.Bytes"
3127531467
],
3127631468
"detectcustomlabels": [
3127731469
"Image.Bytes"
@@ -31305,6 +31497,9 @@ var init_parameter_types = __esm({
3130531497
],
3130631498
"updatedatasetentries": [
3130731499
"Changes.GroundTruth"
31500+
],
31501+
"startfacelivenesssession": [
31502+
"LivenessRequestStream.VideoEvent.VideoChunk"
3130831503
]
3130931504
},
3131031505
"s3": {
@@ -31355,6 +31550,28 @@ var init_parameter_types = __esm({
3135531550
"payload"
3135631551
]
3135731552
},
31553+
"sns": {
31554+
"publish": [
31555+
"MessageAttributes.*.BinaryValue"
31556+
],
31557+
"publishbatch": [
31558+
"PublishBatchRequestEntries.*.MessageAttributes.*.BinaryValue"
31559+
]
31560+
},
31561+
"sqs": {
31562+
"sendmessage": [
31563+
"MessageAttributes.*.BinaryListValues.*",
31564+
"MessageAttributes.*.BinaryValue",
31565+
"MessageSystemAttributes.*.BinaryListValues.*",
31566+
"MessageSystemAttributes.*.BinaryValue"
31567+
],
31568+
"sendmessagebatch": [
31569+
"Entries.*.MessageAttributes.*.BinaryListValues.*",
31570+
"Entries.*.MessageAttributes.*.BinaryValue",
31571+
"Entries.*.MessageSystemAttributes.*.BinaryListValues.*",
31572+
"Entries.*.MessageSystemAttributes.*.BinaryValue"
31573+
]
31574+
},
3135831575
"ssm": {
3135931576
"registertaskwithmaintenancewindow": [
3136031577
"TaskInvocationParameters.Lambda.Payload"
@@ -31390,6 +31607,17 @@ var init_parameter_types = __esm({
3139031607
"Document.Bytes"
3139131608
]
3139231609
},
31610+
"transcribe": {
31611+
"startcallanalyticsstreamtranscription": [
31612+
"AudioStream.AudioEvent.AudioChunk"
31613+
],
31614+
"startmedicalstreamtranscription": [
31615+
"AudioStream.AudioEvent.AudioChunk"
31616+
],
31617+
"startstreamtranscription": [
31618+
"AudioStream.AudioEvent.AudioChunk"
31619+
]
31620+
},
3139331621
"translate": {
3139431622
"importterminology": [
3139531623
"TerminologyData.File"
@@ -31430,7 +31658,11 @@ var init_parameter_types = __esm({
3143031658
"DeviceTypeAndroid.Logo",
3143131659
"DeviceTypeIos.Logo",
3143231660
"DeviceTypeIos.Logo2x",
31433-
"DeviceTypeIos.Logo3x"
31661+
"DeviceTypeIos.Logo3x",
31662+
"DeviceTypeLinux.Logo",
31663+
"DeviceTypeOsx.Logo",
31664+
"DeviceTypeWeb.Logo",
31665+
"DeviceTypeWindows.Logo"
3143431666
]
3143531667
}
3143631668
};
@@ -31454,8 +31686,14 @@ function coerceToUint8Array(obj, path) {
3145431686
if (path.length === 0) {
3145531687
return coerceValueToUint8Array(obj);
3145631688
}
31457-
if (path[0] === "*" && Array.isArray(obj)) {
31458-
return obj.map((e) => coerceToUint8Array(e, path.slice(1)));
31689+
if (path[0] === "*") {
31690+
if (Array.isArray(obj)) {
31691+
return obj.map((e) => coerceToUint8Array(e, path.slice(1)));
31692+
}
31693+
if (obj && typeof obj === "object") {
31694+
return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, coerceToUint8Array(value, path.slice(1))]));
31695+
}
31696+
return obj;
3145931697
}
3146031698
if (obj && typeof obj === "object") {
3146131699
if (path[0] in obj) {

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.e2b4766aeeab2b067017ba499fbd35f6183ad52d2f71bc62e0b7c6fe29219c01/index.js

-1
This file was deleted.

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integ-cognito.assets.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"version": "34.0.0",
33
"files": {
4-
"e2b4766aeeab2b067017ba499fbd35f6183ad52d2f71bc62e0b7c6fe29219c01": {
4+
"03adb2514e02907e0458bec59283658ec529425bd5df38e1194455c65dedf6ff": {
55
"source": {
6-
"path": "asset.e2b4766aeeab2b067017ba499fbd35f6183ad52d2f71bc62e0b7c6fe29219c01",
6+
"path": "asset.03adb2514e02907e0458bec59283658ec529425bd5df38e1194455c65dedf6ff",
77
"packaging": "zip"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "e2b4766aeeab2b067017ba499fbd35f6183ad52d2f71bc62e0b7c6fe29219c01.zip",
12+
"objectKey": "03adb2514e02907e0458bec59283658ec529425bd5df38e1194455c65dedf6ff.zip",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}
@@ -27,15 +27,15 @@
2727
}
2828
}
2929
},
30-
"138ef46e68c06b10d1d1954083ce1b05447a02cb1291c497797a82ec3d370019": {
30+
"7dc51ef6fb06ebca692ba6e0b9e87a0de8695ceb5ad943c71586731ee9de45dd": {
3131
"source": {
3232
"path": "integ-cognito.template.json",
3333
"packaging": "file"
3434
},
3535
"destinations": {
3636
"current_account-current_region": {
3737
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
38-
"objectKey": "138ef46e68c06b10d1d1954083ce1b05447a02cb1291c497797a82ec3d370019.json",
38+
"objectKey": "7dc51ef6fb06ebca692ba6e0b9e87a0de8695ceb5ad943c71586731ee9de45dd.json",
3939
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
4040
}
4141
}

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integ-cognito.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@
827827
"S3Bucket": {
828828
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
829829
},
830-
"S3Key": "e2b4766aeeab2b067017ba499fbd35f6183ad52d2f71bc62e0b7c6fe29219c01.zip"
830+
"S3Key": "03adb2514e02907e0458bec59283658ec529425bd5df38e1194455c65dedf6ff.zip"
831831
},
832832
"Handler": "index.handler",
833833
"Role": {

0 commit comments

Comments
 (0)