Add JWT Bearer authentication to Arrow Flight - #665
Draft
jakeichikawasalesforce wants to merge 3 commits into
Draft
Add JWT Bearer authentication to Arrow Flight#665jakeichikawasalesforce wants to merge 3 commits into
jakeichikawasalesforce wants to merge 3 commits into
Conversation
Without it Tornado treats the 2MB body as form-urlencoded and newer Python parse_qsl rejects it with 400 before TabPy's 413 check runs.
Keep util.py unchanged so the pre-existing PBKDF2 hash stays out of this diff. Flight header parsing now lives in flight_headers.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds JWT Bearer authentication to TabPy's Arrow Flight (gRPC) path so
OAuth-configured clients can use Flight. Companion to #664, which covered
the HTTP path; Flight has its own middleware and without this change a
valid JWT is silently rejected on gRPC.
JwtAuthServerMiddlewareFactoryreusesjwt_auth.validate_jwt(no duplicate validation). Failed Flight auth is
UNAUTHENTICATED,not HTTP 401.
middleware and delegates Basic if a password file is present. pyarrow
runs every registered factory per call, so installing Basic as a
sibling key would reject valid Bearer tokens.
because Flight only had Basic middleware).
sending_headers)can be replayed as Bearer credentials. They expire after one hour and
the store is capped at 1024 entries.
that cannot take the lock within one second fails closed instead of
stalling the HTTP IO loop behind a Flight-triggered fetch.
Authorizationvalues are rejected; repeating the samevalue is accepted.
docs/server-config.md.Testing
test_jwt_server_middleware_factory.py):valid token, expired, wrong issuer, wrong audience, missing token,
Basic delegation, opaque-token replay, malformed Basic credentials,
and conflicting vs repeated Authorization headers.
test_basic_auth_server_middleware_factory.py):JWT-shaped Bearer rejected when OAuth is off, token expiry, bounded
store, opaque replay without minting a second token.
asserts middleware wiring (issuer, JWKS URI, audience, scopes, Basic
factory).
fails fast instead of waiting out the fetch timeout.