Пример #1
0
    Store,
)

from py3oauth2 import message
from py3oauth2.errors import make_error
from py3oauth2.interfaces import ClientType
from py3oauth2.provider import (
    AuthorizationProvider,
    ResourceProvider,
)


__all__ = ['mock']


DummyError = make_error('DummyError', 'dummy_error')


class Response(message.Response):
    param = message.Parameter(str, required=True)


class Request(message.Request):
    response = Response

    grant_type = message.Parameter(str, required=True,
                                   default='test', editable=False)
    response_type = message.Parameter(str)
    response_mode = message.Parameter(str)

    def handle(self, provider, owner):
Пример #2
0
# -*- coding: utf-8 -*-

from py3oauth2.errors import (
    make_error,
    AccessDenied,
    ErrorException,
    InvalidRequest,
    InvalidScope,
    ServerError,
    UnauthorizedClient,
    UnsupportedGrantType,
    UnsupportedResponseType,
)


__all__ = [
    'AccessDenied', 'ErrorException', 'InvalidRequest', 'InvalidScope',
    'InvalidScope', 'ServerError', 'UnauthorizedClient',
    'UnsupportedGrantType', 'UnsupportedResponseType', 'InteractionRequired',
    'LoginRequired'
]


InteractionRequired = make_error('InteractionRequired', 'interaction_required')
LoginRequired = make_error('LoginRequired', 'login_required')
Пример #3
0
# -*- coding: utf-8 -*-

from py3oauth2.errors import (
    make_error,
    AccessDenied,
    ErrorException,
    InvalidRequest,
    InvalidScope,
    ServerError,
    UnauthorizedClient,
    UnsupportedGrantType,
    UnsupportedResponseType,
)

__all__ = [
    'AccessDenied', 'ErrorException', 'InvalidRequest', 'InvalidScope',
    'InvalidScope', 'ServerError', 'UnauthorizedClient',
    'UnsupportedGrantType', 'UnsupportedResponseType', 'InteractionRequired',
    'LoginRequired'
]

InteractionRequired = make_error('InteractionRequired', 'interaction_required')
LoginRequired = make_error('LoginRequired', 'login_required')