예제 #1
0
 def test_global_valid(self):
     """Testing WebAPIToken.validate_policy with valid '*' section"""
     WebAPIToken.validate_policy({
         'resources': {
             '*': {
                 'allow': ['*'],
                 'block': ['POST'],
             }
         }
     })
예제 #2
0
 def test_resource_id_valid(self):
     """Testing WebAPIToken.validate_policy with <resource>.<id> valid"""
     WebAPIToken.validate_policy({
         'resources': {
             'repository': {
                 '42': {
                     'allow': ['*'],
                     'block': ['POST'],
                 },
             }
         }
     })
예제 #3
0
 def test_empty(self):
     """Testing WebAPIToken.validate_policy with empty policy"""
     WebAPIToken.validate_policy({})