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

Class TokenClientAuthHandler

python/pyarrow/tests/test_flight.py:600–615  ·  view source on GitHub ↗

An example implementation of authentication via handshake.

Source from the content-addressed store, hash-verified

598
599
600class TokenClientAuthHandler(ClientAuthHandler):
601 """An example implementation of authentication via handshake."""
602
603 def __init__(self, username, password):
604 super().__init__()
605 self.username = username
606 self.password = password
607 self.token = b''
608
609 def authenticate(self, outgoing, incoming):
610 outgoing.write(self.username)
611 outgoing.write(self.password)
612 self.token = incoming.read()
613
614 def get_token(self):
615 return self.token
616
617
618class 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