[ https://issues.apache.org/jira/browse/KAFKA-6755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16771119#comment-16771119 ]
ASF GitHub Bot commented on KAFKA-6755: --------------------------------------- Nimfadora commented on pull request #6284: [WIP] KAFKA-6755: Allow literal value for MaskField SMT URL: https://github.com/apache/kafka/pull/6284 **Requires KIP – do not merge** ### Goal Allow literal value for MaskField SMT instead of null-masking for masking out: - IP address, - SSN - other personally identifiable information (PII) ### Details The existing `org.apache.kafka.connect.transforms.MaskField` SMT always uses the null value for field masking. This PR introduces additional config param `custom`, which is actually map of masked `fields` keys to custom values serialized to JSON string. In such a way you can mask any string or numeric values with any literal of your choice. _example config:_ ``` fields: byte,string custom: {"byte":"value","string":"not match"} ``` ### Restrictions: - Map of custom mappings should be the JSON equivalent of java Map<String, String> - Only numeric or string values are supported (no Dates, Booleans, lists, maps) Masking lists, maps and Booleans with custom value seems useless. Masking dates is not very flexible in `org.apache.kafka.connect.data.Values`. Custom parser is also a needless solution as writing of custom parser is ### Testing - Unit tests are provided, custom doc testing was held ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > MaskField SMT should optionally take a literal value to use instead of using > null > --------------------------------------------------------------------------------- > > Key: KAFKA-6755 > URL: https://issues.apache.org/jira/browse/KAFKA-6755 > Project: Kafka > Issue Type: Improvement > Components: KafkaConnect > Affects Versions: 0.11.0.0 > Reporter: Randall Hauch > Assignee: Valeria Vasylieva > Priority: Major > Labels: needs-kip, newbie > Original Estimate: 8h > Remaining Estimate: 8h > > The existing {{org.apache.kafka.connect.transforms.MaskField}} SMT always > uses the null value for the type of field. It'd be nice to *optionally* be > able to specify a literal value for the type, where the SMT would convert the > literal string value in the configuration to the desired type (using the new > {{Values}} methods). > Use cases: mask out the IP address, or SSN, or other personally identifiable > information (PII). > Since this changes the API, and thus will require a KIP. -- This message was sent by Atlassian JIRA (v7.6.3#76005)