feat(trogon-gateway): expose Notion verification token command#158
Conversation
yordis
commented
May 13, 2026
- Notion webhook setup needs an operator path that works from the deployed gateway pod without exposing secrets through a network admin surface.
- Keeping the lookup inside the gateway binary avoids requiring extra tools in production environments.
PR SummaryMedium Risk Overview Introduces Extends Reviewed by Cursor Bugbot for commit 9708eec. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (16)
WalkthroughThis PR extends the trogon-gateway with a new CLI command for Notion integrations to retrieve and watch verification tokens via NATS JetStream. It adds JetStream infrastructure in trogon-nats, implements the token module with error handling and parsing, wires the CLI command structure, implements the main dispatch handler, and integrates with the webhook server. ChangesNotion Verification Token Retrieval via NATS JetStream
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
Code Coverage SummaryDetailsDiff against mainResults for commit: 9708eec Minimum allowed coverage is ♻️ This comment has been updated with latest results |
3098b11 to
521fb48
Compare
38c83d0 to
7abd211
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7abd211. Configure here.
7abd211 to
09f4f57
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rsworkspace/crates/trogon-gateway/src/main.rs`:
- Around line 212-242: The helper notion_verification_token currently accepts
integration: &str and compares it to source.id.as_str(); change the API to
accept the domain type used for integration IDs (e.g., IntegrationId or
SourceIntegrationId) instead of &str, update the comparison to compare domain
types (integration == source.id) inside notion_verification_token, and convert
the CLI-provided String to that domain type in main() before calling
notion_verification_token (use the constructor/parse/try_from in
source_integration_id.rs and propagate any validation errors back to the
caller).
- Around line 228-232: Replace the string error created by format!() with a
typed error: define an enum like NotionVerificationTokenError (e.g., variant
IntegrationNotFound(String)) plus impls for fmt::Display and std::error::Error
above the function, then change the ok_or_else call on
resolved.notion.iter().find(...) to return
Err(NotionVerificationTokenError::IntegrationNotFound(integration.to_string()))
(or construct the variant from the integration identifier) instead of using
format!().
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a23e309a-883c-4d89-9f4a-850ddc317181
⛔ Files ignored due to path filters (1)
rsworkspace/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (11)
rsworkspace/Cargo.tomlrsworkspace/crates/trogon-gateway/Cargo.tomlrsworkspace/crates/trogon-gateway/src/cli.rsrsworkspace/crates/trogon-gateway/src/main.rsrsworkspace/crates/trogon-gateway/src/source/notion/mod.rsrsworkspace/crates/trogon-gateway/src/source/notion/server.rsrsworkspace/crates/trogon-gateway/src/source/notion/verification_token.rsrsworkspace/crates/trogon-nats/Cargo.tomlrsworkspace/crates/trogon-nats/src/jetstream/mocks.rsrsworkspace/crates/trogon-nats/src/jetstream/mod.rsrsworkspace/crates/trogon-nats/src/jetstream/traits.rs
02b4f55 to
72aa044
Compare
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
72aa044 to
9708eec
Compare
