feat: harden share page with no-referrer + global rate limit#147
Merged
tomasz-tomczyk merged 1 commit intomainfrom Apr 30, 2026
Merged
feat: harden share page with no-referrer + global rate limit#147tomasz-tomczyk merged 1 commit intomainfrom
tomasz-tomczyk merged 1 commit intomainfrom
Conversation
Set Referrer-Policy: no-referrer on private routes (combined into the existing :noindex pipeline) so external link clicks from a rendered review page don't leak the secret URL via the Referer header. Add CritWeb.Plugs.RateLimit — a global per-IP backstop (180/min default, Hammer-backed) on :browser, :api, :device_api, and :auth_api pipelines. Returns 429 with Retry-After: 60 and a JSON or text body per the :response opt. Existing tighter limiters (POST /api/reviews 30/min, /api/reviews 404 10/5min) stay layered on top. Bypassed in tests via config :crit, CritWeb.Plugs.RateLimit, disabled: true — shared 127.0.0.1 across the suite would otherwise trip the limiter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #147 +/- ##
==========================================
+ Coverage 77.13% 77.37% +0.23%
==========================================
Files 54 55 +1
Lines 1636 1653 +17
==========================================
+ Hits 1262 1279 +17
Misses 374 374
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4 tasks
tomasz-tomczyk
added a commit
that referenced
this pull request
Apr 30, 2026
Two parity gaps from #147 (closes crit/#374): 1. Review-level comment cards on crit-web didn't expose a reply input, only line-anchored cards did. Round-trip tests passed because they exercised the API directly. Adds renderReplyList + createReplyInput to the inline review-conversation card, matching the line-anchored render path. 2. crit-web has no git-mode equivalent — every review is doc-style. Drop the multi-file branch in renderReviewConversation and always set data-doc-layout="centered" so the Review conversation block centers consistently with the rest of the document. Adds a LiveView test that exercises the add_reply event end-to-end on a review-scope comment to lock the parity. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Referrer-Policy: no-referreron private routes (review page, dashboard, settings, overview, CLI auth, all/api/*). External link clicks from a rendered review no longer leak the secret URL via theRefererheader. Combined into the existing:noindexpipeline.CritWeb.Plugs.RateLimit— a global per-IP backstop, 180/min default, Hammer-backed. Returns 429 withRetry-After: 60and a JSON or text body per a:responseopt. Installed on:browser(text) and:api/:device_api/:auth_api(json).POST /api/reviews30/min,/api/reviews404 10/5min) stay layered on top via separate Hammer buckets — same module, different keys.config :crit, CritWeb.Plugs.RateLimit, disabled: true— shared127.0.0.1across the suite would otherwise trip the limiter.Review
Test plan
🤖 Generated with Claude Code