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

What is a solution for saving secret keys? #9

Closed
samuelterra22 opened this issue Oct 4, 2018 · 9 comments · Fixed by #17
Closed

What is a solution for saving secret keys? #9

samuelterra22 opened this issue Oct 4, 2018 · 9 comments · Fixed by #17

Comments

@samuelterra22
Copy link

No description provided.

@janesser
Copy link

client (ctx, inject) {

What about having a filter for a certain prefix or something at that codespot?

@samtgarson will you have time to enhance nuxt-env in this direction?

@samtgarson
Copy link
Owner

Hey @samuelterra22 @janesser I'm not sure what this issue is asking, could you give a bit more detail?

@janesser
Copy link

@samtgarson it's about env vars you don't want to expose to the browser context but to the SSR context. at least in my case.

@samtgarson
Copy link
Owner

Working on a PR for this, but in the meantime you can just use process.env which is populated server side but not client side.

@samuelterra22
Copy link
Author

samuelterra22 commented Oct 29, 2018

Complementing what @janesser said, when the build command is executed, all keys / values are in the code. If you open a .js file through the browser, all .env information will be there, which is bad when I have sensitive information being used.
One solution was to use the config package.

@janesser
Copy link

@samuelterra22 i believe server.js isn't exposed to the browser, but that of course requires double-checking.

@samtgarson
Copy link
Owner

@samuelterra22 thanks for the feedback.

Firstly, it states at the top of the readme (with a ⚠️) that currently this library is not currently safe to use with secrets, as everything is exposed to the browser anyway.

Having said that, I am working on a PR which will allow you to label keys as secret. Could you let me know which files you're seeing your secrets in, so I can make sure this PR doesn't continue to expose secrets? Thanks!

@robsontenorio
Copy link

Any update?

@samtgarson
Copy link
Owner

Released in 0.1.0 🚀

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 a pull request may close this issue.

4 participants