Skip to content

[4.x] Make URL::temporarySignedRoute() respect the bypass parameter#1438

Merged
stancl merged 2 commits intomasterfrom
temporary-signed-route
Mar 9, 2026
Merged

[4.x] Make URL::temporarySignedRoute() respect the bypass parameter#1438
stancl merged 2 commits intomasterfrom
temporary-signed-route

Conversation

@lukinovec
Copy link
Contributor

Using URL::temporarySignedRoute() in tenant context with UrlGeneratorBootstrapper enabled doesn't work the same as route(). The bypass parameter doesn't actually bypass the route name prefixing.

route() is called in the parent::temporarySignedRoute() call, and because the bypass parameter is removed before calling parent::temporarySignedRoute(), the underlying route() call doesn't get the bypass parameter and it ends up attempting to generate URL for a route with the name prefixed with 'tenant.'.

This PR adds the bypass parameter back after prepareRouteInputs(), so that parent::temporarySignedRoute() receives it, and the underlying route() call respects it. Also added basic tests for the URL::temporarySignedRoute() behavior (the new bypass parameter test works as a regression test).

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.08%. Comparing base (37b2a91) to head (681f285).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1438      +/-   ##
============================================
+ Coverage     85.92%   86.08%   +0.16%     
- Complexity     1147     1148       +1     
============================================
  Files           184      184              
  Lines          3360     3363       +3     
============================================
+ Hits           2887     2895       +8     
+ Misses          473      468       -5     

☔ 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.

@stancl stancl marked this pull request as ready for review March 9, 2026 01:01
@stancl stancl requested a review from Copilot March 9, 2026 01:02
Copy link
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 fixes tenant-context URL generation for URL::temporarySignedRoute() when UrlGeneratorBootstrapper is enabled, ensuring the bypass parameter is honored the same way it is for route().

Changes:

  • Re-add the bypass parameter after prepareRouteInputs() in TenancyUrlGenerator::temporarySignedRoute() so the internal route() call can properly bypass tenancy route-name prefixing/parameter injection.
  • Add regression tests covering temporarySignedRoute() route-name auto-prefixing and bypass behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Overrides/TenancyUrlGenerator.php Preserves the bypass flag for the internal route() call made by parent::temporarySignedRoute().
tests/Bootstrappers/UrlGeneratorBootstrapperTest.php Adds coverage to prevent regressions in signed URL generation under tenant context, including bypass behavior.

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

@stancl stancl merged commit 16861d2 into master Mar 9, 2026
13 of 15 checks passed
@stancl stancl deleted the temporary-signed-route branch March 9, 2026 01:07
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.

3 participants