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

Method CompleteAuth

tstest/integration/testcontrol/testcontrol.go:763–783  ·  view source on GitHub ↗

CompleteAuth marks the provided path or URL (containing "/auth/...") as successfully authenticated, unblocking any requests blocked on that in serveRegister.

(authPathOrURL string)

Source from the content-addressed store, hash-verified

761// "/auth/...") as successfully authenticated, unblocking any
762// requests blocked on that in serveRegister.
763func (s *Server) CompleteAuth(authPathOrURL string) bool {
764 i := strings.Index(authPathOrURL, "/auth/")
765 if i == -1 {
766 return false
767 }
768 authPath := authPathOrURL[i:]
769
770 s.mu.Lock()
771 defer s.mu.Unlock()
772 ap, ok := s.authPath[authPath]
773 if !ok {
774 return false
775 }
776 if ap.nodeKey.IsZero() {
777 panic("zero AuthPath.NodeKey")
778 }
779 s.nodeKeyAuthed.Make()
780 s.nodeKeyAuthed.Add(ap.nodeKey)
781 ap.CompleteSuccessfully()
782 return true
783}
784
785// Complete the device approval for this node.
786//

Callers 1

completeLoginFunction · 0.80

Calls 7

IndexMethod · 0.80
CompleteSuccessfullyMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65
IsZeroMethod · 0.65
AddMethod · 0.65
MakeMethod · 0.45

Tested by 1

completeLoginFunction · 0.64