Basic authentication in FastAPI — When you create an API, security is quite essential. Suppose an attacker finds his way to your API, then in the worst case, he can modify your data. Of course, you want to avoid that at all times. Therefore, an excellent first step is to add a simple way of…