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

Add "encryptColumn" decorator #104

Open
chrisdickinson opened this issue Jun 2, 2020 · 2 comments
Open

Add "encryptColumn" decorator #104

chrisdickinson opened this issue Jun 2, 2020 · 2 comments

Comments

@chrisdickinson
Copy link
Owner

Similar to the autoNow, but it would take a column & a secret. Any reads from that column would automatically be encrypted with the secret on write and decrypted with the secret on read.

(Thanks for the feature request @whithang!)

@whithang
Copy link

whithang commented Jun 2, 2020

actually the idea was to pass in a function and that function would be called on that column anytime the column exists in the input. then you can define exactly what you want to happen

@chrisdickinson
Copy link
Owner Author

WIP PR here: #105

This adds a prepJSData method on Columns, which is the first step towards implementing this functionality. The end-user facing API for it isn't set in stone yet – it might be that users pass orm.encrypted() much like they pass orm.fk() today. I could also see a use for a decorator, in that you could have two different views on the same data – one might automatically encrypt and decrypt, while the other only deals with the encrypted data.

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