Add tests for edge3 worker API app and JWT auth - #72482
Merged
Merged
Conversation
The FastAPI app factory and the JWT authorization layer for the Edge Worker API had no dedicated unit tests, leaving the route/mount wiring (v1 API prefix, UI prefix, static/res mounts, .cjs mimetype) and the authorization flow (method-claim checks, per-exception anonymized 403 responses, validator caching semantics) unverified against regressions. Closes: apache#72266
dheerenmohta
requested review from
dheerajturaga,
jscheffl and
shubhamraj-git
as code owners
September 3, 2026 13:42
dheerajturaga
approved these changes
Sep 6, 2026
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.
Adds test coverage for the edge3 provider's worker API app factory and JWT authorization, which previously had none.
providers/edge3/tests/unit/edge3/worker_api/test_auth.py— method-claim matching/mismatch/missing JWT authorization, all 7 handled exception types collapsing into an anonymized 403 via_forbidden_response,jwt_validator()@cachesemantics,jwt_leewayconfig plumbing, and the/edge_worker/v1/prefix-stripping injwt_token_authorization_rest.providers/edge3/tests/unit/edge3/worker_api/test_app.py—create_edge_worker_api_app(): v1-prefixed routers, ui-prefixed router,/staticand/resStaticFilesmounts, and.cjsmimetype registration.OVERLOOKED_TESTSallowlist inairflow-core/tests/unit/always/test_project_structure.py.closes: #72266
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Sonnet 5) following the guidelines