Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

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) (#1209)

* 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) <stephen.r.burrows@gmail.com>

* Update mmv1/products/dlp/api.yaml

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
  • Loading branch information
modular-magician and melinath authored Dec 19, 2022
1 parent ea07eaf commit 9e19d12
Show file tree
Hide file tree
Showing 3 changed files with 764 additions and 3 deletions.
Loading

0 comments on commit 9e19d12

Please sign in to comment.