-
Notifications
You must be signed in to change notification settings - Fork 193
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
feat(sozo-walnut): remove sensitive data from dojo configuration file #2978
feat(sozo-walnut): remove sensitive data from dojo configuration file #2978
Conversation
Ohayo, sensei! Let me break down these changes for you with precision and clarity. WalkthroughThe changes introduce modifications to the TOML file handling in the Changes
Sequence DiagramsequenceDiagram
participant User
participant Verification
Verification->>User: Display warning message
Verification->>User: Prompt for confirmation
alt User confirms (Enter)
Verification->>Verification: Continue verification process
else User aborts (Any input)
Verification->>User: Print abortion message
Verification-->>User: Terminate verification
end
The sequence diagram illustrates the new control flow with the user interaction step, showing how the verification process can be conditionally executed based on user input. Tip 🌐 Web search-backed reviews and chat
📜 Recent review detailsConfiguration used: .coderabbit.yaml ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
🔇 Additional comments (4)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
crates/sozo/walnut/src/verification.rs (1)
32-47
: Ohayo sensei! Great addition of the security prompt! 🎯The implementation effectively prevents accidental exposure of sensitive data. The warning message and user interaction flow are well-implemented.
Consider enhancing the warning message with specific examples.
The warning could be more specific about common sensitive files. Here's a suggested enhancement:
- "⚠️ Warning: You are about to submit all workspace files to walnut. - Ensure your project does not contain private keys. Config files like dojo_*.toml will be \ - uploaded.\n + "⚠️ Warning: You are about to submit all workspace files to walnut. + Ensure your project does not contain sensitive data such as: + - Private keys or wallet seeds + - API keys or tokens + - Environment files (.env) + Config files like dojo_*.toml will be uploaded.\n
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.
That's a good addition, thank you for taking care of this.
Since the build doesn't require any sensitive information, wondering if we shouldn't back the user by updating the content of the file before upload.
[env]
section is the only one with sensitive info (or maybe IPFS one too, but less important for now). Examining the file before could be a good thing to add, wdyt?
Hi Glihm, thanks for your comment! I like the idea of checking the file content, specifically the [env] section, but only to see if it contains the private_key field. (From my understanding, this is the only field that exposes a private key.) Then, we can notify the user with a message that potentially includes a list of all dojo_*.toml files containing the private_key field. However, I am of the opinion that we should not modify the dojo_*.toml file or the private_key field without the user's knowledge. |
I agree on the fact that modifying a file without user consent is not good, definitely. Doing so, you don't modify locally the files, and you ensure user's privacy by not uploading something that could be critical for the user. |
To clarify, before we upload, we can remove the whole [env] section from the dojo_*.toml files, and proceed with the upload and build process without that section. This way, we avoid uploading anything potentially sensitive, and we can remove this new warning prompt message to the user? I just wanted to make sure we're aligned on this approach before moving forward with these changes. |
Yes exactly @marijamijailovic, thank you for confirming, you can go ahead with those changes. The dojo/crates/dojo/world/src/config/environment.rs Lines 6 to 12 in bf0c5ee
|
Hi @glihm, I have implemented those changes. |
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.
Thank you @marijamijailovic for your iteration on that. 👍
Small duplication of the file_data.insert
which could have taken the file_content
based on your two cases (dojo config file or not) and then used only once.
Let's move forward with that. :) Thank you very much!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2978 +/- ##
==========================================
- Coverage 57.04% 57.03% -0.02%
==========================================
Files 427 427
Lines 56536 56556 +20
==========================================
+ Hits 32251 32256 +5
- Misses 24285 24300 +15 ☔ View full report in Codecov by Sentry. |
Description
This PR add prompt message to prevent user from exspose their private key during verification process
Related issue
Tests
Added to documentation?
Checklist
scripts/prettier.sh
,scripts/rust_fmt.sh
,scripts/cairo_fmt.sh
)scripts/clippy.sh
,scripts/docs.sh
)Summary by CodeRabbit
New Features
Chores