Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for trimming strategies #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Dakrs
Copy link
Contributor

@Dakrs Dakrs commented Jan 26, 2023

Description

Added support for distinct trim strategies. Currently, there are 3 strategies supported: redact, trim, and trim-and-list.

  • redact : default behaviour. Obfuscated properties are kept in the output object with the replacement value.
  • trim: Deletes the obfuscated properties in the output when the replacement value is the default value.
  • trim-and-list: Same behaviour as trim, but a list with all obfuscated properties is provided in the output object.

Usage example:

const anonymize = anonymizer({ whitelist: ['foo'] }, { strategy: 'trim-and-list' });
anonymize({ biz: 'baz', buz: { bux: { qux: 'quux' } }, foo: 'bar' })

output:
{ __redacted__: ['biz', 'buz.bux.qux'], foo: 'bar' }

BKO-3790

@Dakrs Dakrs self-assigned this Jan 26, 2023
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from 32d15ba to d22951d Compare January 26, 2023 11:12
@Dakrs Dakrs marked this pull request as ready for review January 26, 2023 11:15
src/enums/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
test/src/index.test.js Outdated Show resolved Hide resolved
test/src/index.test.js Outdated Show resolved Hide resolved
test/src/index.test.js Outdated Show resolved Hide resolved
test/src/index.test.js Outdated Show resolved Hide resolved
@rbrtribeiro
Copy link

Add support for trimming strategies.

@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from d22951d to c80e5c7 Compare January 27, 2023 15:48
@Dakrs Dakrs changed the base branch from master to support/add-support-serializers January 27, 2023 15:49
@Dakrs Dakrs changed the title Add support for distinct trim strategies Add support for trimming strategies Jan 27, 2023
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from c80e5c7 to 692c4c4 Compare January 27, 2023 16:18
README.md Outdated Show resolved Hide resolved
@Dakrs Dakrs force-pushed the support/add-support-serializers branch 2 times, most recently from d9b46be to 1a369c6 Compare January 27, 2023 18:52
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from 692c4c4 to 5fce5ac Compare January 27, 2023 18:58
README.md Outdated Show resolved Hide resolved
src/enums/index.js Outdated Show resolved Hide resolved
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch 2 times, most recently from 3ab27e6 to 544e5f9 Compare January 30, 2023 09:47
@Dakrs Dakrs force-pushed the support/add-support-serializers branch from 1a369c6 to 443652c Compare January 30, 2023 10:52
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from 544e5f9 to d9997d7 Compare January 30, 2023 10:57
@Dakrs Dakrs force-pushed the support/add-support-serializers branch from 443652c to 33aacbf Compare January 30, 2023 10:57
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch 2 times, most recently from 1600401 to 7a11baf Compare January 30, 2023 11:21
@Dakrs Dakrs force-pushed the support/add-support-serializers branch from 33aacbf to 5f66bc2 Compare January 30, 2023 11:25
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch 2 times, most recently from 84e57c8 to b083dd9 Compare January 30, 2023 11:28
@Dakrs Dakrs force-pushed the support/add-support-serializers branch from 5f66bc2 to 0892641 Compare January 30, 2023 11:34
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from b083dd9 to b6d2c64 Compare January 30, 2023 11:37
@Dakrs Dakrs force-pushed the support/add-support-serializers branch from 0892641 to 9a2dd36 Compare January 30, 2023 12:12
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from b6d2c64 to 6c4de2e Compare January 30, 2023 12:18
@Dakrs Dakrs force-pushed the support/add-support-serializers branch from 9a2dd36 to 8cca08a Compare January 30, 2023 12:18
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from 6c4de2e to 80927f7 Compare January 30, 2023 12:19
@Dakrs Dakrs force-pushed the support/add-support-serializers branch 2 times, most recently from ae313ed to 42ddd73 Compare February 6, 2023 09:55
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch 2 times, most recently from 90e3fff to f0114cc Compare February 6, 2023 10:47
@Dakrs Dakrs force-pushed the support/add-support-serializers branch from 42ddd73 to ce00519 Compare February 6, 2023 11:06
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from f0114cc to b3e45d4 Compare February 6, 2023 11:09
@Dakrs Dakrs force-pushed the support/add-support-serializers branch from ce00519 to 300450f Compare February 6, 2023 11:45
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from b3e45d4 to 82b84bc Compare February 6, 2023 11:46
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from 82b84bc to 0699235 Compare May 9, 2023 18:35
@Dakrs Dakrs changed the base branch from support/add-support-serializers to feature/add-serializer-clonedeep-version May 9, 2023 18:36
@Dakrs Dakrs force-pushed the feature/add-serializer-clonedeep-version branch from 770c573 to 515cab3 Compare May 10, 2023 10:04
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from 0699235 to 3f4fdfe Compare May 10, 2023 10:05
@Dakrs Dakrs force-pushed the feature/add-serializer-clonedeep-version branch from 515cab3 to ef8f1f4 Compare May 10, 2023 11:51
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from 3f4fdfe to 18fb559 Compare May 10, 2023 11:52
@Dakrs Dakrs force-pushed the feature/add-serializer-clonedeep-version branch from ef8f1f4 to 4f5b17a Compare May 10, 2023 14:08
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from 18fb559 to 22c8522 Compare May 10, 2023 14:08
@Dakrs Dakrs force-pushed the feature/add-serializer-clonedeep-version branch from 4f5b17a to 6749f50 Compare May 10, 2023 17:11
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from 22c8522 to 92ff90a Compare May 10, 2023 17:12
@Dakrs Dakrs force-pushed the feature/add-serializer-clonedeep-version branch from 6749f50 to 9b210e8 Compare May 10, 2023 17:48
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from 92ff90a to f45d050 Compare May 10, 2023 17:50
@Dakrs Dakrs force-pushed the feature/add-serializer-clonedeep-version branch from 9b210e8 to cf9276d Compare May 10, 2023 18:03
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from f45d050 to 6c37e84 Compare May 10, 2023 18:05
@Dakrs Dakrs force-pushed the feature/add-serializer-clonedeep-version branch from cf9276d to a576f1b Compare May 15, 2023 13:56
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from 6c37e84 to a41a1fc Compare May 15, 2023 14:03
@Dakrs Dakrs force-pushed the feature/add-serializer-clonedeep-version branch from a576f1b to f95a768 Compare May 16, 2023 10:33
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from a41a1fc to 114e71a Compare May 16, 2023 10:34
@Dakrs Dakrs force-pushed the feature/add-serializer-clonedeep-version branch from f95a768 to 01a4aae Compare June 23, 2023 10:05
Base automatically changed from feature/add-serializer-clonedeep-version to master July 11, 2023 17:21
@Dakrs Dakrs force-pushed the feature/add-strategy-support branch from 114e71a to 637554f Compare December 12, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants