MCPcopy Index your code
hub / github.com/bugy/script-server / MockAuthenticator

Class MockAuthenticator

src/tests/test_utils.py:638–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

636
637
638class MockAuthenticator(Authenticator):
639
640 def __init__(self) -> None:
641 super().__init__()
642 self._users = {}
643
644 def authenticate(self, request_handler):
645 raise AuthRejectedError('Not implemented')
646
647 def perform_basic_auth(self, user, password):
648 if user not in self._users:
649 raise AuthRejectedError('Invalid user ' + user)
650
651 if self._users[user] != password:
652 raise AuthRejectedError('Invalid password for user ' + user)
653
654 return True
655
656 def add_user(self, username, password):
657 self._users[username] = password

Callers 1

start_serverMethod · 0.90

Calls

no outgoing calls

Tested by 1

start_serverMethod · 0.72