Module Expr Str Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias identifier ImportFrom alias alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias alias Assign NameStore TupleLoad NameLoad NameLoad Assign NameStore TupleLoad Str Str Assign NameStore Call AttributeLoad NameLoad attr Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Str Dict Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str If NameLoad body Return NameLoad Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str If NameLoad body Return Call NameLoad NameLoad Return Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad NameLoad Str body Return Call NameLoad AttributeLoad NameLoad attr If BoolOpAnd Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str body Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad If AttributeLoad AttributeLoad NameLoad attr attr body Assign AttributeStore NameLoad attr Lambda arguments args defaults vararg kwarg NameLoad Return NameLoad Raise Call NameLoad Str decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str FunctionDef arguments args defaults vararg kwarg body If CompareEq AttributeLoad NameLoad attr Str body If UnaryOpNot Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr ListLoad TupleLoad Str Str Return Call NameLoad NameLoad Return Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad TryExcept body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Return Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr ExceptHandler type AttributeLoad NameLoad attr name NameStore body Return Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad TryExcept body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Return Call NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Return Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr ExceptHandler type AttributeLoad NameLoad attr name NameStore body Return Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str FunctionDef arguments args defaults vararg kwarg body Assign NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad Assign NameStore Call NameLoad NameLoad NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad Return Call NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Return Call NameLoad NameLoad decorator_list Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str FunctionDef arguments args defaults vararg kwarg body Assign NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad Assign NameStore Call NameLoad NameLoad NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad Return Call NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Return Call NameLoad NameLoad decorator_list Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str FunctionDef arguments args NameParam defaults body FunctionDef arguments args defaults vararg kwarg body For NameStore AttributeLoad NameLoad attr body Expr Call NameLoad If BoolOpAnd Call NameLoad NameLoad Str AttributeLoad NameLoad attr body Return Call NameLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad TryExcept body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr Call NameLoad ListLoad TupleLoad Str Str Assign AttributeStore NameLoad attr Num Return Call NameLoad NameLoad For NameStore AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body Return Call NameLoad Num Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad Return Call NameLoad NameLoad NameLoad decorator_list Call NameLoad NameLoad Return NameLoad decorator_list Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BoolOpOr NameLoad Dict decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr Str TupleLoad Num Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr Str TupleLoad Num Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr Str TupleLoad Num Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr Str TupleLoad Num Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr Str TupleLoad Num Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr Str ListLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call NameLoad Str Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call NameLoad Str Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call NameLoad Str Str decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad If AttributeLoad NameLoad attr body Return AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Assign NameStore BoolOpOr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad If BoolOpAnd NameLoad CompareEq AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr NameLoad Return AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Assign NameStore BoolOpOr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad If NameLoad body Assign AttributeStore NameLoad attr NameLoad Return AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore AttributeLoad NameLoad attr If Call NameLoad NameLoad Str body Return AttributeLoad NameLoad attr Return ListLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore BoolOpOr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad If UnaryOpNot NameLoad body Return ListLoad Assign AttributeStore NameLoad attr NameLoad If Call NameLoad NameLoad Str body Return BoolOpOr AttributeLoad NameLoad attr ListLoad Return ListLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore BoolOpOr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad If Call NameLoad AttributeLoad NameLoad attr Str body Return AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad If AttributeLoad NameLoad attr body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Assign NameStore BoolOpOr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad If BoolOpAnd NameLoad CompareEq AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr NameLoad Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Assign NameStore BoolOpOr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad If NameLoad body Assign AttributeStore NameLoad attr NameLoad Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If NameLoad body Return NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Return NameLoad If BoolOpAnd UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr CompareIs NameLoad NameLoad body Return NameLoad Assign AttributeStore NameLoad attr NameLoad Return CompareIn NameLoad AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Return NameLoad If Call NameLoad NameLoad Str body Return Call AttributeLoad NameLoad attr NameLoad If Call AttributeLoad Call NameLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad If AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Assign AttributeStore NameLoad attr NameLoad If UnaryOpNot NameLoad body Return NameLoad Return Call AttributeLoad Call NameLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad If UnaryOpNot NameLoad body Return NameLoad If UnaryOpNot Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr Str Return NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr If Call NameLoad NameLoad Str body Return CompareEq AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore BoolOpOr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad If NameLoad body Assign AttributeStore NameLoad attr NameLoad Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore BoolOpOr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad If UnaryOpNot NameLoad body Return NameLoad Assign AttributeStore NameLoad attr NameLoad If UnaryOpNot Call NameLoad NameLoad Str body Return NameLoad Return CompareEq Call NameLoad AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Return NameLoad decorator_list
N/A N/A 
    flask_oauthlib.provider.oauth1
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Implemnts OAuth1 provider support for Flask.

    :copyright: (c) 2013 - 2014 by Hsiaoming Yang.
 N/A logging functools wraps werkzeug cached_property flask request redirect url_for flask make_response abort oauthlib.oauth1 RequestValidator oauthlib.oauth1 WebApplicationServer Server oauthlib.oauth1 SIGNATURE_HMAC SIGNATURE_RSA oauthlib.common to_unicode add_params_to_uri urlencode oauthlib.oauth1.rfc5849 errors utils extract_params create_response N/A SIGNATURE_METHODS N/A SIGNATURE_HMAC SIGNATURE_RSA N/A __all__ N/A OAuth1Provider OAuth1RequestValidator N/A log N/A N/A logging getLogger flask_oauthlib OAuth1Provider N/A object N/A N/A Provide secure services using OAuth1.

    Like many other Flask extensions, there are two usage modes. One is
    binding the Flask app instance::

        app = Flask(__name__)
        oauth = OAuth1Provider(app)

    The second possibility is to bind the Flask app later::

        oauth = OAuth1Provider()

        def create_app():
            app = Flask(__name__)
            oauth.init_app(app)
            return app

    And now you can protect the resource with realms::

        @app.route('/api/user')
        @oauth.require_oauth('email', 'username')
        def user():
            return jsonify(request.oauth.user)
     __init__ N/A N/A self app N/A None N/A N/A N/A self _before_request_funcs N/A N/A N/A self _after_request_funcs N/A N/A app N/A N/A N/A N/A self init_app app N/A init_app N/A N/A self app N/A N/A N/A 
        This callback can be used to initialize an application for the
        oauth provider instance.
         N/A N/A self app app N/A N/A app extensions N/A getattr app extensions N/A N/A N/A N/A app extensions N/A oauthlib.provider.oauth1 self N/A error_uri N/A N/A self N/A N/A N/A The error page URI.

        When something turns error, it will redirect to this error page.
        You can configure the error page URI with Flask config::

            OAUTH1_PROVIDER_ERROR_URI = '/error'

        You can also define the error page by a named endpoint::

            OAUTH1_PROVIDER_ERROR_ENDPOINT = 'oauth.error'
         N/A error_uri N/A N/A N/A N/A self app config get OAUTH1_PROVIDER_ERROR_URI N/A error_uri N/A N/A error_uri N/A error_endpoint N/A N/A N/A N/A self app config get OAUTH1_PROVIDER_ERROR_ENDPOINT N/A error_endpoint N/A N/A N/A url_for error_endpoint N/A /oauth/errors N/A cached_property server N/A N/A self N/A N/A N/A 
        All in one endpoints. This property is created automaticly
        if you have implemented all the getters and setters.
         N/A N/A hasattr self _validator N/A N/A N/A Server N/A self _validator N/A N/A N/A hasattr self _clientgetter N/A hasattr self _tokengetter N/A hasattr self _tokensetter N/A hasattr self _noncegetter N/A hasattr self _noncesetter N/A hasattr self _grantgetter N/A hasattr self _grantsetter N/A hasattr self _verifiergetter N/A hasattr self _verifiersetter N/A N/A validator N/A OAuth1RequestValidator clientgetter N/A self _clientgetter tokengetter N/A self _tokengetter tokensetter N/A self _tokensetter grantgetter N/A self _grantgetter grantsetter N/A self _grantsetter noncegetter N/A self _noncegetter noncesetter N/A self _noncesetter verifiergetter N/A self _verifiergetter verifiersetter N/A self _verifiersetter config N/A N/A self app config N/A N/A self _validator validator N/A server N/A Server validator N/A N/A N/A self app testing N/A N/A N/A server _check_signature N/A N/A N/A N/A args kwargs True N/A server N/A N/A RuntimeError application not bound to required getters and setters N/A cached_property before_request N/A N/A self f N/A N/A N/A Register functions to be invoked before accessing the resource.

        The function accepts nothing as parameters, but you can get
        information from `Flask.request` object. It is usually useful
        for setting limitation on the client request::

            @oauth.before_request
            def limit_client_request():
                client_key = request.values.get('client_key')
                if not client_key:
                    return
                client = Client.get(client_key)
                if over_limit(client):
                    return abort(403)

                track_request(client)
         N/A N/A N/A N/A self _before_request_funcs append f N/A f N/A after_request N/A N/A self f N/A N/A N/A Register functions to be invoked after accessing the resource.

        The function accepts ``valid`` and ``request`` as parameters,
        and it should return a tuple of them::

            @oauth.after_request
            def valid_after_request(valid, oauth):
                if oauth.user in black_list:
                    return False, oauth
                return valid, oauth
         N/A N/A N/A N/A self _after_request_funcs append f N/A f N/A clientgetter N/A N/A self f N/A N/A N/A Register a function as the client getter.

        The function accepts one parameter `client_key`, and it returns
        a client object with at least these information:

            - client_key: A random string
            - client_secret: A random string
            - redirect_uris: A list of redirect uris
            - default_realms: Default scopes of the client

        The client may contain more information, which is suggested:

            - default_redirect_uri: One of the redirect uris

        Implement the client getter::

            @oauth.clientgetter
            def get_client(client_key):
                client = get_client_model(client_key)
                # Client is an object
                return client
         N/A N/A self _clientgetter f N/A f N/A tokengetter N/A N/A self f N/A N/A N/A Register a function as the access token getter.

        The function accepts `client_key` and `token` parameters, and it
        returns an access token object contains:

            - client: Client associated with this token
            - user: User associated with this token
            - token: Access token
            - secret: Access token secret
            - realms: Realms with this access token

        Implement the token getter::

            @oauth.tokengetter
            def get_access_token(client_key, token):
                return AccessToken.get(client_key=client_key, token=token)
         N/A N/A self _tokengetter f N/A f N/A tokensetter N/A N/A self f N/A N/A N/A Register a function as the access token setter.

        The setter accepts two parameters at least, one is token,
        the other is request::

            @oauth.tokensetter
            def save_access_token(token, request):
                access_token = AccessToken(
                    client=request.client,
                    user=request.user,
                    token=token['oauth_token'],
                    secret=token['oauth_token_secret'],
                    realms=token['oauth_authorized_realms'].split(' '),
                )
                return access_token.save()

        The parameter token is a dict, that looks like::

            {
                u'oauth_token': u'arandomstringoftoken',
                u'oauth_token_secret': u'arandomstringofsecret',
                u'oauth_authorized_realms': u'email address'
            }

        The `request` object would provide these information (at least)::

            - client: Client object associated with this token
            - user: User object associated with this token
            - request_token: Requst token for exchanging this access token
         N/A N/A self _tokensetter f N/A f N/A grantgetter N/A N/A self f N/A N/A N/A Register a function as the request token getter.

        The function accepts a `token` parameter, and it returns an
        request token object contains:

            - client: Client associated with this token
            - token: Access token
            - secret: Access token secret
            - realms: Realms with this access token
            - redirect_uri: A URI for redirecting

        Implement the token getter::

            @oauth.tokengetter
            def get_request_token(token):
                return RequestToken.get(token=token)
         N/A N/A self _grantgetter f N/A f N/A grantsetter N/A N/A self f N/A N/A N/A Register a function as the request token setter.

        The setter accepts a token and request parameters::

            @oauth.grantsetter
            def save_request_token(token, request):
                data = RequestToken(
                    token=token['oauth_token'],
                    secret=token['oauth_token_secret'],
                    client=request.client,
                    redirect_uri=oauth.redirect_uri,
                    realms=request.realms,
                )
                return data.save()
         N/A N/A self _grantsetter f N/A f N/A noncegetter N/A N/A self f N/A N/A N/A Register a function as the nonce and timestamp getter.

        The function accepts parameters:

            - client_key: The client/consure key
            - timestamp: The ``oauth_timestamp`` parameter
            - nonce: The ``oauth_nonce`` parameter
            - request_token: Request token string, if any
            - access_token: Access token string, if any

        A nonce and timestamp make each request unique. The implementation::

            @oauth.noncegetter
            def get_nonce(client_key, timestamp, nonce, request_token,
                          access_token):
                return Nonce.get("...")
         N/A N/A self _noncegetter f N/A f N/A noncesetter N/A N/A self f N/A N/A N/A Register a function as the nonce and timestamp setter.

        The parameters are the same with :meth:`noncegetter`::

            @oauth.noncegetter
            def save_nonce(client_key, timestamp, nonce, request_token,
                           access_token):
                data = Nonce("...")
                return data.save()

        The timestamp will be expired in 60s, it would be a better design
        if you put timestamp and nonce object in a cache.
         N/A N/A self _noncesetter f N/A f N/A verifiergetter N/A N/A self f N/A N/A N/A Register a function as the verifier getter.

        The return verifier object should at least contain a user object
        which is the current user.

        The implemented code looks like::

            @oauth.verifiergetter
            def load_verifier(verifier, token):
                data = Verifier.get(verifier)
                if data.request_token == token:
                    # check verifier for safety
                    return data
                return data
         N/A N/A self _verifiergetter f N/A f N/A verifiersetter N/A N/A self f N/A N/A N/A Register a function as the verifier setter.

        A verifier is better together with request token, but it is not
        required. A verifier is used together with request token for
        exchanging access token, it has an expire time, in this case, it
        would be a better design if you put them in a cache.

        The implemented code looks like::

            @oauth.verifiersetter
            def save_verifier(verifier, token, *args, **kwargs):
                data = Verifier(
                    verifier=verifier['oauth_verifier'],
                    request_token=token,
                    user=get_current_user()
                )
                return data.save()
         N/A N/A self _verifiersetter f N/A f N/A authorize_handler N/A N/A self f N/A N/A N/A Authorization handler decorator.

        This decorator will sort the parameters and headers out, and
        pre validate everything::

            @app.route('/oauth/authorize', methods=['GET', 'POST'])
            @oauth.authorize_handler
            def authorize(*args, **kwargs):
                if request.method == 'GET':
                    # render a page for user to confirm the authorization
                    return render_template('oauthorize.html')

                confirm = request.form.get('confirm', 'no')
                return confirm == 'yes'
         decorated N/A N/A N/A args kwargs N/A N/A N/A N/A request method POST N/A N/A N/A N/A f args kwargs N/A N/A uri N/A add_params_to_uri N/A self error_uri N/A N/A error denied N/A N/A redirect uri N/A N/A N/A self confirm_authorization_request N/A server N/A self server N/A N/A uri http_method body headers N/A extract_params N/A N/A N/A N/A realms credentials N/A N/A server get_realms_and_credentials uri http_method http_method body body headers headers N/A N/A kwargs N/A realms realms N/A N/A N/A kwargs update credentials N/A N/A f args kwargs N/A N/A N/A N/A errors OAuth1Error N/A e N/A N/A N/A redirect N/A N/A e in_uri N/A self error_uri N/A N/A N/A errors InvalidClientError N/A e N/A N/A N/A redirect N/A N/A e in_uri N/A self error_uri N/A N/A wraps f N/A decorated N/A confirm_authorization_request N/A N/A self N/A N/A N/A When consumer confirm the authrozation. N/A server N/A self server N/A N/A uri http_method body headers N/A extract_params N/A N/A N/A N/A realms credentials N/A N/A server get_realms_and_credentials uri http_method http_method body body headers headers N/A ret N/A N/A server create_authorization_response uri http_method body headers realms credentials N/A N/A N/A log debug Authorization successful. N/A N/A create_response ret N/A N/A N/A N/A errors OAuth1Error N/A e N/A N/A N/A redirect N/A N/A e in_uri N/A self error_uri N/A N/A N/A errors InvalidClientError N/A e N/A N/A N/A redirect N/A N/A e in_uri N/A self error_uri N/A request_token_handler N/A N/A self f N/A N/A N/A Request token handler decorator.

        The decorated function should return an dictionary or None as
        the extra credentials for creating the token response.

        If you don't need to add any extra credentials, it could be as
        simple as::

            @app.route('/oauth/request_token')
            @oauth.request_token_handler
            def request_token():
                return {}
         decorated N/A N/A N/A args kwargs N/A N/A server N/A self server N/A N/A uri http_method body headers N/A extract_params N/A credentials N/A f args kwargs N/A N/A N/A ret N/A N/A server create_request_token_response uri http_method body headers credentials N/A N/A create_response ret N/A N/A N/A N/A errors OAuth1Error N/A e N/A N/A N/A _error_response e N/A N/A wraps f N/A decorated N/A access_token_handler N/A N/A self f N/A N/A N/A Access token handler decorator.

        The decorated function should return an dictionary or None as
        the extra credentials for creating the token response.

        If you don't need to add any extra credentials, it could be as
        simple as::

            @app.route('/oauth/access_token')
            @oauth.access_token_handler
            def access_token():
                return {}
         decorated N/A N/A N/A args kwargs N/A N/A server N/A self server N/A N/A uri http_method body headers N/A extract_params N/A credentials N/A f args kwargs N/A N/A N/A ret N/A N/A server create_access_token_response uri http_method body headers credentials N/A N/A create_response ret N/A N/A N/A N/A errors OAuth1Error N/A e N/A N/A N/A _error_response e N/A N/A wraps f N/A decorated N/A require_oauth N/A N/A self N/A realms kwargs N/A N/A Protect resource with specified scopes. wrapper N/A N/A f N/A N/A decorated N/A N/A N/A args kwargs N/A N/A func N/A self _before_request_funcs N/A N/A N/A func N/A N/A N/A hasattr request oauth N/A request oauth N/A N/A N/A f args kwargs N/A server N/A self server N/A N/A uri http_method body headers N/A extract_params N/A N/A N/A N/A valid req N/A N/A server validate_protected_resource_request uri http_method body headers realms N/A N/A N/A Exception N/A e N/A N/A N/A N/A log warn Exception: %r e N/A N/A e urlencoded N/A urlencode N/A N/A error unknown N/A N/A e status_code 400 N/A N/A _error_response e N/A func N/A self _after_request_funcs N/A N/A N/A valid req N/A func valid req N/A N/A valid N/A N/A N/A abort 401 N/A N/A req user N/A N/A req access_token user N/A N/A request oauth req N/A N/A f args kwargs N/A N/A wraps f N/A decorated N/A N/A wrapper N/A N/A OAuth1RequestValidator N/A RequestValidator N/A N/A Subclass of Request Validator.

    :param clientgetter: a function to get client object
    :param tokengetter: a function to get access token
    :param tokensetter: a function to save access token
    :param grantgetter: a function to get request token
    :param grantsetter: a function to save request token
    :param noncegetter: a function to get nonce and timestamp
    :param noncesetter: a function to save nonce and timestamp
     __init__ N/A N/A self clientgetter tokengetter tokensetter grantgetter grantsetter noncegetter noncesetter verifiergetter verifiersetter config N/A None N/A N/A N/A self _clientgetter clientgetter N/A N/A self _tokengetter tokengetter N/A N/A self _tokensetter tokensetter N/A N/A self _grantgetter grantgetter N/A N/A self _grantsetter grantsetter N/A N/A self _noncegetter noncegetter N/A N/A self _noncesetter noncesetter N/A N/A self _verifiergetter verifiergetter N/A N/A self _verifiersetter verifiersetter N/A N/A self _config N/A config N/A N/A allowed_signature_methods N/A N/A self N/A N/A N/A Allowed signature methods.

        Default value: SIGNATURE_HMAC and SIGNATURE_RSA.

        You can customize with Flask Config:

            - OAUTH1_PROVIDER_SIGNATURE_METHODS
         N/A N/A N/A N/A self _config get OAUTH1_PROVIDER_SIGNATURE_METHODS SIGNATURE_METHODS N/A property client_key_length N/A N/A self N/A N/A N/A N/A N/A N/A self _config get OAUTH1_PROVIDER_KEY_LENGTH N/A 20 30 N/A property request_token_length N/A N/A self N/A N/A N/A N/A N/A N/A self _config get OAUTH1_PROVIDER_KEY_LENGTH N/A 20 30 N/A property access_token_length N/A N/A self N/A N/A N/A N/A N/A N/A self _config get OAUTH1_PROVIDER_KEY_LENGTH N/A 20 30 N/A property nonce_length N/A N/A self N/A N/A N/A N/A N/A N/A self _config get OAUTH1_PROVIDER_KEY_LENGTH N/A 20 30 N/A property verifier_length N/A N/A self N/A N/A N/A N/A N/A N/A self _config get OAUTH1_PROVIDER_KEY_LENGTH N/A 20 30 N/A property realms N/A N/A self N/A N/A N/A N/A N/A N/A self _config get OAUTH1_PROVIDER_REALMS N/A N/A property enforce_ssl N/A N/A self N/A N/A N/A Enforce SSL request.

        Default is True. You can customize with:

            - OAUTH1_PROVIDER_ENFORCE_SSL
         N/A N/A N/A N/A self _config get OAUTH1_PROVIDER_ENFORCE_SSL True N/A property dummy_client N/A N/A self N/A N/A N/A N/A to_unicode dummy_client utf-8 N/A property dummy_request_token N/A N/A self N/A N/A N/A N/A to_unicode dummy_request_token utf-8 N/A property dummy_access_token N/A N/A self N/A N/A N/A N/A to_unicode dummy_access_token utf-8 N/A property get_client_secret N/A N/A self client_key request N/A N/A N/A Get client secret.

        The client object must has ``client_secret`` attribute.
         N/A N/A N/A log debug Get client secret of %r client_key N/A N/A N/A request client N/A N/A N/A request client N/A N/A self _clientgetter client_key client_key N/A N/A request client N/A N/A N/A N/A request client client_secret N/A None N/A get_request_token_secret N/A N/A self client_key token request N/A N/A N/A Get request token secret.

        The request token object should a ``secret`` attribute.
         N/A N/A N/A log debug Get request token secret of %r for %r token client_key N/A tok N/A N/A request request_token N/A N/A self _grantgetter token token N/A N/A tok N/A N/A tok client_key client_key N/A N/A N/A request request_token tok N/A N/A tok secret N/A None N/A get_access_token_secret N/A N/A self client_key token request N/A N/A N/A Get access token secret.

        The access token object should a ``secret`` attribute.
         N/A N/A N/A log debug Get access token secret of %r for %r token client_key N/A tok N/A N/A request access_token N/A N/A self _tokengetter client_key client_key token token N/A tok N/A N/A N/A request access_token tok N/A N/A tok secret N/A None N/A get_default_realms N/A N/A self client_key request N/A N/A N/A Default realms of the client. N/A N/A N/A log debug Get realms for %r client_key N/A N/A N/A request client N/A N/A N/A request client N/A N/A self _clientgetter client_key client_key N/A client N/A request client N/A N/A hasattr client default_realms N/A N/A N/A client default_realms N/A N/A N/A get_realms N/A N/A self token request N/A N/A N/A Realms for this request token. N/A N/A N/A log debug Get realms of %r token N/A tok N/A N/A request request_token N/A N/A self _grantgetter token token N/A N/A tok N/A N/A N/A N/A N/A request request_token tok N/A N/A hasattr tok realms N/A N/A N/A N/A tok realms N/A N/A N/A N/A get_redirect_uri N/A N/A self token request N/A N/A N/A Redirect uri for this request token. N/A N/A N/A log debug Get redirect uri of %r token N/A tok N/A N/A request request_token N/A N/A self _grantgetter token token N/A N/A tok redirect_uri N/A get_rsa_key N/A N/A self client_key request N/A N/A N/A Retrieves a previously stored client provided RSA key. N/A N/A N/A request client N/A N/A N/A request client N/A N/A self _clientgetter client_key client_key N/A N/A hasattr N/A request client rsa_key N/A N/A N/A N/A request client rsa_key N/A None N/A invalidate_request_token N/A N/A self client_key request_token request N/A N/A N/A Invalidates a used request token. N/A validate_client_key N/A N/A self client_key request N/A N/A N/A Validates that supplied client key. N/A N/A N/A log debug Validate client key for %r client_key N/A N/A N/A request client N/A N/A N/A request client N/A N/A self _clientgetter client_key client_key N/A N/A request client N/A N/A True N/A False N/A validate_request_token N/A N/A self client_key token request N/A N/A N/A Validates request token is available for client. N/A N/A N/A log debug Validate request token %r for %r token client_key N/A tok N/A N/A request request_token N/A N/A self _grantgetter token token N/A N/A tok N/A N/A tok client_key client_key N/A N/A N/A request request_token tok N/A True N/A False N/A validate_access_token N/A N/A self client_key token request N/A N/A N/A Validates access token is available for client. N/A N/A N/A log debug Validate access token %r for %r token client_key N/A tok N/A N/A request access_token N/A N/A self _tokengetter client_key client_key token token N/A tok N/A N/A N/A request access_token tok N/A True N/A False N/A validate_timestamp_and_nonce N/A N/A self client_key timestamp nonce request request_token access_token N/A None None N/A N/A Validate the timestamp and nonce is used or not. N/A N/A N/A log debug Validate timestamp and nonce %r client_key N/A nonce_exists N/A N/A self _noncegetter client_key client_key timestamp timestamp nonce nonce request_token request_token access_token access_token N/A nonce_exists N/A N/A False N/A N/A N/A self _noncesetter client_key client_key timestamp timestamp nonce nonce request_token request_token access_token access_token N/A True N/A validate_redirect_uri N/A N/A self client_key redirect_uri request N/A N/A N/A Validate if the redirect_uri is allowed by the client. N/A N/A N/A log debug Validate redirect_uri %r for %r redirect_uri client_key N/A N/A N/A request client N/A N/A N/A request client N/A N/A self _clientgetter client_key client_key N/A N/A N/A request client N/A N/A False N/A N/A N/A N/A N/A request client redirect_uris N/A redirect_uri None N/A N/A True N/A N/A request redirect_uri redirect_uri N/A N/A redirect_uri N/A N/A request client redirect_uris N/A validate_requested_realms N/A N/A self client_key realms request N/A N/A N/A N/A N/A log debug Validate requested realms %r for %r realms client_key N/A N/A N/A request client N/A N/A N/A request client N/A N/A self _clientgetter client_key client_key N/A client N/A request client N/A N/A client N/A N/A False N/A N/A hasattr client validate_realms N/A N/A N/A N/A client validate_realms realms N/A N/A N/A N/A set N/A client default_realms issuperset N/A set realms N/A N/A True N/A True N/A validate_realms N/A N/A self client_key token request uri realms N/A None None N/A N/A Check if the token has permission on those realms. N/A N/A N/A log debug Validate realms %r for %r realms client_key N/A N/A request access_token N/A N/A tok N/A request access_token N/A N/A tok N/A N/A self _tokengetter client_key client_key token token N/A N/A request access_token tok N/A N/A tok N/A N/A False N/A N/A N/A N/A set N/A tok realms issuperset N/A set realms N/A validate_verifier N/A N/A self client_key token verifier request N/A N/A N/A Validate verifier exists. N/A N/A N/A log debug Validate verifier %r for %r verifier client_key N/A data N/A N/A self _verifiergetter verifier verifier token token N/A N/A data N/A N/A False N/A N/A N/A hasattr data user N/A N/A N/A N/A log debug Verifier should has user attribute N/A False N/A N/A request user N/A data user N/A N/A hasattr data client_key N/A N/A N/A N/A data client_key client_key N/A True N/A verify_request_token N/A N/A self token request N/A N/A N/A Verify if the request token is existed. N/A N/A N/A log debug Verify request token %r token N/A tok N/A N/A request request_token N/A N/A self _grantgetter token token N/A tok N/A N/A N/A request request_token tok N/A True N/A False N/A verify_realms N/A N/A self token realms request N/A N/A N/A Verify if the realms match the requested realms. N/A N/A N/A log debug Verify realms %r realms N/A tok N/A N/A request request_token N/A N/A self _grantgetter token token N/A N/A tok N/A N/A False N/A N/A request request_token tok N/A N/A N/A hasattr tok realms N/A N/A True N/A N/A N/A set N/A tok realms N/A set realms N/A save_access_token N/A N/A self token request N/A N/A N/A Save access token to database.

        A tokensetter is required, which accepts a token and request
        parameters::

            def tokensetter(token, request):
                access_token = Token(
                    client=request.client,
                    user=request.user,
                    token=token['oauth_token'],
                    secret=token['oauth_token_secret'],
                    realms=token['oauth_authorized_realms'],
                )
                return access_token.save()
         N/A N/A N/A log debug Save access token %r token N/A N/A N/A self _tokensetter token request N/A save_request_token N/A N/A self token request N/A N/A N/A Save request token to database.

        A grantsetter is required, which accepts a token and request
        parameters::

            def grantsetter(token, request):
                grant = Grant(
                    token=token['oauth_token'],
                    secret=token['oauth_token_secret'],
                    client=request.client,
                    redirect_uri=oauth.redirect_uri,
                    realms=request.realms,
                )
                return grant.save()
         N/A N/A N/A log debug Save request token %r token N/A N/A N/A self _grantsetter token request N/A save_verifier N/A N/A self token verifier request N/A N/A N/A Save verifier to database.

        A verifiersetter is required. It would be better to combine request
        token and verifier together::

            def verifiersetter(token, verifier, request):
                tok = Grant.query.filter_by(token=token).first()
                tok.verifier = verifier['oauth_verifier']
                tok.user = get_current_user()
                return tok.save()

        .. admonition:: Note:

            A user is required on verifier, remember to attach current
            user to verifier.
         N/A N/A N/A log debug Save verifier %r for %r verifier token N/A N/A N/A self _verifiersetter token token verifier verifier request request N/A N/A _error_response N/A N/A e N/A N/A N/A res N/A make_response N/A e urlencoded N/A e status_code N/A N/A N/A res headers N/A Content-Type application/x-www-form-urlencoded N/A res N/A