Instead of sending DB IDs, send "internal IDs" which are DB IDs hashed. This way, we can still calculate the ancestors without hitting the DB further, but without leaking the size of the images table
This commit is contained in:
parent
dd4037e324
commit
63628678b8
7 changed files with 59 additions and 36 deletions
|
@ -7,7 +7,8 @@ from data import model
|
|||
from endpoints.api import (truthy_bool, format_date, nickname, log_action, validate_json_request,
|
||||
require_repo_read, require_repo_write, require_repo_admin,
|
||||
RepositoryParamResource, resource, query_param, parse_args, ApiResource,
|
||||
request_error, require_scope, Unauthorized, NotFound, InvalidRequest)
|
||||
request_error, require_scope, Unauthorized, NotFound, InvalidRequest,
|
||||
calculate_internal_id)
|
||||
from auth.permissions import (ModifyRepositoryPermission, AdministerRepositoryPermission,
|
||||
CreateRepositoryPermission, ReadRepositoryPermission)
|
||||
from auth.auth_context import get_authenticated_user
|
||||
|
@ -169,7 +170,7 @@ class Repository(RepositoryParamResource):
|
|||
return {
|
||||
'name': tag.name,
|
||||
'image_id': tag.image.docker_image_id,
|
||||
'dbid': tag.image.id
|
||||
'internal_id': calculate_internal_id(tag.image.id)
|
||||
}
|
||||
|
||||
organization = None
|
||||
|
|
Reference in a new issue