Add support for multiple scope parameters on V2 auth requests
Fixes https://jira.coreos.com/browse/QUAY-892
This commit is contained in:
parent
86aa93aab5
commit
a59c951aa3
5 changed files with 164 additions and 119 deletions
|
@ -5,7 +5,7 @@ from flask_principal import Identity, Principal
|
|||
from mock import Mock
|
||||
|
||||
from auth import permissions
|
||||
from endpoints.v2.v2auth import get_tuf_root
|
||||
from endpoints.v2.v2auth import _get_tuf_root
|
||||
from test import testconfig
|
||||
from util.security.registry_jwt import QUAY_TUF_ROOT, SIGNER_TUF_ROOT, DISABLED_TUF_ROOT
|
||||
|
||||
|
@ -52,7 +52,7 @@ def test_get_tuf_root(identity, expected):
|
|||
app, principal = app_with_principal()
|
||||
with app.test_request_context('/'):
|
||||
principal.set_identity(identity)
|
||||
actual = get_tuf_root(Mock(), "namespace", "repo")
|
||||
actual = _get_tuf_root(Mock(), "namespace", "repo")
|
||||
assert actual == expected, "should be %s, but was %s" % (expected, actual)
|
||||
|
||||
|
||||
|
@ -64,5 +64,5 @@ def test_trust_disabled(trust_enabled,tuf_root):
|
|||
app, principal = app_with_principal()
|
||||
with app.test_request_context('/'):
|
||||
principal.set_identity(read_identity("namespace", "repo"))
|
||||
actual = get_tuf_root(Mock(trust_enabled=trust_enabled), "namespace", "repo")
|
||||
actual = _get_tuf_root(Mock(trust_enabled=trust_enabled), "namespace", "repo")
|
||||
assert actual == tuf_root, "should be %s, but was %s" % (tuf_root, actual)
|
||||
|
|
Reference in a new issue