Add support for * (admin) permission to registry auth v2 endpoint
This commit is contained in:
parent
c4fbc8e2e4
commit
9e96e6870f
2 changed files with 22 additions and 2 deletions
|
@ -82,7 +82,20 @@ class TestRegistryV2Auth(unittest.TestCase):
|
|||
identity = self._parse_token(token)
|
||||
self.assertEqual(identity.id, TEST_USER.username)
|
||||
self.assertEqual(1, len(identity.provides))
|
||||
|
||||
|
||||
def test_token_with_admin_access(self):
|
||||
access = [
|
||||
{
|
||||
'type': 'repository',
|
||||
'name': 'somens/somerepo',
|
||||
'actions': ['*'],
|
||||
}
|
||||
]
|
||||
token = self._generate_token(self._generate_token_data(access=access))
|
||||
identity = self._parse_token(token)
|
||||
self.assertEqual(identity.id, TEST_USER.username)
|
||||
self.assertEqual(1, len(identity.provides))
|
||||
|
||||
def test_malformed_access(self):
|
||||
access = [
|
||||
{
|
||||
|
|
Reference in a new issue