Document OpenAPI auth requirements#792
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughPR adds OpenAPI authentication documentation to protected API endpoints. Defines security scheme objects for admin token and GitHub session auth, installs them into the FastAPI schema, applies auth metadata to routes via a helper function, and validates the security model in a new test. ChangesOpenAPI Authentication
Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 83948891-3f1b-4972-a3a3-37b5fdcc1734
📒 Files selected for processing (7)
app/bounty_api.pyapp/bounty_attempts.pyapp/main.pyapp/openapi_request_bodies.pyapp/treasury_routes.pyapp/wallet_api.pytests/test_openapi_request_bodies.py
jakerated-r
left a comment
There was a problem hiding this comment.
Reviewed current head d79b616 as a non-author for bounty #654.\n\nEvidence checked:\n- Confirmed the PR keeps runtime authorization behavior unchanged while documenting protected OpenAPI operations with explicit security metadata and 401 responses.\n- Inspected app/openapi_request_bodies.py, app/main.py, app/bounty_api.py, app/bounty_attempts.py, app/treasury_routes.py, app/wallet_api.py, and tests/test_openapi_request_bodies.py.\n- Verified admin-token protected operations document MergeWorkAdminToken: /api/v1/admin/webhook-events, bounty create/pay/close, payout reconciliation, and treasury proposal create/execute.\n- Verified GitHub-session protected operations document MergeWorkGitHubSession: attempt create/release, wallet link, GitHub claim, and treasury challenge.\n- Verified public operations remain unauthenticated in the OpenAPI schema where expected, including GET /api/v1/bounties, wallet registration, and wallet transfers.\n- Checked CodeRabbit's test-hardening note; I agree stronger exact-response assertions would be harmless, but I did not find a functional blocker because the implementation and a direct OpenAPI probe both validate the documented auth contract.\n\nValidation run locally on this exact head:\n- Focused API/auth suite: 222 passed, 1 warning.\n- Full pytest: 675 passed, 1 warning.\n- Direct OpenAPI probe: /openapi.json returned 200; protected routes had expected security schemes plus 401 responses; selected public routes had no security entry.\n- Ruff check: passed.\n- Ruff format check: 39 files already formatted.\n- Mypy app: success, no issues in 38 source files.\n- Docs smoke: ok.\n- AGENTS check: ok.\n- git diff --check: passed.\n- Merge-tree against origin/main: clean tree 2262636ef4cd5651d994e07f2d00878ad682c9a5.\n\nNo blocking concerns from this review.
|
Thanks for the review. I pushed Validation:
|
|
Maintainer queue hold: #656 currently has 0 effective awards remaining because the final slot is covered by pending proposal #118. This PR is not accepted or payable under #656 in this state. The successor issues #798/#799 are still pending |
Summary
Bounty #656
Refs #656
Fixes the OpenAPI contract mismatch reported in #656 (comment).
Protected routes already reject anonymous requests at runtime, but the public OpenAPI document currently publishes those routes without auth/security metadata or documented
401responses. This adds explicit OpenAPI auth metadata without changing runtime authorization behavior.Implementation
MergeWorkAdminTokenandMergeWorkGitHubSessionOpenAPI security schemes.securityand401response metadata for admin-token routes:/api/v1/admin/webhook-events/api/v1/bountiescreation/api/v1/reconciliation/payoutssecurityand401response metadata for GitHub-session routes:Validation
Scope
No admin token handling, GitHub session handling, wallet signing, ledger mutation, proposal execution, payout execution, challenge submission, private data, bridge/exchange/cash-out behavior, or MRWK price behavior is changed.
Summary by CodeRabbit
Documentation
Tests