-
Notifications
You must be signed in to change notification settings - Fork 809
Mask the secret key for restrict option in the process watcher when restoring plain SQL file. #9518 #9519
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
Conversation
WalkthroughAdds a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code graph analysis (1)web/pgadmin/tools/restore/__init__.py (2)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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: 1
🤖 Fix all issues with AI agents
In @web/pgadmin/tools/restore/__init__.py:
- Around line 77-82: The masking logic for RESTRICT_COMMAND is off-by-one: when
building masked_arg in the restore code (variables arg, idx, masked_arg,
cmd_arg, self.cmd), remove the extra +1 on the slice; compute idx as currently
done (arg.find(RESTRICT_COMMAND) + len(RESTRICT_COMMAND)) and set masked_arg =
arg[:idx] + "x" * (len(arg) - idx) so the resulting length equals len(arg).
Update the masked_arg assignment accordingly where RESTRICT_COMMAND is detected.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
web/pgadmin/tools/restore/__init__.pyweb/pgadmin/utils/constants.py
🧰 Additional context used
🧬 Code graph analysis (1)
web/pgadmin/tools/restore/__init__.py (2)
web/pgadmin/tools/import_export/__init__.py (1)
cmd_arg(75-82)web/pgadmin/tools/backup/__init__.py (1)
cmd_arg(98-104)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: run-feature-tests-pg (14)
- GitHub Check: run-feature-tests-pg (17)
- GitHub Check: run-feature-tests-pg (15)
- GitHub Check: run-feature-tests-pg (16)
- GitHub Check: run-feature-tests-pg (13)
- GitHub Check: run-feature-tests-pg (18)
🔇 Additional comments (3)
web/pgadmin/utils/constants.py (1)
180-180: LGTM! Constant definition is correct.The
RESTRICT_COMMANDconstant is properly defined for masking sensitive arguments in the restore process.web/pgadmin/tools/restore/__init__.py (2)
28-28: LGTM! Import is correctly added.The import of
RESTRICT_COMMANDis properly placed and used in the masking logic below.
83-86: LGTM! Correct control flow withelif.The change from
iftoelifis appropriate because arguments containingRESTRICT_COMMANDshould be masked and not processed by subsequent conditions. This ensures mutually exclusive handling of different argument types.
…estoring plain SQL file. pgadmin-org#9518 Fixed coderabbit review comment.
Summary by CodeRabbit
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.