Add scope ordinality and translations. Process oauth tokens and limit scopes accordingly.

This commit is contained in:
jakedt 2014-03-12 16:31:37 -04:00
parent 25ceb90fc6
commit e74eb3ee87
8 changed files with 137 additions and 31 deletions

View file

@ -20,7 +20,7 @@ from auth import scopes
logger = logging.getLogger(__name__)
api_bp = Blueprint('api', __name__)
api = Api(api_bp)
api.decorators = [crossdomain(origin='*')]
api.decorators = [crossdomain(origin='*', headers=['Authorization'])]
def resource(*urls, **kwargs):
@ -97,7 +97,12 @@ def parse_repository_name(func):
return wrapper
class RepositoryParamResource(Resource):
class ApiResource(Resource):
def options(self):
return None, 200
class RepositoryParamResource(ApiResource):
method_decorators = [parse_repository_name]