Ejemplo n.º 1
0
    def testACLValidation(self):
        api_auth_manager.APIAuthorization(
            router="DummyAuthManagerTestApiRouter",
            users=["u1", "u2"],
            groups=["g1", "g2"])

        api_auth_manager.APIAuthorization(
            router="DummyAuthManagerTestApiRouter")
Ejemplo n.º 2
0
 def GenerateSample(self, number=0):
     return api_auth_manager.APIAuthorization(
         router="DummyAuthManagerTestApiRouter", users=["user%s" % number])
Ejemplo n.º 3
0
 def testACLValidationBadGroups(self):
     with self.assertRaises(api_auth_manager.InvalidAPIAuthorization):
         api_auth_manager.APIAuthorization(
             router="DummyAuthManagerTestApiHandler",
             users=["u1"],
             groups="g1")
Ejemplo n.º 4
0
 def testACLValidationBadGroups(self):
     with self.assertRaises(api_auth_manager.InvalidAPIAuthorization):
         api_auth_manager.APIAuthorization(handler="ApiCallHandler",
                                           users=["u1"],
                                           groups="g1")
Ejemplo n.º 5
0
    def testACLValidation(self):
        api_auth_manager.APIAuthorization(handler="ApiCallHandler",
                                          users=["u1", "u2"],
                                          groups=["g1", "g2"])

        api_auth_manager.APIAuthorization(handler="ApiCallHandler")
Ejemplo n.º 6
0
 def GenerateSample(self, number=0):
     return api_auth_manager.APIAuthorization(handler="ApiCallHandler",
                                              users=["user%s" % number])
Ejemplo n.º 7
0
 def testACLValidationBadUsers(self):
     with self.assertRaises(api_auth_manager.InvalidAPIAuthorization):
         api_auth_manager.APIAuthorization(renderer="ApiCallRenderer",
                                           users="u1",
                                           groups=["g1"])