Skip to content

Commit

Permalink
Add docs for flask signals
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Sep 2, 2019
1 parent 55a9de4 commit e970f87
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
6 changes: 5 additions & 1 deletion authlib/django/oauth2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from .authorization_server import AuthorizationServer
from .resource_protector import ResourceProtector, BearerTokenValidator
from .endpoints import RevocationEndpoint
from .signals import *
from .signals import (
client_authenticated,
token_authenticated,
token_revoked
)
7 changes: 6 additions & 1 deletion authlib/flask/oauth2/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

_signal = Namespace()

#: signal when client is authenticated
client_authenticated = _signal.signal('client_authenticated')
token_authenticated = _signal.signal('token_authenticated')

#: signal when token is revoked
token_revoked = _signal.signal('token_revoked')

#: signal when token is authenticated
token_authenticated = _signal.signal('token_authenticated')
12 changes: 12 additions & 0 deletions docs/flask/2/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ Server.
# current token instance of the OAuth Token model
return current_token.user_id

.. data:: client_authenticated

Signal when client is authenticated

.. data:: token_revoked

Signal when token is revoked

.. data:: token_authenticated

Signal when token is authenticated

Cache Helper Functions
----------------------

Expand Down

0 comments on commit e970f87

Please sign in to comment.