Repository navigation
fix: drop hardcoded dashboard password and secret key defaults - #16
Open
Dextheking1 wants to merge 3 commits into
Open
Dextheking1 wants to merge 3 commits into
Dextheking1 wants to merge 3 commits into
Conversation
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.
app.py fell back to a hardcoded dashboard password (admin / polymarket2024) and a fixed Flask secret key when the env vars were unset. Both values are in this public repo, so any deployment that forgets to set them is open to anyone. The control endpoints behind that login can start and stop the agent and turn auto-trading on.
Fix:
Test: tests/test_no_default_credentials.py imports the app with both env vars unset and checks the old password is rejected and the two endpoints answer 401. Fails on the old code, passes here.
Note: the read endpoints (/api/positions, /api/agent/status, /api/logs and a few more) are still unauthenticated. Left them alone in this PR since the home page is marked public for demo, but they do expose live orders, positions and logs of a funded wallet. Worth a look.