Conversation
…BSUB_API_BASE - Move PUBSUB_API_BASE constant to helpers/mod.rs (shared by events/subscribe and gmail/watch) - Add validate_resource_name on --subscription in gmail +watch parse_watch_args - Replace remaining hardcoded Pub/Sub and Gmail API URLs with constants - Add test for --subscription path traversal rejection Closes #408
🦋 Changeset detectedLatest commit: 44bd878 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #441 +/- ##
==========================================
+ Coverage 67.20% 67.22% +0.02%
==========================================
Files 38 38
Lines 16666 16679 +13
==========================================
+ Hits 11200 11213 +13
Misses 5466 5466 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request deduplicates the PUBSUB_API_BASE constant for better maintainability and adds security validation for the --subscription argument in gmail +watch. My review includes one comment to complete the replacement of all hardcoded URLs.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces several improvements focused on maintainability and security. The PUBSUB_API_BASE constant has been deduplicated into a shared module, src/helpers/mod.rs, removing redundant definitions. A critical security validation has been added for the --subscription argument in the gmail +watch command to prevent path traversal vulnerabilities, and this is backed by a new test case. Additionally, hardcoded Pub/Sub and Gmail API URLs have been replaced with their respective constants. The changes are correct and well-implemented. I have not found any issues requiring changes.
Summary
Follow-up to #407 — addresses items identified during review:
PUBSUB_API_BASE— moved constant tohelpers/mod.rsso bothevents/subscribe.rsandgmail/watch.rsshare a single definition--subscriptioningmail +watch— addsvalidate_resource_name()call inparse_watch_args, matching whatevents +subscribealready does (line 54)PUBSUB_API_BASEandGMAIL_API_BASEconstantsCloses #408
Test Plan
cargo clippy -- -D warnings— cleancargo test— 584 passed, 0 failedtest_parse_watch_args_rejects_traversal_subscriptionvalidates path traversal rejection