-
Notifications
You must be signed in to change notification settings - Fork 0
Resolve wallet security review issues #3
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
Open
Sidzeppelin95
wants to merge
2
commits into
main
Choose a base branch
from
codex/resolve-code-review-issues-in-config.py-and-security-files
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,58 @@ | ||
|
|
||
| ""PiShield sandbox configuration. | ||
|
|
||
| Values default to the Pi Developer Portal sandbox settings and can be | ||
| overridden with environment variables for local/ngrok development. | ||
| "" | ||
|
|
||
| """PiShield sandbox configuration.""" | ||
| from __future__ import annotations | ||
|
|
||
| import os | ||
|
|
||
| from dotenv import load_dotenv | ||
|
|
||
| load_dotenv() | ||
|
|
||
|
|
||
| def _env_bool(name: str, default: bool) -> bool: | ||
| value = os.getenv(name) | ||
| if value is None: | ||
| return default | ||
| return value.strip().lower() in {"1", "true", "yes", "on"} | ||
|
|
||
|
|
||
|
|
||
| class PiOSConfig: | ||
| """Configuration values for Pi Browser and wallet-security workflows.""" | ||
|
|
||
| APP_NAME = os.getenv("PI_APP_NAME", "PiShield") | ||
| APP_VERSION = "1.0.0" | ||
| PIOS_COMPATIBLE = True | ||
|
|
||
| PROD_APP_URL = os.getenv("PI_PROD_APP_URL", "https://pishield.pinet.com") | ||
| DEV_APP_URL = os.getenv("PI_APP_URL", "http://localhost:31415") | ||
| API_URL = os.getenv("PI_API_URL", "https://api.minepi.com") | ||
| PRIVACY_POLICY_URL = os.getenv( | ||
| "PRIVACY_POLICY_URL", "https://pishield.pinet.com/privacy-policy" | ||
| ) | ||
| TERMS_OF_SERVICE_URL = os.getenv( | ||
| "TERMS_OF_SERVICE_URL", "https://pishield.pinet.com/terms" | ||
| ) | ||
| SANDBOX_URL = os.getenv("PI_SANDBOX_URL", "https://sandbox.minepi.com") | ||
|
|
||
| PI_BROWSER_REQUIRED = True | ||
| PI_SDK_ENABLED = True | ||
| PI_MAINNET_ENABLED = True | ||
|
|
||
| ROTATION_DELAY_HOURS = 48 | ||
| RECOVERY_LOCK_HOURS = 24 | ||
| THREAT_SCORE_THRESHOLD = 70 | ||
| HIGH_RISK_THRESHOLD = 90 | ||
| MAX_RECOVERY_ATTEMPTS = 3 | ||
|
|
||
|
|
||
| # Backwards-compatible aliases used by the existing Flask app/config imports. | ||
| # TODO: migrate callers to PiOSConfig and remove these aliases. | ||
| PI_SANDBOX = _env_bool("PI_SANDBOX", True) | ||
| PI_APP_NAME = os.getenv("PI_APP_NAME", "PiShield") | ||
| PI_APP_NAME = PiOSConfig.APP_NAME | ||
| PI_API_KEY = os.getenv("PI_API_KEY", "YOUR_PI_API_KEY") | ||
| PI_NETWORK = os.getenv("PI_NETWORK", "Pi Testnet") | ||
| PI_APP_URL = os.getenv("PI_APP_URL", "http://localhost:31415") | ||
| PI_API_URL = os.getenv("PI_API_URL", "https://api.minepi.com") | ||
| PI_SANDBOX_URL = os.getenv("PI_SANDBOX_URL", "https://sandbox.minepi.com") | ||
| PRIVACY_POLICY_URL = os.getenv( | ||
| "PRIVACY_POLICY_URL", | ||
| "https://pishield.pinet.com/privacy-policy", | ||
| ) | ||
| TERMS_OF_SERVICE_URL = os.getenv( | ||
| "TERMS_OF_SERVICE_URL", | ||
| "https://pishield.pinet.com/terms", | ||
| ) | ||
| # Legacy Flask uses the development URL for the app. | ||
| PI_APP_URL = PiOSConfig.DEV_APP_URL | ||
| PI_API_URL = PiOSConfig.API_URL | ||
| PI_SANDBOX_URL = PiOSConfig.SANDBOX_URL | ||
| PRIVACY_POLICY_URL = PiOSConfig.PRIVACY_POLICY_URL | ||
| TERMS_OF_SERVICE_URL = PiOSConfig.TERMS_OF_SERVICE_URL |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.