Merge branch 'master' of ssh://bitbucket.org/yackob03/quay

Conflicts:
	endpoints/api.py
This commit is contained in:
yackob03 2013-09-30 17:54:06 -04:00
commit 6148a59b38

View file

@ -36,8 +36,10 @@ def welcome():
@app.route('/api/user/')
@api_login_required
def get_logged_in_user():
if current_user.is_anonymous():
return jsonify({'anonymous': True})
user = current_user.db_user
return jsonify({
'verified': user.verified,
@ -49,6 +51,7 @@ def get_logged_in_user():
@app.route('/api/users/<prefix>', methods=['GET'])
@api_login_required
def get_matching_users(prefix):
users = model.get_matching_users(prefix)
@ -64,7 +67,6 @@ def create_repo_api():
@app.route('/api/repository/find/<prefix>', methods=['GET'])
@api_login_required
def match_repos_api(prefix):
def repo_view(repo):
return {
@ -73,7 +75,7 @@ def match_repos_api(prefix):
'description': repo.description
}
username = current_user.db_user.username
username = current_user.db_user.username if current_user.is_authenticated() else None
matching = model.get_matching_repositories(prefix, username)
response = {
'repositories': [repo_view(repo) for repo in matching]
@ -83,7 +85,6 @@ def match_repos_api(prefix):
@app.route('/api/repository/', methods=['GET'])
@api_login_required
def list_repos_api():
def repo_view(repo_obj):
return {
@ -92,7 +93,7 @@ def list_repos_api():
'description': repo_obj.description,
}
username = current_user.db_user.username
username = current_user.db_user.username if current_user.is_authenticated() else None
repos = [repo_view(repo)
for repo in model.get_visible_repositories(username)]
response = {
@ -146,7 +147,6 @@ def image_view(image):
@app.route('/api/repository/<path:repository>', methods=['GET'])
@api_login_required
@parse_repository_name
def get_repo_api(namespace, repository):
logger.debug('Get repo: %s/%s' % (namespace, repository))
@ -192,7 +192,6 @@ def role_view(repo_perm_obj):
@app.route('/api/repository/<path:repository>/tag/<tag>/images',
methods=['GET'])
@api_login_required
@parse_repository_name
def list_tag_images(namespace, repository, tag):
permission = ReadRepositoryPermission(namespace, repository)