bird-house / bird-house/twitcher

Should twitcher allow redirects?

Open
#89 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
15
Forks
5
Avg merge
4d 14h
Merged PRs (30d)
4

Description

@cehbrecht and @fmigneault I wanted to get your thoughts before submitting a PR.

If you look at this commit, I explain roughly why I think twitcher shouldn't allow redirects: https://github.com/bird-house/twitcher/commit/6e8203a3e79998de505e5a0f51c4f47119283311

### Our use case
Our problem is that we want to protect the web interface of geoserver behind twitcher. When a user logs in, a POST request is sent to twitcher and forwarded to geoserver. Geoserver responds with a series of 302 redirects. Twitcher sends back the last of these responses, which is the main geoserver page. But the user's browser still thinks it's at the POST url, and relative urls are broken. When I got to actually log in, all css, images and others were not loaded. With these changes, I could login successfully, because the redirects were sent to my browser directly, just as if twitcher wasn't there.

### Where it could break existing applications
If application generates self-referential urls in the response content, this change should not break them if the app was configured correctly previously.

I believe the only place where this can cause a problem is when there is a redirect, and the app generates `location` header. If twitcher follows redirects, it will work. But if twitcher doesn't follow redirects, the browser will receive the protected url in the `Location` header and try to follow it. It will obviously break.

So... making this change would at least need to bump the minor 0.x version.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing commit 6e8203a3e79998de505e0a5f51c4f47119283311 and tracing the POST request through Twitcher when GeoServer returns successive 302 responses. Confirm the intended behavior for protected Location headers and existing applications, and define done as an agreed redirect policy with coverage for the described login flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.