A Flight server that tests with basic token authentication.
| 715 | |
| 716 | |
| 717 | class HeaderAuthFlightServer(FlightServerBase): |
| 718 | """A Flight server that tests with basic token authentication. """ |
| 719 | |
| 720 | def do_action(self, context, action): |
| 721 | middleware = context.get_middleware("auth") |
| 722 | if middleware: |
| 723 | auth_header = case_insensitive_header_lookup( |
| 724 | middleware.sending_headers(), 'Authorization') |
| 725 | values = auth_header.split(' ') |
| 726 | return [values[1].encode("utf-8")] |
| 727 | raise flight.FlightUnauthenticatedError( |
| 728 | 'No token auth middleware found.') |
| 729 | |
| 730 | |
| 731 | class ArbitraryHeadersServerMiddlewareFactory(ServerMiddlewareFactory): |
no outgoing calls