MCPcopy Create free account
hub / github.com/tailscale/tailscale / completeLogin

Function completeLogin

tstest/integration/integration_test.go:307–324  ·  view source on GitHub ↗

This handler receives auth URLs, and logs into control. It counts how many URLs it sees, and will fail the test if it sees multiple login URLs.

(t *testing.T, control *testcontrol.Server, counter *atomic.Int32)

Source from the content-addressed store, hash-verified

305// It counts how many URLs it sees, and will fail the test if it
306// sees multiple login URLs.
307func completeLogin(t *testing.T, control *testcontrol.Server, counter *atomic.Int32) func(string) error {
308 return func(urlStr string) error {
309 t.Logf("saw auth URL %q", urlStr)
310 if control.CompleteAuth(urlStr) {
311 if counter.Add(1) > 1 {
312 err := errors.New("completed multiple auth URLs")
313 t.Error(err)
314 return err
315 }
316 t.Logf("completed login to %s", urlStr)
317 return nil
318 } else {
319 err := fmt.Errorf("failed to complete initial login to %q", urlStr)
320 t.Fatal(err)
321 return err
322 }
323 }
324}
325
326// This handler receives device approval URLs, and approves the device.
327//

Callers 3

TestOneNodeUpAuthFunction · 0.85

Calls 7

CompleteAuthMethod · 0.80
LogfMethod · 0.65
AddMethod · 0.65
ErrorMethod · 0.65
ErrorfMethod · 0.65
FatalMethod · 0.65
NewMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…