-
-
Notifications
You must be signed in to change notification settings - Fork 401
fix: require admin auth on withdrawal status GET endpoint #6323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
69a919a
bc9ff05
d19f7a0
db2cf6f
751f49c
e90a0f7
2d6f3ac
ee644b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -247,6 +247,13 @@ def get_agent_wallet(agent_id): | |
| """Get a beacon agent's Coinbase wallet info.""" | ||
| if request.method == "OPTIONS": | ||
| return _cors_json({"ok": True}) | ||
| # SECURITY: Require admin key — exposes coinbase_address for any beacon agent | ||
| admin_key = os.environ.get("RC_ADMIN_KEY", "") | ||
| if not admin_key: | ||
| return _cors_json({"error": "RC_ADMIN_KEY not configured"}), 503 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This branch now returns |
||
| provided = request.headers.get("X-Admin-Key", "") | ||
| if not hmac.compare_digest(provided, admin_key): | ||
| return _cors_json({"error": "Unauthorized — admin key required"}), 401 | ||
|
|
||
| db = get_db_func() | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This GET route is part of the existing signed Beacon contract workflow: after
POST /api/contractscreates an offer,GET /api/contractsis used to verify/list it. The new unconditional admin gate makes that workflow return 401 and breakstests/test_beacon_atlas_behavior.py::TestBeaconAtlasAPIBehavior::test_create_contract_workflow. If the API policy is changing, the PR needs to update the workflow/tests and likely client callers; otherwise this route should stay public or use the existing Beacon agent auth model instead of admin-only access.