Repository navigation
auth_proxy: apps under path prefixes, guest routes, login lists - #59
Merged
Merged
Conversation
So one host name, one auth_proxy and one OAuth app can front several apps on a machine, a --user-map line now takes: - `strip` after the upstream: the upstream gets the path without the prefix (/manager/x -> /x) and the prefix in X-Forwarded-Prefix, and a Location: /... it answers with gets the prefix back. - `-` as LOGIN: no sign-in needed (a guest area); a session, if any, still sets X-Forwarded-User. Any other route still asks to sign in first when there is no session, rather than answering 403. - several logins separated by commas; `*` is every signed-in user. Without --allowed-users the named logins may sign in, lists included. One sign-in covers every route (the session cookie is Path=/). auth_spec covers each, with one session across routes.
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.
Why
The goal is one host name, one
auth_proxyand one OAuth app per machine, with several apps living side by side under path prefixes (/manager/,/grafana/,/tavern/, …). Three things were missing for that:What
--user-maplines are nowLOGIN PATH-PREFIX UPSTREAM [strip].strip/manager/xbecomes/x, and/managerbecomes/.X-Forwarded-Prefix. A client-sentX-Forwarded-Prefixis dropped, like everyX-Forwarded-*.Location: /…the upstream answers with gets the prefix back. Absolute URLs and//hostare left alone.strip, the path is passed on unchanged, as before.LOGIN
alice,bob).*is every signed-in user.-is everyone, with no sign-in. A session, if there is one, still setsX-Forwarded-User.Without a session
-one asks to sign in first: a redirect, or 401 under the API prefix. Before, it answered 403, but signing in may open the route.Sign-in
Path=/.--allowed-users, every login named in the map may sign in, comma lists included.Matching is unchanged: the longest prefix wins, compared by whole segments after
canonicalPath?, anddenywins a tie.Tests
auth_spec(LEANTEA_TLS=1 locally): 168 passed, 0 failed. The 8 new checks cover:stripwithX-Forwarded-Prefix, both under the prefix and at the prefix itself;next) for an anonymous request to a signed-in route;-route reached both anonymously and with a session;Locationrewrite;/,/managerand/guestroutes;stripPrefixandrelocate;The full
lake buildpasses.Already in place (item 5 of the request)
_-spelled identity headers.email_verifiedis true.