Masking and formatting using annotations #824
Replies: 2 comments
-
|
Hi @pecigonzalo , That would be a nice feature indeed. A few questions tho...
Would you expect the entire collection field to be masked - similar to the current masking behaviour when the path points to the field holding the collection? Example: Or maybe the @Mask annotation should accept a path pattern that would be evaluated starting at the annotated field? The following example would then mask only the second entry of the collection (index is 0 based): This would produce a JSON similar to:
Same question when the annotation is put on a field holding a Pojo.. |
Beta Was this translation helpful? Give feedback.
-
I think this would be a good option yeah. It could be interesting to mask on each item (eg a list of email), but this might prove a bit complex both implementation wise and processing wise. If we assume a collection is of a type of something, we most likely want all of the collection masked in the same fashion, so
I would not traverse the Pojo, if the Pojo needs masking the it should be defined in the data class of that pojo. PS: Sorry for the long wait here! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! Im looking to implement masking of some fields for Arguments and MDC given the origin object annotations. Something along the lines of what is decribed in https://gkovan.medium.com/pci-and-pii-compliance-when-logging-data-in-digital-transformation-projects-7739bab159a6
I've gave it a go using custom Providers and the likes, but it seems that from the provider perspective I can only access maps/strings, but not the original objects, so I can do custom actions based on the annotations.
This would be my sample data class and annotation
@Target( AnnotationTarget.FIELD, ) @Retention(AnnotationRetention.RUNTIME) @MustBeDocumented annotation class Mask(val mask: String = "*****") @Serializable data class Customer( val id: String, val firstName: String, val lastName: String, @Mask() val email: String )Any ideas or pointers? Anyone has implemented something similar?
Beta Was this translation helpful? Give feedback.
All reactions