mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 21:21:15 -07:00
Update oauthlib-3.1.1
This commit is contained in:
parent
e58aa40099
commit
d76838a607
64 changed files with 4329 additions and 1421 deletions
|
@ -6,11 +6,8 @@ oauthlib.oauth2.rfc6749
|
|||
This module is an implementation of various logic needed
|
||||
for consuming and providing OAuth 2.0 RFC6749.
|
||||
"""
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from ..parameters import parse_implicit_response, prepare_grant_uri
|
||||
from .base import Client
|
||||
from ..parameters import prepare_grant_uri
|
||||
from ..parameters import parse_implicit_response
|
||||
|
||||
|
||||
class MobileApplicationClient(Client):
|
||||
|
@ -46,6 +43,8 @@ class MobileApplicationClient(Client):
|
|||
redirection URI, it may be exposed to the resource owner and other
|
||||
applications residing on the same device.
|
||||
"""
|
||||
|
||||
response_type = 'token'
|
||||
|
||||
def prepare_request_uri(self, uri, redirect_uri=None, scope=None,
|
||||
state=None, **kwargs):
|
||||
|
@ -86,13 +85,14 @@ class MobileApplicationClient(Client):
|
|||
>>> client.prepare_request_uri('https://example.com', foo='bar')
|
||||
'https://example.com?client_id=your_id&response_type=token&foo=bar'
|
||||
|
||||
.. _`Appendix B`: http://tools.ietf.org/html/rfc6749#appendix-B
|
||||
.. _`Section 2.2`: http://tools.ietf.org/html/rfc6749#section-2.2
|
||||
.. _`Section 3.1.2`: http://tools.ietf.org/html/rfc6749#section-3.1.2
|
||||
.. _`Section 3.3`: http://tools.ietf.org/html/rfc6749#section-3.3
|
||||
.. _`Section 10.12`: http://tools.ietf.org/html/rfc6749#section-10.12
|
||||
.. _`Appendix B`: https://tools.ietf.org/html/rfc6749#appendix-B
|
||||
.. _`Section 2.2`: https://tools.ietf.org/html/rfc6749#section-2.2
|
||||
.. _`Section 3.1.2`: https://tools.ietf.org/html/rfc6749#section-3.1.2
|
||||
.. _`Section 3.3`: https://tools.ietf.org/html/rfc6749#section-3.3
|
||||
.. _`Section 10.12`: https://tools.ietf.org/html/rfc6749#section-10.12
|
||||
"""
|
||||
return prepare_grant_uri(uri, self.client_id, 'token',
|
||||
scope = self.scope if scope is None else scope
|
||||
return prepare_grant_uri(uri, self.client_id, self.response_type,
|
||||
redirect_uri=redirect_uri, state=state, scope=scope, **kwargs)
|
||||
|
||||
def parse_request_uri_response(self, uri, state=None, scope=None):
|
||||
|
@ -165,9 +165,10 @@ class MobileApplicationClient(Client):
|
|||
>>> client.parse_request_body_response(response_body, scope=['other'])
|
||||
('Scope has changed from "other" to "hello world".', ['other'], ['hello', 'world'])
|
||||
|
||||
.. _`Section 7.1`: http://tools.ietf.org/html/rfc6749#section-7.1
|
||||
.. _`Section 3.3`: http://tools.ietf.org/html/rfc6749#section-3.3
|
||||
.. _`Section 7.1`: https://tools.ietf.org/html/rfc6749#section-7.1
|
||||
.. _`Section 3.3`: https://tools.ietf.org/html/rfc6749#section-3.3
|
||||
"""
|
||||
scope = self.scope if scope is None else scope
|
||||
self.token = parse_implicit_response(uri, state=state, scope=scope)
|
||||
self._populate_attributes(self.token)
|
||||
self.populate_token_attributes(self.token)
|
||||
return self.token
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue