* docs(examples): full examples use lifespan instead of on_startup for database initialization
* Update beanie.md
Replaced the annotations on the notes that I missed
* Revamp Transport so they always build a full Response object
* Fix linting
* Add private methods to set cookies on CookieTransport
* Change on_after_login login_return parameter to response
The documentation was missing a hint that the `AccessToken` ODM model has to be added to the `document_models` array argument for Beanie to know this model.
* on_after_login minimal impl.
Questions: is the spot logical for after method? Is after the internal login call.
Would before_login be needed? Maybe not, as auth is the way to do pre-login things.
Added fastapi request as a param just in case, as other callbacks had it too.
Docs addition is missing.
* tried to complete the implementation, but the test with user_manager.on_after_login.called fails though
* move on_after_login tests to right place, to TestLogin. These ones pass.
TODO: check TestCallback
* on_after_login tests to TestCallback too, for oauth. Apparently test_redirect_url_router fires the callback too, I guess that's correct, am not using oauth myself.
* fix formatting with make format
* docs for on_after_login
Co-authored-by: Toni Alatalo <toni.alatalo@gmail.com>
* Use a generic Protocol model for User instead of Pydantic
* Remove UserDB Pydantic schema
* Harmonize schema variable naming to avoid confusions
* Revamp OAuth account model management
* Revamp AccessToken DB strategy to adopt generic model approach
* Make ID a generic instead of forcing UUIDs
* Improve generic typing
* Improve Strategy typing
* Tweak base DB typing
* Don't set Pydantic schemas on FastAPIUsers class: pass it directly on router creation
* Add IntegerIdMixin and export related classes
* Start to revamp doc for V10
* Revamp OAuth documentation
* Fix code highlights
* Write the 9.x.x ➡️ 10.x.x migration doc
* Fix pyproject.toml
* Implement RS256 for JWT auth
* Update docs with RS256 example
* Added ES256 tests
* Format with isort and black
* Removed example RSA key pair (so as not to tempt people to use it)
* Added pyjwt[crypto] to requirements
* Removed pycryptodome by hardcoding example keys
* Removed unnecessary Tuple import from typing
* Applied `make format`
* Added format-check to makefile
* Added a "Check codestyle" step to the build action.
* Rerun `make format`
* Added a "lint" target to makefile
* Added lint step to the build action
* Added W503 to the list of ignored flake8 errors.
See https://www.flake8rules.com/rules/W503.html
* Added OAuth2 authorize route response_model
* Changed OAuth2 "authorize" route backend param type.
On OAuth2 router creation, an enum is created for the `authentication_backend` parameter. This allows us to generate OpenAPI docs correctly.
* Reformatted with "make format"
* Updated OAuth2 authorize url docs
- /authorize now returns 422 instead of 400 for an invalid authentication backend