This now concludes our work on the TempMessenger User Authentication system. We started this chapter by using a Postgres database with Python and created a Nameko Dependency to encapsulate it. This was different from our Redis dependency from the last chapter since the data is permanent and required a lot more planning. Despite this, we tucked this logic away and simply exposed two RPC's: create_user
and authenticate_user
.
We then looked at how to securely store user passwords in a database. We explored some of the ways you can do this incorrectly, such as by storing passwords in plain text. We used Bcrypt to cryptographically hash our passwords to prevent them from being read if our database was compromised.
When it came to linking the new User Service to the rest of our application, we first split out each service into its own module to allow us to deploy, update, and manage them independently. We reaped some of the benefits of a microservice architecture by showing how easy it was...