[
https://issues.apache.org/jira/browse/LANG-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17888975#comment-17888975
]
Mukul Bindal commented on LANG-1755:
------------------------------------
Hi @Gary I am not sure which Lombok feature provides this functionality. Let me
give you an example of what I want to implement here :
Class `EmployeeVO` contains some data like `dateOfBirth`, `salary`, `name`,
`ssn` etc. Whenever I print an object of this class, I get all the instance
variables printed (if I am using lombok's `@ToString`).
Here assume data like `ssn`, `name` etc are PII, while `salary`, `dateOfBirth`
are not PII and most of the organisation nowadays are masking it in their code
since they use logging tools like Splunk. Generally log access is given to a
limited group of users (like production support), but for a huge app, even
developers require the access to debug certain transactions. Mostly for a
financial app, or European apps (due to GDPR), organisations need to hide the
PII data before showing it to anyone.
Here I want to create an annotation, similar to `@ToString` which provides a
`toString()` implementation, but hides the data marked by developer (let's say
`@PIIValue`) on the instance variables.
By doing so, it can save tons of development time. This feature is something we
need in a common library that deals with String data and that is why I want to
include it in Apache commons lang.
I want to make it highly configurable, so that users can define what data to
hide, example being I can hide a field permanently as if it's not there, I can
hide null values or show null instead of a masked string. I can show `***` or
`XXXX`, all based on user's preference. That is something that we can discuss.
Let me know your thoughts about this. If you think I am at wrong place, let me
know.
> New Annotation to support masking of PII data
> ---------------------------------------------
>
> Key: LANG-1755
> URL: https://issues.apache.org/jira/browse/LANG-1755
> Project: Commons Lang
> Issue Type: New Feature
> Components: lang.*
> Reporter: Mukul Bindal
> Priority: Minor
> Original Estimate: 2,016h
> Remaining Estimate: 2,016h
>
> I want to add a new feature in Apache commons lang.
> Create a new Annotation support such that a POJO class annotated with
> annotation @PIIContent will mask the instance variables annotated with
> @PIIValue in the toString() method of the annotated class.
> This feature is useful nowadays as PII masking is required in logging.
> I want to keep it in Apache commons lang library as it deals with String data.
> <More description to be added. I will add a proper description with examples
> and use case.>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)