You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/ipn/ipnlocal
Alex Chan fddb9dd6d5 cmd/tailscale/cli: stabilise the output of `tailscale lock status --json`
This patch stabilises the JSON output, and improves it in the following
ways:

* The AUM hash in Head uses the base32-encoded form of an AUM hash,
  consistent with how it's presented elsewhere
* TrustedKeys are the same format as the keys as `tailnet lock log --json`
* SigKind, Pubkey and KeyID are all presented consistently with other
  JSON output in NodeKeySignature
* FilteredPeers don't have a NodeKeySignature, because it will always
  be empty

For reference, here's the JSON output from the CLI prior to this change:

```json
{
  "Enabled": true,
  "Head": [
    196,
    69,
    63,
    243,
    213,
    133,
    123,
    46,
    183,
    203,
    143,
    34,
    184,
    85,
    80,
    1,
    221,
    92,
    49,
    213,
    93,
    106,
    5,
    206,
    176,
    250,
    58,
    165,
    155,
    136,
    11,
    13
  ],
  "PublicKey": "nlpub:0f99af5c02216193963ce9304bb4ca418846eddebe237f37a6de1c59097ed0b8",
  "NodeKey": "nodekey:8abfe98b38151748919f6e346ad16436201c3ecd453b01e9d6d3a38e1826000d",
  "NodeKeySigned": true,
  "NodeKeySignature": {
    "SigKind": 1,
    "Pubkey": "bnCKv+mLOBUXSJGfbjRq0WQ2IBw+zUU7AenW06OOGCYADQ==",
    "KeyID": "D5mvXAIhYZOWPOkwS7TKQYhG7d6+I383pt4cWQl+0Lg=",
    "Signature": "4DPW4v6MyLLwQ8AMDm27BVDGABjeC9gg1EfqRdKgzVXi/mJDwY9PTAoX0+0WTRs5SUksWjY0u1CLxq5xgjFGBA==",
    "Nested": null,
    "WrappingPubkey": "D5mvXAIhYZOWPOkwS7TKQYhG7d6+I383pt4cWQl+0Lg="
  },
  "TrustedKeys": [
    {
      "Key": "nlpub:0f99af5c02216193963ce9304bb4ca418846eddebe237f37a6de1c59097ed0b8",
      "Metadata": null,
      "Votes": 1
    },
    {
      "Key": "nlpub:de2254c040e728140d92bc967d51284e9daea103a28a97a215694c5bda2128b8",
      "Metadata": null,
      "Votes": 1
    }
  ],
  "VisiblePeers": [
    {
      "Name": "signing2.taila62b.unknown.c.ts.net.",
      "ID": 7525920332164264,
      "StableID": "nRX6TbAWm121DEVEL",
      "TailscaleIPs": [
        "100.110.67.20",
        "fd7a:115c:a1e0::9c01:4314"
      ],
      "NodeKey": "nodekey:10bf4a5c168051d700a29123cd81568377849da458abef4b328794ca9cae4313",
      "NodeKeySignature": {
        "SigKind": 1,
        "Pubkey": "bnAQv0pcFoBR1wCikSPNgVaDd4SdpFir70syh5TKnK5DEw==",
        "KeyID": "D5mvXAIhYZOWPOkwS7TKQYhG7d6+I383pt4cWQl+0Lg=",
        "Signature": "h9fhwHiNdkTqOGVQNdW6AVFoio6MFaFobPiK9ydywgmtYxcExJ38b76Tabdc56aNLxf8IfCaRw2VYPcQG2J/AA==",
        "Nested": null,
        "WrappingPubkey": "3iJUwEDnKBQNkryWfVEoTp2uoQOiipeiFWlMW9ohKLg="
      }
    }
  ],
  "FilteredPeers": [
    {
      "Name": "node3.taila62b.unknown.c.ts.net.",
      "ID": 5200614049042386,
      "StableID": "n3jAr7KNch11DEVEL",
      "TailscaleIPs": [
        "100.95.29.124",
        "fd7a:115c:a1e0::f901:1d7c"
      ],
      "NodeKey": "nodekey:454d2c8602c10574c5ec3a6790f159714802012b7b8bb8d2ab47d637f9df1d7b",
      "NodeKeySignature": {
        "SigKind": 0,
        "Pubkey": null,
        "KeyID": null,
        "Signature": null,
        "Nested": null,
        "WrappingPubkey": null
      }
    }
  ],
  "StateID": 16885615198276932820
}
```

Updates https://github.com/tailscale/corp/issues/22355
Updates https://github.com/tailscale/tailscale/issues/17619

Signed-off-by: Alex Chan <alexc@tailscale.com>

