Skip to content

fix: preserve query parameters for login - #1068

Open
steveiliop56 wants to merge 2 commits into
mainfrom
fix/login-query-params
Open

fix: preserve query parameters for login#1068
steveiliop56 wants to merge 2 commits into
mainfrom
fix/login-query-params

Conversation

@steveiliop56

@steveiliop56 steveiliop56 commented Aug 10, 2026

Copy link
Copy Markdown
Member

Fixes #1060

Summary by CodeRabbit

  • Bug Fixes
    • Login redirects now preserve query parameters for forward authentication, Nginx auth requests, and Envoy external authorization.
    • Access-control path handling now correctly processes original request URLs before normalization.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ffefc10-3b92-44df-984a-9108f38fafe5

📥 Commits

Reviewing files that changed from the base of the PR and between 233c8c4 and dc92b75.

📒 Files selected for processing (1)
  • internal/controller/proxy_controller_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/controller/proxy_controller_test.go

📝 Walkthrough

Walkthrough

The proxy context retains the original request URI separately from the cleaned ACL path. Authentication redirects use the original URI, and tests verify query-parameter preservation for Traefik, Nginx, and Envoy integrations.

Changes

Request URI preservation

Layer / File(s) Summary
Raw path context and ACL normalization
internal/controller/proxy_controller.go
ProxyContext stores the original URI in PathRaw. Proxy-specific context builders populate it, and ACL processing cleans a parsed copy into Path.
Redirect URI preservation
internal/controller/proxy_controller.go, internal/controller/proxy_controller_test.go
Authentication redirects use PathRaw. Tests verify query parameters for Traefik, Nginx, and Envoy requests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • tinyauthapp/tinyauth#714: This PR extends the ProxyContext and authentication context-builder changes from PR #714 with PathRaw redirect handling.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: preserving query parameters in login redirects.
Linked Issues check ✅ Passed The changes preserve the original path and query string in login redirects across the supported authentication proxy contexts, meeting issue #1060.
Out of Scope Changes check ✅ Passed All code and test changes directly support preserving query parameters in login redirects and preventing their loss.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/login-query-params

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.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@internal/controller/proxy_controller_test.go`:
- Around line 98-129: Update both redirect test cases in the proxy controller
test to use the non-root target path “/search?q=hello” in their forwarded URL
headers and expected escaped locations. Keep the existing status and
login-redirect assertions unchanged so the tests verify preservation of both
path and query parameters for Traefik and Nginx.
🪄 Autofix

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a8ce711-663a-473e-b71a-a8a8926a51f5

📥 Commits

Reviewing files that changed from the base of the PR and between ad700e7 and 233c8c4.

📒 Files selected for processing (2)
  • internal/controller/proxy_controller.go
  • internal/controller/proxy_controller_test.go

Comment thread internal/controller/proxy_controller_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forward-auth login redirect drops the original request's query string

1 participant