MCPcopy Create free account
hub / github.com/apache/arrow / TokenClientAuthHandler

Class TokenClientAuthHandler

python/pyarrow/tests/test_flight.py:598–613  ·  view source on GitHub ↗

An example implementation of authentication via handshake.

Source from the content-addressed store, hash-verified

596
597
598class TokenClientAuthHandler(ClientAuthHandler):
599 """An example implementation of authentication via handshake."""
600
601 def __init__(self, username, password):
602 super().__init__()
603 self.username = username
604 self.password = password
605 self.token = b''
606
607 def authenticate(self, outgoing, incoming):
608 outgoing.write(self.username)
609 outgoing.write(self.password)
610 self.token = incoming.read()
611
612 def get_token(self):
613 return self.token
614
615
616class NoopAuthHandler(ServerAuthHandler):

Callers 2

test_token_authFunction · 0.85
test_token_auth_invalidFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_token_authFunction · 0.68
test_token_auth_invalidFunction · 0.68