Move the auth context methods into their own file so that we don't have auth trying to import itself

This commit is contained in:
Joseph Schorr 2014-02-25 15:07:24 -05:00
parent a120f6c64a
commit 61ca29de04
5 changed files with 12 additions and 14 deletions

View file

@ -1,7 +1,7 @@
import logging
from functools import wraps
from flask import request, _request_ctx_stack, abort as flask_abort, session
from flask import request, _request_ctx_stack, session
from flask.ext.principal import identity_changed, Identity
from base64 import b64decode
@ -15,15 +15,6 @@ from util.http import abort
logger = logging.getLogger(__name__)
def get_authenticated_user():
return getattr(_request_ctx_stack.top, 'authenticated_user', None)
def get_validated_token():
return getattr(_request_ctx_stack.top, 'validated_token', None)
def process_basic_auth(auth):
normalized = [part.strip() for part in auth.split(' ') if part]
if normalized[0].lower() != 'basic' or len(normalized) != 2: