Ask A Question

Notifications

You’re not receiving notifications from this thread.

Best Practices for storing API Keys, DB user / passwords, etc...

Mountaindog asked in Rails

I would like to get everyone's take on what are is the best practice for storing DB usernames/passwords, API keys, Contstants, Etc... Should they be stored in config/environments/ then in test, development production accordingly? Some of these files do end up in verstion control. Thoughts?

Reply

Hey Craig!

Check out this episode on Rails credentials. This is what I strongly recommend as all your credentials are easily organized and encrypted. Then in production you only have to set RAILS_MASTER_KEY to decrypt the file. Much easier to manage this way.

https://gorails.com/episodes/rails-5-2-encrypted-credentials

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,400+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.