Use constants for TUF roots
This commit is contained in:
parent
6ad107709c
commit
abd78bce56
3 changed files with 14 additions and 11 deletions
|
@ -15,7 +15,7 @@ from endpoints.v2.errors import InvalidLogin
|
|||
from data.interfaces.v2 import pre_oci_model as model
|
||||
from util.cache import no_cache
|
||||
from util.names import parse_namespace_repository, REPOSITORY_NAME_REGEX
|
||||
from util.security.registry_jwt import generate_bearer_token, build_context_and_subject
|
||||
from util.security.registry_jwt import generate_bearer_token, build_context_and_subject, QUAY_TUF_ROOT, SIGNER_TUF_ROOT
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -184,5 +184,5 @@ def generate_registry_jwt(auth_result):
|
|||
def get_tuf_root(namespace, reponame):
|
||||
# Users with write access to a repo will see signer-rooted TUF metadata
|
||||
if ModifyRepositoryPermission(namespace, reponame).can():
|
||||
return 'signer'
|
||||
return 'quay'
|
||||
return SIGNER_TUF_ROOT
|
||||
return QUAY_TUF_ROOT
|
||||
|
|
Reference in a new issue