# Path: isserviceup/helpers/exceptions.py
# class ApiException(Exception):
#     def __init__(self, message, status_code=400, **kwargs):
#         super(ApiException, self).__init__()
#         self.message = message
#         self.status_code = status_code
#         self.extra = kwargs
# 
# Path: isserviceup/storage/sessions.py
# SESSION_TTL = 60*60*24*30
# def get(sid):
# def create(data):
# def destroy(sid):
# 
# Path: isserviceup/storage/users.py
# def get_user(user_id):
#     return User.objects.with_id(user_id)


from flask import request
from six import wraps
from isserviceup.helpers.exceptions import ApiException
from isserviceup.storage import sessions
from isserviceup.storage.users import get_user



def authenticated(blocking=True):

    def decorator(f):
        @wraps(f)
        def wrapper(*args, **kwargs):
            user = None

# Path: isserviceup/helpers/exceptions.py
# class ApiException(Exception):
#     def __init__(self, message, status_code=400, **kwargs):
#         super(ApiException, self).__init__()
#         self.message = message
#         self.status_code = status_code
#         self.extra = kwargs
# 
# Path: isserviceup/storage/sessions.py
# SESSION_TTL = 60*60*24*30
# def get(sid):
# def create(data):
# def destroy(sid):
# 
# Path: isserviceup/storage/users.py
# def get_user(user_id):
#     return User.objects.with_id(user_id)


# Path: isserviceup/helpers/decorators.py
from flask import request
from six import wraps
from isserviceup.helpers.exceptions import ApiException
from isserviceup.storage import sessions
from isserviceup.storage.users import get_user




def authenticated(blocking=True):

    def decorator(f):
        @wraps(f)
        def wrapper(*args, **kwargs):
            user = None

            auth = request.headers.get('Authorization')