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

Per use-case factory #45

Open
Pagehey opened this issue Oct 13, 2024 · 1 comment
Open

Per use-case factory #45

Pagehey opened this issue Oct 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Pagehey
Copy link

Pagehey commented Oct 13, 2024

Hi !
Thanks for your gem, I find it very interesting.

I'd like to use it for a frontend lib I'm working on, but one feature does not fit exactly my need. I'm not confortable with sending full activerecord object to browser. For two concerns:

  1. security: I feel like it is too easy to leak some private data (the payload is not encrypted, right?)
  2. performance: I'm pretty sure the end dev users won't pay attention to what they send for serialization, and if an instance has for example huge fields like jsons, they probably don't need to go to front.

Point 2. resonates with point 1. as both problems could be resolved simply by loading/filtering only secured/required fields, but I think most developers and especelly less experienced one won't have the reflex to do so. And if they do, I'd prefer to make this easier for them, so the lib usage is nicer.

So my question is: is there a way to specify a factory for a specific encoding/decoding process?
I think it is better my lib does not change UniversalID settings directly so no unexpected behavior happen if dev wants to use it too.
Typcally, I'd like to say something like "everyhing that includes GlobalID::Identification -> use GlobalID"

I hope my request is understandable 😅
Thanks!

@hopsoft
Copy link
Owner

hopsoft commented Dec 17, 2024

I've been planning to add native encryption. Would that suffice given that you can already specify the attributes/keys to include? Encryption would be simple to enable. Something like an encrypt: true option.

@hopsoft hopsoft added the enhancement New feature or request label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants