55 Commits

Author SHA1 Message Date
c1a0dd5476 Fix broken links in documentation 2021-11-07 10:47:40 +01:00
d0c295e411 Fixed user manager function docs. 2021-09-23 13:00:20 +03:00
06a1832ac1 Add direct links to open Repl.it full examples 2021-09-21 08:33:29 +02:00
ab89cdea2f Merge pull request #729 from fastapi-users/db-as-dependency
Massive reorganization: move most of the logic into a UserManager dependency
2021-09-20 08:42:25 +02:00
c198da58bc Complete OAuth2 documentation 2021-09-18 10:18:44 +02:00
fc59cf11ef Rework the documentation 2021-09-17 15:14:36 +02:00
e86a2cfa0c Fix typo in ormar documentation (#727) 2021-09-15 14:51:03 +02:00
38b72ac197 Improve docs regarding getting current user 2021-09-09 12:15:46 +02:00
7ae2042500 Fix #701: factorize JWT handling and support secrets as SecretStr 2021-09-09 11:51:55 +02:00
83873338f3 Refactor models 2021-08-29 17:00:45 +02:00
d2d25da9d1 Fix OAuth2 documentation (#692) 2021-08-13 08:46:47 +02:00
8b131233d6 Fix typo (#684) 2021-08-12 14:17:28 +02:00
a8f0a31655 Update password-validation.md (#680) 2021-08-12 14:14:27 +02:00
22384f6405 Fix typo in documtation (#640)
* Fix typo in auth.md

* Fix typo in register.md
2021-06-08 16:28:33 +02:00
455f695f52 Fix #630: relative tokenUrl (#636)
* Fix #630: use relative tokenUrl as per the official recommendations

* Improve following review comments

* Fix unmatching backtick

* Improve consistency of authentication backend documentation
2021-05-20 08:52:03 +02:00
5267e605f4 Implement password validation mechanism (#632)
* Implement password validation mechanism

* Add invalid password reason

* Always pass user in password validator

* Add password validation documentation
2021-05-17 08:58:23 +02:00
89cff15c6b Updated docs to support pip install via zsh (#619)
* Updated docs to support pip install via zsh

* Changed docs to escape square brackets

Co-authored-by: Vlad Hoi <vlad.hoi@ronati.com>
2021-05-02 08:42:30 +02:00
3ac67377cb Fix #600: revamp Tortoise/Pydantic interaction (#612) 2021-04-20 14:46:36 +02:00
9967053ae0 Fix typos, grammar and spelling mistakes in docs (#584) 2021-04-02 12:47:57 +02:00
a81252c82a fix textual description to match the code (#533) 2021-03-02 08:14:06 +01:00
579313f887 Ormar backend support (#470)
* Add db adapter for ormar (wip)

* finish ormar support enough to pass tests

* remove idea folder

* update ormar version in tool.flit.metadata.requires-extra

* Add documentation about ormar

* Apply isort and black formatting

* Restore python 3.7 in Pipfile

* Update build.yml

* Add missing test for ormar update

* changes after review

Co-authored-by: Paolo Dina <paolo.dina@codingmoth.com>
Co-authored-by: collerek <collerek@gmail.com>
2021-02-07 09:34:40 +01:00
709f399883 Fix typo in auth.md (#462) 2021-01-27 14:49:11 +01:00
9c113e30a2 Prepare docs for v5 release 2021-01-12 11:24:52 +01:00
d4227ae20f Fix #335: implement after_reset_password handler 2021-01-12 11:18:34 +01:00
373157c284 Finalize user activation feature (#439)
* Add routes for user activation (#403)

* Add routes for user activation

Generate a token after creating the user in register route, passing to `activation_callback`, if `activation_callback` supplied
Create new `/activate` route that will verify the token and activate the user
Add new error codes to `fastapi_users/router/common.py`
Update documentation
Add tests

Co-authored-by: Mark Todd <markpeter.todd@hotmail.co.uk>

* Rework routes for user activation

* Separate verification logic and token generation into `/fastapi_users/router/verify.py`, with per-route callbacks for custom behaviour

* Return register router to original state

* Added `is_verified` property to user models

* Added `requires_verification` argument to `get_users_router`and `get_auth_router`

* Additional dependencies added for verification in `fastapi_users/authentication/__init__.py`

* Update tests for new behaviour

* Update `README.md` to describe a workaround for possible problems during testing, by exceeding ulimit file descriptor limit

Co-authored-by: Mark Todd <markpeter.todd@hotmail.co.uk>

* Restored docs to original state.

* All other modifications reqested added

Kebab-case on request-verify-token
SECRET now used as test string
Other minor changes

Co-authored-by: Mark Todd <markpeter.todd@hotmail.co.uk>

* Embed token in body in verify route

* Reorganize checks in verify route and add unit test

* Ignore coverage on Protocol classes

* Tweak verify_user function to take full user in parameter

* Improve unit tests structure regarding parametrized test client

* Make after_verification_request optional to be more consistent with other routers

* Tweak status codes on verify routes

* Write documentation for verification feature

* Add not released warning on verify docs

Co-authored-by: Edd Salkield <edd@salkield.uk>
Co-authored-by: Mark Todd <markpeter.todd@hotmail.co.uk>
2021-01-12 10:44:42 +01:00
7cf7154e27 Fix #431: make OAuth expires_at optional in model and DB schemas 2020-12-28 08:59:27 +01:00
42340d992b Fix #396: add password validation example 2020-12-07 07:57:22 +01:00
e69a124084 Update Tortoise docs and examples 2020-11-21 17:20:51 +01:00
8adce74cd9 added samesite option for cookie authentication (#337)
* added samesite option for cookie authentication

* formatted with black and added documentation (grabbed from starlette.io documentation)
2020-09-30 07:27:25 +02:00
0d8e0730fc Bump dependencies 2020-08-13 14:03:19 +02:00
49665ca36d The doubled parenthesis causing error on line 14 has been removed (#268)
The parenthesis causing error on line 14 has been removed.
2020-07-21 15:24:51 +02:00
bde0c96cd8 The doubled parenthesis causing error on line 14 has been removed (#269)
The parenthesis causing error on line 14 has been removed
2020-07-21 15:24:10 +02:00
13ff31ed08 Fix #253 and #258: improve documentation 2020-07-20 16:27:43 +02:00
efad0e0fef fix "Swagger issue for endpoints register & update" (#233)
* fix: Change on the inheritance model, according to the documentation for the request body parameters. #171

* fix: Changes on the documentation examples to fix the inheritance problem when passing the User class (for create or update only passing the pydantic one) #171

* fix: Changes on the documentation examples to fix the inheritance problem when passing the User class (for create or update only passing the pydantic one) #171

* Put back inheritance on update model and factorize create_update_dict methods

Co-authored-by: François Voron <fvoron@gmail.com>
2020-06-27 17:19:53 +02:00
dc9f4c75ce adding warning of insecure SECRET (#232) 2020-06-15 15:41:15 +02:00
224a311792 fix "Authorization: Bearer Undefined" on Swagger (#213)
* fix "Authorization: Bearer Undefined" on Swagger

* updating pytest to recognize access_token

* fix pytest KeyError

* adding changes requested (add token_type to documentation and tests)

* fix documentation
2020-06-15 14:04:03 +02:00
7721f8dcc1 Revamp authentication routes structure (#201)
* Fix #68: use makefun to generate dynamic dependencies

* Remove every Starlette imports

* Split every routers and remove event handlers

* Make users router optional

* Pass after_update handler to get_users_router

* Update documentation

* Remove test file

* Write migration doc for splitted routers
2020-05-24 10:18:01 +02:00
0a0dcadfdc Use real UUID for User id. and OAuthAccount id. (#198)
* Use UUID for user id and oauth account id

* Update documentation for UUID

* Tweak GUID definition of SQLAlchemy to match Tortoise ORM one

* Write migration doc
2020-05-21 16:40:33 +02:00
9353bb79cb Implement on_after_update event handle 2020-02-03 10:48:53 +01:00
05b1df9a16 Implement logout route 2020-02-03 10:12:33 +01:00
e83ca3efed Merge branch 'master' of github.com:frankie567/fastapi-users 2020-01-20 10:48:04 +01:00
57a37150a0 Add Request in event_handlers arguments 2020-01-20 10:46:45 +01:00
70f0419490 Correct docs for User model (#89) 2020-01-19 20:52:09 +01:00
88b133d41c Implement OAuth2 flow (#88)
* Move users router in sub-module

* Factorize UserRouter into EventHandlersRouter

* Implement OAuth registration/login router

* Apply isort/black

* Remove temporary pytest marker

* Fix httpx-oauth version in lock file

* Ensure ON_AFTER_REGISTER event is triggered on OAuth registration

* Add API on FastAPIUsers to generate an OAuth router

* Improve test coverage of FastAPIUsers

* Small fixes

* Write the OAuth documentation

* Fix SQL unit-tests by avoiding collisions in SQLite db files
2020-01-17 11:43:17 +01:00
dbbb9144b0 Expose more options for Cookie authentication 2020-01-11 10:55:02 +01:00
104a6c6bf5 Inject every models variations and DB model in DB adapters (#84)
* Inject every model variations in router and DB model in DB adapters

* Update documentation and import Tortoise in db module

* Use path operation decorator dependencies for superuser routes
2020-01-04 15:36:34 +01:00
49deb437a6 Fix #42: multiple authentication backends (#47)
* Revamp authentication to allow multiple backends

* Make router generate a login route for each backend

* Apply black

* Remove unused imports

* Complete docstrings

* Update documentation

* WIP add cookie auth

* Complete cookie auth unit tests

* Add documentation for cookie auth

* Fix cookie backend default name

* Don't make cookie return a Response
2019-12-04 13:32:49 +01:00
b5b0bbbb01 Tortoise ORM support (#59)
* add tortoise to dependencies

* add tortoise as optional dependency in pyproject.toml

* add tortoise support (tests needed)

* Add tortoise support (also defined orm_mode in pydantic model

* tests for tortoise support

* format by black

* docs for tortoise

* delete type annotations

* delete underscore

* do it in 1 line

* add 1 line before yield

* fix in docs

* fix bug and add annotation for test

* Tweak documentation and fix Tortoise error about id update

* Improve Tortoise coverage by using get instead of filter

* Fix Pipfile.lock
2019-12-03 21:24:27 +01:00
d9a9d9ba39 Fix lines highlights in MongoDB doc 2019-10-27 16:40:22 +01:00
ab0b187f20 Implement MongoDB database adapter (#29)
* Implement MongoDB adapter using motor

* Add mongo container to build pipeline

* Tidy up dependencies

* Update documentation for MongoDB

* Export MongoDB adapter from db package

* Pass black format

* Update README
2019-10-27 16:34:30 +01:00