Managing Secrets
When we defined our seed data back in Iteration A2: Making Prettier Listings, our database didn’t have any users. After we added our first user in Chapter 14, Task I: Logging In, we added code to require a valid login to access pages that update the database.
What that means is that if we were to deploy a new installation starting with the seed data alone, we would be locked out of our own application. That’s not good. So lets fix it!
Adding an initial user to our seed data solves the problem, but checking in a password into our version control and deploying it is hardly secure. Fortunately Rails has provided a way to encrypt secrets such as this one. Rails calls such secrets credentials.
We get started by editing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access