-
Notifications
You must be signed in to change notification settings - Fork 95
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
How do I anonymize jsonb fields? #84
Comments
Follow documentation here to write your own analymosation strategy at field
level...
https://github.com/sunitparekh/data-anonymization#write-you-own-field-strategies
…On Sat, Nov 4, 2023 at 1:47 AM Josh Levinson ***@***.***> wrote:
I am just looking for a little guidance here on how to anonymize jsonb
fields. The docs are a little unclear to me how I would go about using a
Custom Strategy.
What I'm looking to do is basically go into some of our jsonb fields and
maintain the keys but replace the values. I don't have a problem writing a
custom method to do this, but I don't really know where to put it or how to
connect it the data anon DSL.
Does anybody have any examples? Or at least maybe can show me how
CustomStrategy examples work so I can add one that could read the data
fields and output something?
Thanks so much.
—
Reply to this email directly, view it on GitHub
<#84>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABLNOSPPRFOL5XMHFLZ5J3YCVGL7AVCNFSM6AAAAAA6453MP6VHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3TMOBXGM4TGOI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
thanks & regards,
*Sunit Parekh*
+91 99237 00662
***@***.***
|
@sunitparekh I have looked at those docs but I don't really understand how to use the custom strategies. In your example you show
But its not clear a) where this should be, or b) how to call it Does this go to the end of the anonymization file? In a separate class? I would love to see a real example of how to use this and I imagine so would others |
# to keep it simple create your own strategy class in same file
class AbcFieldStrategy
# method anonymize is what required
def anonymize field
# write your code here
end
end
# use it like just another anonymization strategies for required field
...
collection 'users' do
anonymize('your_field').using FieldStrategy::AbcFieldStrategy.new
end
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am just looking for a little guidance here on how to anonymize jsonb fields. The docs are a little unclear to me how I would go about using a Custom Strategy.
What I'm looking to do is basically go into some of our jsonb fields and maintain the keys but replace the values. I don't have a problem writing a custom method to do this, but I don't really know where to put it or how to connect it the data anon DSL.
Does anybody have any examples? Or at least maybe can show me how CustomStrategy examples work so I can add one that could read the data fields and output something?
Thanks so much.
The text was updated successfully, but these errors were encountered: