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

Function test_token_auth

python/pyarrow/tests/test_flight.py:1605–1612  ·  view source on GitHub ↗

Test an auth mechanism that uses a handshake.

()

Source from the content-addressed store, hash-verified

1603
1604
1605def test_token_auth():
1606 """Test an auth mechanism that uses a handshake."""
1607 with EchoStreamFlightServer(auth_handler=token_auth_handler) as server, \
1608 FlightClient(('localhost', server.port)) as client:
1609 action = flight.Action("who-am-i", b"")
1610 client.authenticate(TokenClientAuthHandler('test', 'p4ssw0rd'))
1611 identity = next(client.do_action(action))
1612 assert identity.body.to_pybytes() == b'test'
1613
1614
1615def 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