Module Expr Str ImportFrom alias alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Dict Str Str Str Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Return Call NameLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad NameLoad NameLoad body Expr Str Assign NameStore Dict Str Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad BoolOpOr NameLoad Dict Return TupleLoad NameLoad NameLoad Num orelse Return TupleLoad Dict NameLoad Num handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Return TupleLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str orelse Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr keyword BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr keyword Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr body Return TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad Assign NameStore Call NameLoad TupleLoad NameLoad NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Return TupleLoad NameLoad NameLoad decorator_list decorator_list
N/A N/A 
oauthlib.oauth1.rfc5849.endpoints.request_token
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This module is an implementation of the request token provider logic of
OAuth 1.0 RFC 5849. It validates the correctness of request token requests,
creates and persists tokens as well as create the proper response to be
returned to the client.
 __future__ absolute_import unicode_literals N/A logging oauthlib.common urlencode base BaseEndpoint N/A errors N/A log N/A N/A logging getLogger __name__ RequestTokenEndpoint N/A BaseEndpoint N/A N/A An endpoint responsible for providing OAuth 1 request tokens.

    Typical use is to instantiate with a request validator and invoke the
    ``create_request_token_response`` from a view function. The tuple returned
    has all information necessary (body, status, headers) to quickly form
    and return a proper response. See :doc:`/oauth1/validator` for details on which
    validator methods to implement for this endpoint.
     create_request_token N/A N/A self request credentials N/A N/A N/A Create and save a new request token.

        :param request: An oauthlib.common.Request object.
        :param credentials: A dict of extra token credentials.
        :returns: The token as an urlencoded string.
         N/A token N/A oauth_token oauth_token_secret oauth_callback_confirmed N/A N/A self token_generator N/A N/A self token_generator true N/A N/A N/A token update credentials N/A N/A N/A N/A self request_validator save_request_token token request N/A N/A urlencode N/A N/A token items N/A create_request_token_response N/A N/A self uri http_method body headers credentials N/A GET None None None N/A N/A Create a request token response, with a new request token if valid.

        :param uri: The full URI of the token request.
        :param http_method: A valid HTTP verb, i.e. GET, POST, PUT, HEAD, etc.
        :param body: The request body as a string.
        :param headers: The request headers as a dict.
        :param credentials: A list of extra credentials to include in the token.
        :returns: A tuple of 3 elements.
                  1. A dict of headers to set on the response.
                  2. The response body as a string.
                  3. The response status code as an integer.

        An example of a valid request::

            >>> from your_validator import your_validator
            >>> from oauthlib.oauth1 import RequestTokenEndpoint
            >>> endpoint = RequestTokenEndpoint(your_validator)
            >>> h, b, s = endpoint.create_request_token_response(
            ...     'https://your.provider/request_token?foo=bar',
            ...     headers={
            ...         'Authorization': 'OAuth realm=movies user, oauth_....'
            ...     },
            ...     credentials={
            ...         'my_specific': 'argument',
            ...     })
            >>> h
            {'Content-Type': 'application/x-www-form-urlencoded'}
            >>> b
            'oauth_token=lsdkfol23w54jlksdef&oauth_token_secret=qwe089234lkjsdf&oauth_callback_confirmed=true&my_specific=argument'
            >>> s
            200

        An response to invalid request would have a different body and status::

            >>> b
            'error=invalid_request&description=missing+callback+uri'
            >>> s
            400

        The same goes for an an unauthorized request:

            >>> b
            ''
            >>> s
            401
         N/A resp_headers N/A Content-Type application/x-www-form-urlencoded N/A N/A N/A request N/A N/A self _create_request uri http_method body headers N/A N/A valid processed_request N/A N/A self validate_request_token_request request N/A valid N/A N/A token N/A N/A self create_request_token request N/A credentials N/A N/A N/A resp_headers token 200 N/A N/A N/A N/A None 401 N/A N/A N/A N/A errors OAuth1Error N/A e N/A N/A N/A resp_headers N/A e urlencoded N/A e status_code N/A validate_request_token_request N/A N/A self request N/A N/A N/A Validate a request token request.

        :param request: An oauthlib.common.Request object.
        :raises: OAuth1Error if the request is invalid.
        :returns: A tuple of 2 elements.
                  1. The validation result (True or False).
                  2. The request object.
         N/A N/A N/A self _check_transport_security request N/A N/A N/A self _check_mandatory_parameters request N/A N/A request realm N/A N/A N/A request realms N/A N/A N/A request realm split N/A N/A N/A request realms N/A N/A N/A self request_validator get_default_realms N/A request client_key request N/A N/A N/A N/A N/A self request_validator check_realms N/A request realms N/A N/A N/A N/A errors InvalidRequestError description N/A Invalid realm %s. Allowed are %r. N/A N/A request realms N/A N/A self request_validator realms N/A N/A N/A request redirect_uri N/A N/A N/A N/A errors InvalidRequestError description Missing callback URI. N/A N/A N/A N/A N/A self request_validator validate_timestamp_and_nonce N/A request client_key N/A request timestamp N/A request nonce request request_token N/A request resource_owner_key N/A N/A N/A False request N/A valid_client N/A N/A N/A self request_validator validate_client_key N/A request client_key request N/A N/A valid_client N/A N/A N/A request client_key N/A N/A self request_validator dummy_client N/A valid_realm N/A N/A N/A self request_validator validate_requested_realms N/A request client_key N/A request realms request N/A valid_redirect N/A N/A N/A self request_validator validate_redirect_uri N/A request client_key N/A request redirect_uri request N/A N/A N/A request redirect_uri N/A N/A N/A NotImplementedError Redirect URI must either be provided or set to a default during validation. N/A valid_signature N/A N/A self _check_signature request N/A N/A N/A request validator_log N/A client valid_client N/A N/A N/A request validator_log N/A realm valid_realm N/A N/A N/A request validator_log N/A callback valid_redirect N/A N/A N/A request validator_log N/A signature valid_signature N/A v N/A all N/A valid_client valid_realm valid_redirect valid_signature N/A N/A v N/A N/A N/A N/A log info [Failure] request verification failed. N/A N/A N/A log info Valid client: %s. valid_client N/A N/A N/A log info Valid realm: %s. valid_realm N/A N/A N/A log info Valid callback: %s. valid_redirect N/A N/A N/A log info Valid signature: %s. valid_signature N/A N/A v request N/A N/A