Change-Id: I65b58ff4520033e6b70fc3b1ba7fc91c1f70a960
2 days ago
..
testdata ipn/ipnlocal: fix the path for writing cert files (#7203) 3 years ago
breaktcp_darwin.go cmd/tailscale: add debug commands to break connections 2 years ago
breaktcp_linux.go cmd/tailscale: add debug commands to break connections 2 years ago
bus.go ipn/local: add the suggested exit node to the ipn bus (#16748) 4 months ago
bus_test.go ipn/ipnlocal: add IPN Bus NotifyRateLimit watch bit NotifyRateLimit 1 year ago
c2n.go types/netmap: remove PrivateKey from NetworkMap 3 weeks ago
c2n_pprof.go ipn/ipnlocal, engine: avoid runtime/pprof with two usages of ts_omit_debug 2 months ago
c2n_test.go types/netmap,*: remove some redundant fields from NetMap 3 weeks ago
captiveportal.go feature/featuretags: add build tag to remove captive portal detection 3 months ago
cert.go syncs: add Mutex/RWMutex alias/wrappers for future mutex debugging 3 weeks ago
cert_disabled.go feature/featuretags, all: add ts_omit_acme to disable TLS cert support 3 months ago
cert_test.go ipn/ipnlocal, envknob: make it possible to configure the cert client to act in read-only mode (#15250) 9 months ago
dnsconfig_test.go types/netmap,*: remove some redundant fields from NetMap 3 weeks ago
drive.go ipn/ipnlocal: fix panic in driveTransport on network error 2 weeks ago
drive_test.go ipn/ipnlocal: fix panic in driveTransport on network error 2 weeks ago
drive_tomove.go feature/drive: start factoring out Taildrive, add ts_omit_drive build tag 3 months ago
expiry.go ipn/ipnlocal: use eventbus.SubscribeFunc in expiryManager 2 months ago
expiry_test.go control/controlclient: introduce eventbus messages instead of callbacks (#16956) 3 months ago
extension_host.go ipn/ipnlocal: make GetExt work earlier, before extension init 7 months ago
extension_host_test.go health,ipn/ipnlocal: introduce eventbus in heath.Tracker (#17085) 3 months ago
hwattest.go Revert "control/controlclient: back out HW key attestation (#17664)" (#17732) 1 month ago
local.go ipn/ipnlocal: add peer API endpoints to Hostinfo on initial client creation (#17851) 5 days ago
local_test.go ipn/ipnlocal: don't panic if there are no suitable exit nodes 2 weeks ago
loglines_test.go health,ipn/ipnlocal: introduce eventbus in heath.Tracker (#17085) 3 months ago
netstack.go ipn/ipnlocal: move last unconditional gvisor import, complete ts_omit_netstack support 3 months ago
network-lock.go cmd/tailscale/cli: stabilise the output of `tailscale lock status --json` 2 days ago
network-lock_test.go tstest/integration: add integration test for Tailnet Lock 2 weeks ago
node_backend.go types/netmap,*: remove some redundant fields from NetMap 3 weeks ago
node_backend_test.go ipn/ipnlocal: introduce the concept of client-side-reachability (#17367) 2 months ago
peerapi.go feature/featuretags: add features for c2n, peerapi, advertise/use routes/exit nodes 2 months ago
peerapi_drive.go feature/drive: start factoring out Taildrive, add ts_omit_drive build tag 3 months ago
peerapi_macios_ext.go net/netmon, add: add netmon.State type alias of interfaces.State 2 years ago
peerapi_test.go ipn/ipnlocal: fix another racy test (#17472) 2 months ago
prefs_metrics.go feature/featuretags: add features for c2n, peerapi, advertise/use routes/exit nodes 2 months ago
profiles.go types/netmap: remove PrivateKey from NetworkMap 3 weeks ago
profiles_notwindows.go ipn/ipnlocal: refactor and cleanup profileManager 1 year ago
profiles_test.go ipn{,/local},cmd/tailscale: add "sync" flag and pref to disable control map poll 3 weeks ago
profiles_windows.go ipn/ipnlocal: refactor and cleanup profileManager 1 year ago
serve.go cmd/tailscale,ipn: add Unix socket support for serve 6 days ago
serve_disabled.go all: add ts_omit_serve, start making tailscale serve/funnel be modular 3 months ago
serve_test.go ipn/ipnlocal: add validations when setting serve config (#17950) 3 weeks ago
serve_unix_test.go cmd/tailscale,ipn: add Unix socket support for serve 6 days ago
ssh.go ipn/ipnlocal: fix a case where ts_omit_ssh was still linking in x/crypto/ssh 3 months ago
ssh_stub.go ipn/ipnlocal: fix a case where ts_omit_ssh was still linking in x/crypto/ssh 3 months ago
ssh_test.go health,ipn/ipnlocal: introduce eventbus in heath.Tracker (#17085) 3 months ago
state_test.go ipn/ipnlocal: add peer API endpoints to Hostinfo on initial client creation (#17851) 5 days ago
tailnetlock_disabled.go all: add ts_omit_tailnetlock as a start of making it build-time modular 3 months ago
web_client.go util/backoff: rename logtail/backoff package to util/backoff 2 months ago
web_client_stub.go derp/derpserver: split off derp.Server out of derp into its own package 3 months ago