mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Bump requests-oauthlib from 1.3.0 to 1.3.1 (#1636)
* Bump requests-oauthlib from 1.3.0 to 1.3.1 Bumps [requests-oauthlib](https://github.com/requests/requests-oauthlib) from 1.3.0 to 1.3.1. - [Release notes](https://github.com/requests/requests-oauthlib/releases) - [Changelog](https://github.com/requests/requests-oauthlib/blob/master/HISTORY.rst) - [Commits](https://github.com/requests/requests-oauthlib/compare/v1.3.0...v1.3.1) --- updated-dependencies: - dependency-name: requests-oauthlib dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Update requests-oauthlib==1.3.1 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
5523d4ba88
commit
61960aa744
26 changed files with 464 additions and 77 deletions
|
@ -10,3 +10,4 @@ from .dispatchers import (
|
|||
)
|
||||
from .hybrid import HybridGrant
|
||||
from .implicit import ImplicitGrant
|
||||
from .refresh_token import RefreshTokenGrant
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
"""
|
||||
oauthlib.openid.connect.core.grant_types
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
"""
|
||||
import logging
|
||||
|
||||
from oauthlib.oauth2.rfc6749.grant_types.refresh_token import (
|
||||
RefreshTokenGrant as OAuth2RefreshTokenGrant,
|
||||
)
|
||||
|
||||
from .base import GrantTypeBase
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class RefreshTokenGrant(GrantTypeBase):
|
||||
|
||||
def __init__(self, request_validator=None, **kwargs):
|
||||
self.proxy_target = OAuth2RefreshTokenGrant(
|
||||
request_validator=request_validator, **kwargs)
|
||||
self.register_token_modifier(self.add_id_token)
|
||||
|
||||
def add_id_token(self, token, token_handler, request):
|
||||
"""
|
||||
Construct an initial version of id_token, and let the
|
||||
request_validator sign or encrypt it.
|
||||
|
||||
The authorization_code version of this method is used to
|
||||
retrieve the nonce accordingly to the code storage.
|
||||
"""
|
||||
if not self.request_validator.refresh_id_token(request):
|
||||
return token
|
||||
|
||||
return super().add_id_token(token, token_handler, request)
|
|
@ -306,3 +306,15 @@ class RequestValidator(OAuth2RequestValidator):
|
|||
Method is used by:
|
||||
UserInfoEndpoint
|
||||
"""
|
||||
|
||||
def refresh_id_token(self, request):
|
||||
"""Whether the id token should be refreshed. Default, True
|
||||
|
||||
:param request: OAuthlib request.
|
||||
:type request: oauthlib.common.Request
|
||||
:rtype: True or False
|
||||
|
||||
Method is used by:
|
||||
RefreshTokenGrant
|
||||
"""
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue