sourcegraph/dev/internal/cmd/auth-proxy-http-header
Keegan Carruthers-Smith bb1823ae67
auth: auth-proxy-http-header command for testing multiple users (#39231)
For permission testing I wrote this command to very conveniently switch
between users. This is kind of like the already existing testproxy,
except much more convenient to use as well as being targetted for auth
testing rather than http-header testing.

I'm unsure of how to document this further so people are aware of it.
Alternatively I think it is also useful to maybe spin up by default in
our enterprise env. I'll leave both of those for future PRs. For now I
will advertise in #dev-chat and #dev-experience.

Here is the example output to give you a feel for what it does:

  $ go run ./dev/internal/cmd/auth-proxy-http-header
  https://docs.sourcegraph.com/admin/auth#http-authentication-proxies

    "auth.providers": [
      {
        "type": "http-header",
        "usernameHeader": "X-Forwarded-User",
        "emailHeader": "X-Forwarded-Email"
      }
    ]

  Visit http://127.0.0.1:10810 for keegan keegan@sourcegraph.com
  Visit http://127.0.0.1:10811 for user1 keegan+user1@sourcegraph.com
  Visit http://127.0.0.1:10812 for user2 keegan+user2@sourcegraph.com
  Visit http://127.0.0.1:10813 for user3 keegan+user3@sourcegraph.com
  Visit http://127.0.0.1:10814 for user4 keegan+user4@sourcegraph.com
  Visit http://127.0.0.1:10815 for user5 keegan+user5@sourcegraph.com

Test Plan: Ran locally
2022-07-27 08:05:10 +00:00
..
auth-proxy-http-header.go auth: auth-proxy-http-header command for testing multiple users (#39231) 2022-07-27 08:05:10 +00:00