Skip to content

feat: refuse chat-service webhook URLs, name the contract set in dg --version, warn on unlimited keys, honour hides in notifications - #364

Merged
PastaPastaPasta merged 11 commits into
masterfrom
feat/p0-e10-dx-guards
Oct 5, 2026
Merged

PastaPastaPasta merged 11 commits into
masterfrom
feat/p0-e10-dx-guards

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

What

Four small guards from the release-readiness epic:

  • Chat-service webhook URLs are refused. Discord, Slack, Microsoft Teams and Google Chat incoming-webhook URLs contain their token. A hook's URL is public on chain and stays in its history, so writing one lets anyone post to the channel. dg webhook add and the web's webhook form now refuse these URLs, even with --force or the "holds nothing secret" box, and link to a new Chat services section in the relay README: keep the URL in your own relay's private [[webhook]] config. A token-like segment after /webhook/ (Matrix hookshot and similar) is refused unless the writer confirms it, like a query string today.
  • dg --version names the contract set. It lists, per network, the contract group this build uses (-V stays one line):
    dg 0.0.0 (b3a9d0adcc42 aarch64-apple-darwin)
    Forge contracts:
      devnet-sakura   contract group 524edcYDs34MG2ArVDapjBBtWeLKxr4qTCK8uGV5a182
      mainnet         not deployed
      testnet         not deployed
    
  • dg doctor warns on unlimited keys. A signing key with no budget or expiry can spend the whole balance. The keys row is now a warning with the fix (dg auth login <identity file> registers a capped key), and dg auth status prints the same warning.
  • Notifications honour hides. The inbox keeps the hide and unhide events its repo event feeds already read, and folds them with the shared reader rule, so a hidden issue or PR and a hidden comment or review leave the inbox as they leave the lists. A watched repo with a new issue or PR in the inbox, and no followed thread, gets its event feed read for hides. Without the contract's maintainer proof only the owner's hides count.

Why

Roadmap E10 (webhook token guard, --version names the contract set) and quick win 13 (inbox honours hides, dg doctor warns on unlimited keys).

How

  • forge_core::webhooks::url_secret and webhookUrlSecret (web) classify a URL by host and path. The 16 new webhook_url__* vectors keep the two in step.
  • check_url_and_events refuses a chat-service URL whatever allow_credentials says. dg webhook add checks the URL before it asks for a secret or reads the chain.
  • dg's long_version is built from the embedded deployment files, leaving out retired devnets.
  • inbox.ts: withHides, visibleItems, hideWatchRepos, pruneHides. use-inbox filters stored items through visibleItems. Nothing stored is deleted, so an unhide brings an item back.

How tested

  • cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, cargo test --workspace. New tests: the URL checks, webhook_url vectors, an_unlimited_key_is_a_warning, and the --version output.
  • forge-web tsc, eslint --max-warnings=0, vitest (5671 passed). New tests: the webhook form rule, conformance webhook_url, and the inbox hide fold (hide, unhide, owner-only without proof, hide-only feeds, pruning).
  • dg webhook add against a Discord URL with --force:
    error: webhook not added                                                [E201]
      cause: a Discord webhook URL contains its token, and a hook's URL is public on chain: anyone could post to your channel
      fix:   keep the URL in your own relay's config instead: https://github.com/PastaPastaPasta/dash-forge/blob/master/crates/forge-relay/README.md#chat-services
      note:  nothing was written or paid
    

Limits

  • Hides in a repo reach the inbox through that repo's event feed, so a hide lands within a poll round or two, not instantly.
  • The inbox does not read members: on a contract without the maintainer proof, only the owner's hides count there (the lists also count current maintainers').
  • Slack, Teams and Google Chat expect their own message format. The README says to put a small forwarder in front of them, because the relay sends GitHub-shaped bodies.

🤖 Generated with Claude Code

PastaPastaPasta and others added 4 commits October 4, 2026 12:17
A hook's URL is public on chain and stays in its history. Discord, Slack, Teams and Google Chat incoming-webhook URLs carry their token in the path, so writing one lets anyone post to the channel. dg and the web now refuse them even when forced, and point to keeping the URL in a relay's private [[webhook]] config. A token-like segment after /webhook/ (Matrix hookshot and similar) is refused unless the writer confirms it holds nothing secret. Rust and TypeScript share the rule through webhook_url vectors.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… keys

