question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add .env for SECRET in authentication

See original GitHub issue

Hello,

When authentication is set up via feathers CLI, the secret is exposed in the file default.json. People who are used to working with authentication will not have any trouble creating a .env file, but I think it would be nicer and more secure to have a default .env containing the automatically generated secret. Obviously this implies some change, such as switching from default.json to default.js in config and installing dotenv.

Tell me what you think !

Thank,

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
spidgornycommented, Apr 13, 2021

For those who want to keep using .env (industry standard): adding these two lines in the beginning of src/index.ts works as expected.

import dotenv from 'dotenv';
dotenv.config();

Test with

console.log(app.get('authentication').oauth.twitter);
1reaction
dafflcommented, Jan 16, 2018

Can you explain a little more what the win would be? From what I understand .env is supposed to separate your configuration from you code but isn’t that the same as having it in those .json configuration files (which can also load from environment variables). Right now we can use local-<env>.json via node-config for environment settings we don’t want to check in.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add .env for SECRET in authentication · Issue #111
Hello, When authentication is set up via feathers CLI, the secret is exposed in the file default.json. People who are used to working...
Read more >
Using environment variables for basic authentication ...
An administrator can use the username and password container environment variables for basic authentication credentials.
Read more >
Handling Passwords and Secret Keys using Environment ...
To set password or secret keys in environment variable on Linux(and Mac) you need to modify .bash_profile file that is in your home...
Read more >
How to separate your credentials, secrets, and ...
This article shows how to separate your credentials and configurations from the application source code with the environment variables and ...
Read more >
Secrets | Kubernetes
Use envFrom to define all of the Secret's data as container environment variables. The key from the Secret becomes the environment variable name ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found