encode JSON encodes v as JSON, logging tailcfg.MapRequest values if debugMap is set.
(v any)
| 1518 | // encode JSON encodes v as JSON, logging tailcfg.MapRequest values if |
| 1519 | // debugMap is set. |
| 1520 | func encode(v any) ([]byte, error) { |
| 1521 | b, err := json.Marshal(v) |
| 1522 | if err != nil { |
| 1523 | return nil, err |
| 1524 | } |
| 1525 | if DevKnob.DumpNetMaps() { |
| 1526 | if _, ok := v.(*tailcfg.MapRequest); ok { |
| 1527 | log.Printf("MapRequest: %s", b) |
| 1528 | } |
| 1529 | } |
| 1530 | return b, nil |
| 1531 | } |
| 1532 | |
| 1533 | func loadServerPubKeys(ctx context.Context, httpc *http.Client, serverURL string) (*tailcfg.OverTLSPublicKeyResponse, error) { |
| 1534 | keyURL := fmt.Sprintf("%v/key?v=%d", serverURL, tailcfg.CurrentCapabilityVersion) |
no test coverage detected
searching dependent graphs…