AddAllowedClient adds k as an allowed client. Until a key is allowed (here or via [Server.AllowedClients]), all clients are allowed.
(k key.NodePublic)
| 594 | // Until a key is allowed (here or via [Server.AllowedClients]), all |
| 595 | // clients are allowed. |
| 596 | func (s *Server) AddAllowedClient(k key.NodePublic) { |
| 597 | if s.lb == nil { |
| 598 | // Not yet started; applied at Start. |
| 599 | s.AllowedClients = append(s.AllowedClients, k) |
| 600 | return |
| 601 | } |
| 602 | s.lb.mu.Lock() |
| 603 | defer s.lb.mu.Unlock() |
| 604 | mak.Set(&s.lb.allowedClients, k, true) |
| 605 | } |
| 606 | |
| 607 | // ConnBlob returns the token that clients use to connect to this |
| 608 | // server. It embeds the full DERP region, so clients don't need to |
no outgoing calls