Esempio n. 1
0
from pulsar.utils.structures import inverse_mapping

ASYNC_IO = 1  # run in the worker event loop
THREAD_IO = 3  # run in the event loop executor
CPUBOUND = 4  # run in a subprocess

concurrency = {'asyncio': ASYNC_IO, 'thread': THREAD_IO, 'process': CPUBOUND}

concurrency_name = dict(inverse_mapping(concurrency))
Esempio n. 2
0
from pulsar.utils.pep import to_bytes

from lux.utils.data import as_tuple

from .extension import Parameter
from .user import Anonymous


ACTIONS = {'read': 1,
           'create': 2,
           'update': 3,
           'delete': 4}

EMPTY_DICT = {}

ACTION_IDS = dict(inverse_mapping(ACTIONS))

UNUSABLE_PASSWORD = '******'

auth_backend_actions = set()


def backend_action(fun):
    name = fun.__name__
    auth_backend_actions.add(name)
    return fun


class AuthenticationError(ValueError):
    pass
Esempio n. 3
0
from pulsar import PermissionDenied, Http401
from pulsar.utils.structures import inverse_mapping
from pulsar.utils.importer import module_attribute
from pulsar.apps.wsgi import wsgi_request
from pulsar.utils.pep import to_bytes

from lux.utils.data import as_tuple

from .extension import Parameter
from .user import Anonymous

ACTIONS = {'read': 1, 'create': 2, 'update': 3, 'delete': 4}

EMPTY_DICT = {}

ACTION_IDS = dict(inverse_mapping(ACTIONS))

UNUSABLE_PASSWORD = '******'

auth_backend_actions = set()


def backend_action(fun):
    name = fun.__name__
    auth_backend_actions.add(name)
    return fun


class AuthenticationError(ValueError):
    pass