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

API for storing and retrieving "private" data #195

Open
wants to merge 8 commits into
base: develop-encode
Choose a base branch
from

Conversation

davydog187
Copy link
Collaborator

@davydog187 davydog187 commented Nov 30, 2024

Adds an API that allows a consumer of Luerl to store private data that can be retrieved from functions called within Lua. This is useful in applications that may need to retrieve secrets from within Luerl, but don't want Lua scripts to be able to access these values.

I've chatted with a number of users of Luerl, including Sam Aaron, who have had the need to expose secrets into their Luerl programs. Some have achieved this by using closures to close over private data and expose those functions to Luerl. I have used the process dictionary to acheive the same thing.

If Luerl had an API to store and retrieve private data, as proposed by this PR, then both techniques would be unnecessary.

Alternative API

Provide a update_private/2 function instead that takes a function that can modify the private map

TODO

  • Get a nod from Robert
  • Implement in other "Elixir" API
  • Tests
  • Decide if we need to implement for "old"
  • Documentation

Adds an API that allows a consumer of Luerl to store private data that
can be retrieved from functions called within Lua. This is useful in
applications that may need to retrieve secrets from within Luerl, but
don't want Lua scripts to be able to access these values.

I've chatted with a number of users of Luerl, including Sam Aaron, who
have had the need to expose secrets into their Luerl programs. Some have
achieved this by using closures to close over private data and expose
those functions to Luerl. I have used the process dictionary to acheive
the same thing.

If Luerl had an API to store and retrieve private data, as proposed by
this PR, then both techniques would be unnecessary.

Provide a `update_private/2` function instead that takes a function that
can modify the private map

- [ ] Get a nod from Robert
- [ ] Implement in other "Elixir" API
- [ ] Decide if we need to implement for "old"
- [ ] Tests
- [ ] Documentation
@rvirding
Copy link
Owner

rvirding commented Dec 7, 2024

@davydog187 So I have checked through your commits and have no problems with them. I have a bunch of questions, where would you like to have the discussion? Github or slack or discord or ...?

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

Successfully merging this pull request may close these issues.

2 participants