Skip to content

Commit 7c9671e

Browse files
added cryptoHashConfig to deidentifyTemplate (#8084) (#14870)
* added cryptoHashConfig to primitiveTransformation in infoTypeTransformations * removed trailing space line 633 * stash data to remove linting issue and modified tests Signed-off-by: Modular Magician <[email protected]>
1 parent 86324da commit 7c9671e

File tree

4 files changed

+438
-0
lines changed

4 files changed

+438
-0
lines changed

.changelog/8084.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
dlp: added `crypto_hash_config` to `google_data_loss_prevention_deidentify_template`
3+
```

google/resource_data_loss_prevention_deidentify_template_test.go

+66
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,38 @@ resource "google_data_loss_prevention_deidentify_template" "config" {
12451245
}
12461246
}
12471247
1248+
transformations {
1249+
info_types {
1250+
name = "CRYPTO_HASH_TRANSIENT_EXAMPLE"
1251+
}
1252+
1253+
primitive_transformation {
1254+
crypto_hash_config {
1255+
crypto_key {
1256+
transient {
1257+
name = "beep" # Copy-pasting from existing test that uses this field
1258+
}
1259+
}
1260+
}
1261+
}
1262+
}
1263+
1264+
transformations {
1265+
info_types {
1266+
name = "CRYPTO_HASH_UNWRAPPED_EXAMPLE"
1267+
}
1268+
1269+
primitive_transformation {
1270+
crypto_hash_config {
1271+
crypto_key {
1272+
unwrapped {
1273+
key = "VVdWVWFGZHRXbkUwZERkM0lYb2xRdz09"
1274+
}
1275+
}
1276+
}
1277+
}
1278+
}
1279+
12481280
transformations {
12491281
info_types {
12501282
name = "REDACT_EXAMPLE"
@@ -1371,6 +1403,40 @@ resource "google_data_loss_prevention_deidentify_template" "config" {
13711403
}
13721404
}
13731405
1406+
transformations {
1407+
info_types {
1408+
name = "CRYPTO_HASH_TRANSIENT_UPDATED_EXAMPLE"
1409+
}
1410+
1411+
primitive_transformation {
1412+
crypto_hash_config {
1413+
crypto_key {
1414+
transient {
1415+
# update value
1416+
name = "beepy-beep-updated"
1417+
}
1418+
}
1419+
}
1420+
}
1421+
}
1422+
1423+
transformations {
1424+
info_types {
1425+
name = "CRYPTO_HASH_WRAPPED_EXAMPLE"
1426+
}
1427+
1428+
primitive_transformation {
1429+
crypto_hash_config {
1430+
crypto_key {
1431+
kms_wrapped {
1432+
wrapped_key = "B64/WRAPPED/TOKENIZATION/KEY"
1433+
crypto_key_name = "%{kms_key_name}"
1434+
}
1435+
}
1436+
}
1437+
}
1438+
}
1439+
13741440
# update to remove transformations block using redact_config
13751441
}
13761442
}

0 commit comments

Comments
 (0)