def test_authenticator_with_empty_config(self):
     testbot = Bot(Brain(BrainConfiguration()), BotConfiguration())
     service = Authenticator(BrainSecurityConfiguration("authentication"))
     self.assertIsNotNone(service)
     self.assertIsNotNone(service.configuration)
     self.assertIsNone(service.get_default_denied_srai())
     self.assertFalse(service.authenticate(testbot, "console"))
示例#2
0
    def test_authenticator_with_empty_config(self):
        client_context = ClientContext(TestClient(), "console")
        client_context.bot = Bot(BotConfiguration())
        client_context.bot.configuration.conversations._max_histories = 3
        client_context.brain = client_context.bot.brain

        service = Authenticator(BrainSecurityConfiguration("authentication"))
        self.assertIsNotNone(service)
        self.assertIsNotNone(service.configuration)
        self.assertIsNone(service.get_default_denied_srai())
        self.assertFalse(service.authenticate(client_context))
示例#3
0
 def __init__(self, configuration: BrainSecurityConfiguration):
     Authenticator.__init__(self, configuration)
     self.authorised = ["console"]
 def __init__(self, configuration: BrainSecurityConfiguration):
     Authenticator.__init__(self, configuration)
示例#5
0
 def __init__(self, configuration: BrainSecurityConfiguration):
     Authenticator.__init__(self, configuration)
示例#6
0
 def __init__(self, configuration: BrainSecurityConfiguration):
     Authenticator.__init__(self, configuration)
     self.authorised = [
         "console"
     ]