Skip to content

Move Clearance to require signed cookie#6387

Open
colby-swandale wants to merge 1 commit intomasterfrom
colby/remove-cookie-migration
Open

Move Clearance to require signed cookie#6387
colby-swandale wants to merge 1 commit intomasterfrom
colby/remove-cookie-migration

Conversation

@colby-swandale
Copy link
Copy Markdown
Member

Remove the :migrate compatibility shim for signed cookies. After 4+ years and 130+ re-issuances on a 2-week expiry, no unsigned cookies remain. Change config.signed_cookie from :migrate to true. The :migrate setting was added in April 2021 to transparently upgrade unsigned remember_token cookies to signed ones. With a 2-week cookie expiry, all active cookies have been re-issued over a hundred times since then, no unsigned cookies remain to migrate.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the app’s Clearance authentication configuration to stop supporting legacy unsigned remember_token cookies, enforcing signed cookies going forward.

Changes:

  • Remove the Clearance signed-cookie migration mode by switching config.signed_cookie from :migrate to true.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

config.cookie_expiration = ->(_cookies) { 2.weeks.from_now.utc }
config.routes = false
config.signed_cookie = :migrate
config.signed_cookie = true
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR title mentions requiring a "secure cookie", but this change actually enforces a signed remember_token cookie by removing the :migrate shim. Consider updating the title (or adding a clarifying note in the description) so it matches the behavior being changed.

Copilot uses AI. Check for mistakes.
@colby-swandale colby-swandale changed the title Move Clearance to require secure cookie Move Clearance to require signed cookie Apr 4, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.34%. Comparing base (5c01c81) to head (37820ba).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6387      +/-   ##
==========================================
- Coverage   97.08%   87.34%   -9.74%     
==========================================
  Files         489      489              
  Lines       10392    10566     +174     
==========================================
- Hits        10089     9229     -860     
- Misses        303     1337    +1034     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants