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

Function test_token_auth

python/pyarrow/tests/test_flight.py:1643–1650  ·  view source on GitHub ↗

Test an auth mechanism that uses a handshake.

()

Source from the content-addressed store, hash-verified

1641
1642
1643def test_token_auth():
1644 """Test an auth mechanism that uses a handshake."""
1645 with EchoStreamFlightServer(auth_handler=token_auth_handler) as server, \
1646 FlightClient(('localhost', server.port)) as client:
1647 action = flight.Action("who-am-i", b"")
1648 client.authenticate(TokenClientAuthHandler('test', 'p4ssw0rd'))
1649 identity = next(client.do_action(action))
1650 assert identity.body.to_pybytes() == b'test'
1651
1652
1653def test_token_auth_invalid():

Callers

nothing calls this directly

Calls 5

FlightClientClass · 0.90
authenticateMethod · 0.45
do_actionMethod · 0.45

Tested by

no test coverage detected