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

"hash" transformer or "hash" tera filter #181

Open
krysopath opened this issue Jul 5, 2022 · 5 comments
Open

"hash" transformer or "hash" tera filter #181

krysopath opened this issue Jul 5, 2022 · 5 comments

Comments

@krysopath
Copy link

krysopath commented Jul 5, 2022

Hello and thank you for this tool. It works pretty neat. <3

My goal is to dump anonymized version of sensitive data in such a way that the value can be verified, given the original value. It is a common use case in our place to hmac(secret, value) or just sha(salt + value) to hide the field in a dump or log a pseudoanonymized value.

Generating random values works in many places, but we need either a hash transformer or a tera filter capable for generating such hashes, that are 1 => 1 associations.

I went ahead and implemented a sha256 transformer and then looked for tera filters to do the same for comparison. (But this is not working as simply as the transformer Trait)

I would like to open a PR and get some review done. What do you think?

@evgeniy-r
Copy link
Member

Hello! Yes, of course, feel free to open the PR.

@krysopath
Copy link
Author

With pleasure! Would you prefer it as tera function or transformer? I have both by now.

@evgeniy-r
Copy link
Member

Let's start with the function.

@krysopath
Copy link
Author

krysopath commented Jul 15, 2022

cant push a branch to this repo @evgeniy-r
is a friendly-fork required?

@evgeniy-r
Copy link
Member

Push to your fork and create a PR from your fork, please.

krysopath added a commit to krysopath/datanymizer that referenced this issue Jul 17, 2022
krysopath added a commit to krysopath/datanymizer that referenced this issue Jul 17, 2022
krysopath added a commit to krysopath/datanymizer that referenced this issue Jul 17, 2022
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

No branches or pull requests

2 participants