Skip to content

Commit

Permalink
Add new fields within deidentify_config field of `google_data_loss_…
Browse files Browse the repository at this point in the history
…prevention_deidentify_template` resource (#6872) (#4996)

* Start adding `recordTransformations` field, make mutually exclusive with `infoTypeTransformations`

This stops `infoTypeTransformations` being required - not a breaking change?

* Add `recordTransformationsfieldTransformations.fields.*` fields

* Add `recordTransformationsfieldTransformations.condition.*` fields and validation

Note: this is a repeat of something already in the file but they differ by use of `exactly_one_of`.

* Add `recordTransformations.fieldTransformations.primitiveTransformation.replaceConfig.*` fields and validation

* Add `recordTransformations.fieldTransformations.primitiveTransformation.redactConfig.*` fields

* Make 'values' fields in `confitions` and `replaceConfig` fields both have exactly_one_of restrictions and same descriptions

* Add comments about `exactly_one_of` entries that are yet to be implemented

* Fix mistake - `redactConfig` is meant to be an empty object, attribute properties in yaml to `characterMaskConfig` field instead

* Update existing DeidentifyTemplate tests to reflect use of `infoTypeTransformations` field

* Add new DeidentifyTemplate test that uses implemented `recordTransformations` fields

* Fix unclosed strings in acceptance test

* Fix error in generating `exactly_one_of` entries

* Fix error where `fieldTransformations` should be an array, remove incompatible use of `exactly_one_of`

A bug in the SDK means that `exactly_one_of` doesn't work with fields nested within arrays

* Refactor and rename tests

* go fmt

* Update test name to allow multiple tests that set `recordTransformations`

* Allow empty `redactConfig` object to be sent to API

* Add acceptance test for use of `redactConfig` transformation

* Update `replaceConfig` config test to add a second condition

To check for any reordering by the API

* Add acceptance test for use of `characterMaskConfig` transformation

* go fmt

* MAke `primitiveTransformation` a required field

* Remove ineffective `exactly_one_of` blocks

These currently create empty ExactlyOneOf lists in the downstream

* Update descriptions for `redactConfig`, `characterMaskConfig`

* Refactor acceptance tests into single `recordTransformations` test

Tests `replace_config`, `redact_config` and `character_mask_config`

* Update docs after feedback

* Add missing validation for `replace_config.new_value` fields

* Update acc tests to include removal of blocks

Test removal of field_transformations, conditions

* Update docs to show that primitive_transformation is a union field

* Update mmv1/products/dlp/api.yaml

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>

* Update mmv1/products/dlp/api.yaml

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
Signed-off-by: Modular Magician <[email protected]>

Signed-off-by: Modular Magician <[email protected]>
Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
  • Loading branch information
modular-magician and melinath authored Dec 19, 2022
1 parent 1a20451 commit 01be250
Show file tree
Hide file tree
Showing 4 changed files with 2,762 additions and 415 deletions.
15 changes: 15 additions & 0 deletions .changelog/6872.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```release-note:enhancement
dlp: Added field `deidentify_config.record_transformations.field_transformations.fields` to `google_data_loss_prevention_deidentify_template`
```
```release-note:enhancement
dlp: Added field `deidentify_config.record_transformations.field_transformations.condition` to `google_data_loss_prevention_deidentify_template`
```
```release-note:enhancement
dlp: Added field `deidentify_config.record_transformations.field_transformations.primitive_transformation.replace_config` to `google_data_loss_prevention_deidentify_template`
```
```release-note:enhancement
dlp: Added field `deidentify_config.record_transformations.field_transformations.primitive_transformation.redact_config` to `google_data_loss_prevention_deidentify_template`
```
```release-note:enhancement
dlp: Added field `deidentify_config.record_transformations.field_transformations.primitive_transformation.character_mask_config` to `google_data_loss_prevention_deidentify_template`
```
Loading

0 comments on commit 01be250

Please sign in to comment.