Add scope ordinality and translations. Process oauth tokens and limit scopes accordingly.
This commit is contained in:
parent
25ceb90fc6
commit
e74eb3ee87
8 changed files with 137 additions and 31 deletions
|
@ -1,22 +1,24 @@
|
|||
import logging
|
||||
import json
|
||||
|
||||
from flask.ext.restful import Resource, reqparse, abort
|
||||
from flask import current_app
|
||||
from flask.ext.restful import reqparse, abort
|
||||
from flask.ext.login import current_user
|
||||
|
||||
from data import model
|
||||
from endpoints.api import (truthy_bool, format_date, nickname, log_action, validate_json_request,
|
||||
require_repo_read, RepositoryParamResource, resource, query_param,
|
||||
parse_args)
|
||||
parse_args, ApiResource)
|
||||
from auth.permissions import (ReadRepositoryPermission, ModifyRepositoryPermission,
|
||||
AdministerRepositoryPermission)
|
||||
from auth.auth import process_auth
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@resource('/v1/repository')
|
||||
class RepositoryList(Resource):
|
||||
class RepositoryList(ApiResource):
|
||||
"""Operations for creating and listing repositories."""
|
||||
schemas = {
|
||||
'NewRepo': {
|
||||
|
@ -146,6 +148,7 @@ def image_view(image):
|
|||
@resource('/v1/repository/<path:repository>')
|
||||
class Repository(RepositoryParamResource):
|
||||
"""Operations for managing a specific repository."""
|
||||
@process_auth
|
||||
@require_repo_read
|
||||
@nickname('getRepo')
|
||||
def get(self, namespace, repository):
|
||||
|
|
Reference in a new issue