In this chapter, we will improve the capabilities of the RESTful API that we started in the previous chapter and we will add authentication-related security to it. We will do the following:
- Improve unique constraints in the models
- Understand the differences between the PUT and the PATCH methods
- Update fields for a resource with the PATCH method
- Code a generic pagination class
- Add pagination features to the API
- Understand the steps to add authentication and permissions
- Add a user model
- Create a schema to validate, serialize, and deserialize users
- Add authentication to resources
- Create resource classes to handle users
- Run migrations to generate the user table
- Compose requests with the necessary authentication