control/controlclient: document test TestClientsReusingKeys.

The test is straightforward, but it's a little perplexing if you're
not overly familiar with controlclient.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2020-04-27 22:45:00 -07:00
parent 8296c934ac
commit cbb1e2e853
2 changed files with 42 additions and 14 deletions
+6
View File
@@ -1167,6 +1167,12 @@ func authURLForPOST(authURL string) string {
return authURL[:i] + "/login?refresh=true&next_url=" + url.PathEscape(authURL[i:])
}
// postAuthURL manually executes the OAuth login flow, starting at
// authURL and claiming to be user. This flow will only work correctly
// if the control server is configured with the "None" auth provider,
// which blindly accepts the provided user and produces a cookie for
// them. postAuthURL returns the auth cookie produced by the control
// server.
func postAuthURL(t *testing.T, ctx context.Context, httpc *http.Client, user string, authURL string) *http.Cookie {
t.Helper()