dg --version now lists, per network, the contract group this build uses, so a user can tell a binary built for another deployment. dg doctor warns when the signing key has no budget or expiry, and dg auth status says so too, with the command that registers a capped key.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The inbox now keeps the hide and unhide events its repo event feeds read and folds them with the shared reader rule, as the issue and PR lists do. A watched repo with a new issue or PR in the inbox and no followed thread gets its events read for hides. Without the contract's proof only the owner's hides count.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 725fa291-2e85-43a8-a7c1-6cf397361c8f
📥 Commits

Reviewing files that changed from the base of the PR and between 366da81 and 56aa412.

📒 Files selected for processing (38)
  • crates/dg/src/auth/mod.rs
  • crates/dg/src/doctor.rs
  • crates/dg/src/main.rs
  • crates/dg/src/webhook.rs
  • crates/forge-core/src/rules.rs
  • crates/forge-core/src/webhooks.rs
  • crates/forge-relay/README.md
  • docs/contracts/forge-v2.md
  • docs/guides/collaborating.md
  • forge-contracts/vectors/webhook_url__discord.json
  • forge-contracts/vectors/webhook_url__discord_github_suffix.json
  • forge-contracts/vectors/webhook_url__discord_not_a_webhook.json
  • forge-contracts/vectors/webhook_url__discord_versioned_subdomain.json
  • forge-contracts/vectors/webhook_url__discord_with_port.json
  • forge-contracts/vectors/webhook_url__google_chat.json
  • forge-contracts/vectors/webhook_url__hookshot_path_token.json
  • forge-contracts/vectors/webhook_url__mattermost_hooks.json
  • forge-contracts/vectors/webhook_url__ordinary_receiver.json
  • forge-contracts/vectors/webhook_url__plain_ci_hook.json
  • forge-contracts/vectors/webhook_url__power_automate.json
  • forge-contracts/vectors/webhook_url__rocketchat_later_segment.json
  • forge-contracts/vectors/webhook_url__short_segment.json
  • forge-contracts/vectors/webhook_url__slack.json
  • forge-contracts/vectors/webhook_url__slack_host_case.json
  • forge-contracts/vectors/webhook_url__slack_lookalike_host.json
  • forge-contracts/vectors/webhook_url__teams.json
  • forge-contracts/vectors/webhook_url__teams_legacy.json
  • forge-contracts/vectors/webhook_url__webhooks_path_token.json
  • forge-web/components/repo/webhook-settings.tsx
  • forge-web/hooks/use-inbox.ts
  • forge-web/lib/repo/contract.ts
  • forge-web/lib/repo/moderation-fold.ts
  • forge-web/lib/repo/moderation.ts
  • forge-web/lib/repo/webhooks.test.ts
  • forge-web/lib/repo/webhooks.ts
  • forge-web/lib/rules/conformance.test.ts
  • forge-web/lib/view/inbox.test.ts
  • forge-web/lib/view/inbox.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

PastaPastaPasta and others added 3 commits October 4, 2026 12:36
Removing another maintainer's hook writes a disabled revision with its URL, which the new check refused for a chat service: such a hook could not be stopped. A disabled revision is now exempt. Power Automate workflow URLs (Teams Workflows) are refused like the other chat services, and a token after /hooks/ (Mattermost, Rocket.Chat) is treated like one after /webhook/. dg webhook add's URL check moves to a helper with a test.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Review fixes: a thread's hides keep its key and writer, so a hidden comment stays hidden after the thread leaves the watch set, and a maintainer's hide never outranks the owner on the owner's thread. A failed contract read keeps the last proof flag. Hides are capped at the 500 newest threads instead of pruned by item ids. Only the five repos with the most recent new items in the last week get an event feed for hides, and a threadless feed now writes its coverage record so a thread followed later is still backfilled. Kind and property names come from the shared modules.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@PastaPastaPasta

Copy link
Copy Markdown
Owner Author

@coderabbitai review


🤖 Posted autonomously by Claude on behalf of pasta.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

PastaPastaPasta and others added 4 commits October 4, 2026 14:27
rules.rs: master moved repo_name vectors into run_repo_name_case; webhook_url keeps its own runner.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@PastaPastaPasta
PastaPastaPasta merged commit 40da852 into master Oct 5, 2026
32 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the feat/p0-e10-dx-guards branch October 5, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant