24 Commits

Author SHA1 Message Date
4776117f10 Write the docs for new current_user dependency 2021-02-06 13:55:41 +01:00
9c113e30a2 Prepare docs for v5 release 2021-01-12 11:24:52 +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
47f2991ee8 Fix #399: fix logout example in doc 2020-12-07 08:00:25 +01:00
435f29331a Fix #391: put user creation logic in a importable function 2020-11-22 09:57:03 +01:00
13ff31ed08 Fix #253 and #258: improve documentation 2020-07-20 16:27:43 +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
9508768502 Add get_optional_* dependency callables 2020-05-25 08:13:42 +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
5ea85beb32 Fix default port in flow page 2020-04-25 14:35:13 +02:00
bf0c924501 Complete documentation with a flow page with curl examples 2020-04-25 14:32:08 +02:00
a9ee467518 Remove list endpoint and related methods 2020-04-25 11:46:20 +02:00
05b1df9a16 Implement logout route 2020-02-03 10:12:33 +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
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
37b34e6d28 Add one more example for route dependency (#40)
* Add one more example for routing dependencie

* fix for more purity

* Delete f-string
2019-11-06 13:14:45 +01:00
658161518a Add error codes on routes (#34)
Fix #33
2019-10-31 10:10:53 +01:00
9b7ec58800 #21: Add superuser routes (#30)
* Add CRU superuser routes

* Add delete method on DB adapters

* Add superuser delete route

* Add superuser routes documentation

* Pass black formatter
2019-10-29 13:32:44 +01:00
7485f79fc5 Fix documentation internal links 2019-10-25 08:54:05 +02:00
e146e4bca4 Fix #13: add /me update route 2019-10-20 10:11:48 +02:00
1996ed69ea Fix #14: add /me route 2019-10-20 09:30:26 +02:00
5d4979f9a9 Fix #19: 201 status code on successful registration 2019-10-19 18:36:57 +02:00
a4171f8bea Fix #18: check for existing user on registration 2019-10-19 18:31:08 +02:00
a5618399a1 Fix #9: Write documentation (#16)
* Start to write documentation

* Add docs favicon

* Add routes documentation

* Add doc about dependency callables

* Add information about how to make authenticated calls
2019-10-19 18:16:08 +02:00