Skip to content

Blog

#230: Fix the PydanticJsonSchemaWarning in FastAPI

While I was preparing the next post, I run into an annoying warning that I wanted to fix before I add one additional feature to the minimalistic to-do application. Let us explore what I had to do to find the reason for the warning and how I could fix the problem.

#229: OAuth2 and JWT to Protect a FastAPI Application

The HTTP basic authentication from last week has been working, but it feels a bit messy. When we search for a more current style of authentication, we end up with OAuth2 and JWT. There is an example in the FastAPI documentation that I changed a bit to use a different library for JWT, store the secret key in a .env file and use BCrypt to hash the passwords.

#227: Hash a Password With Bcrypt

When it comes to authentication, we often find some form of username and password as the backbone of the solution. Before we dive into those examples, I like to make a detour and first explain how we can securely hash passwords in Python. While it is possible to just store passwords as plaintext for an example application, such hacks tend to get into production and that would be a disaster waiting to happen. Let us do it the right way directly from the start and always hash our passwords.