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/cmd
Alex Chan 8d03343bfb 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
..
addlicense all: fix golangci-lint errors 11 months ago
build-webclient client/web: precompress assets 2 years ago
checkmetrics cmd/checkmetrics: add command for checking metrics against kb 1 year ago
cigocacher cmd/cigocacher,go.mod: add cigocacher cmd 1 week ago
cloner cmd/cloner: support cloning arbitrarily-nested maps 3 weeks ago
connector-gen cmd/connector-gen: add helper tool for wide app connector configurations 2 years ago
containerboot all: rename variables with lowercase-l/uppercase-I 2 weeks ago
derper derp/derpserver: add a unique sender cardinality estimate 7 days ago
derpprobe cmd/derpprobe,prober: add run all probes handler (#16875) 4 months ago
dist {cmd/dist,release/dist}: add support for intermediary QNAP signing certificates 4 months ago
featuretags feature/featuretags,cmd/omitsize: support feature dependencies 3 months ago
get-authkey cmd,tsnet,internal/client: create internal shim to deprecated control plane API 10 months ago
gitops-pusher scripts/check_license_headers.sh: delete, rewrite as a Go test 6 months ago
hello cmd/hello: display native ipv4 (#15191) 9 months ago
jsonimports cmd/jsonimports: add static analyzer for consistent "json" imports (#17669) 1 month ago
k8s-nameserver k8s-operator: add IPv6 support for DNS records (#16691) 2 months ago
k8s-operator cmd/k8s-operator fix populateTLSSecret on tests (#18088) 5 days ago
k8s-proxy all: rename variables with lowercase-l/uppercase-I 2 weeks ago
mkmanifest cmd/mkmanifest, cmd/tailscale, cmd/tailscaled: remove Windows arm32 resources from OSS 3 years ago
mkpkg go.mod: upgrade nfpm to v2 (#8786) 2 years ago
mkversion version/mkversion: open-source version generation logic 3 years ago
nardump cmd/nardump: support symlinks, add basic test 8 months ago
natc all: rename variables with lowercase-l/uppercase-I 2 weeks ago
netlogfmt cmd/netlogfmt: support resolving IP addresses to synonymous labels (#17955) 2 weeks ago
nginx-auth tailcfg,all: add and use Node.IsTagged() 3 years ago
omitsize feature/featuretags,cmd/omitsize: support feature dependencies 3 months ago
pgproxy all: use new LocalAPI client package location 10 months ago
printdep cmd/printdep: print correct toolchain URL 3 years ago
proxy-test-server net/tlsdial: fix TLS cert validation of HTTPS proxies 6 months ago
proxy-to-grafana scripts/check_license_headers.sh: delete, rewrite as a Go test 6 months ago
sniproxy all: rename variables with lowercase-l/uppercase-I 2 weeks ago
speedtest all: update copyright and license headers 3 years ago
ssh-auth-none-demo ssh,tempfork/gliderlabs/ssh: replace github.com/tailscale/golang-x-crypto/ssh with golang.org/x/crypto/ssh 10 months ago
stunc cmd/stunc: enforce read timeout deadline (#14309) 1 year ago
stund cmd/cigocacher,go.mod: add cigocacher cmd 1 week ago
stunstamp all: rename variables with lowercase-l/uppercase-I 2 weeks ago
sync-containers all: rename variables with lowercase-l/uppercase-I 2 weeks ago
systray client/systray: allow specifying tailscaled socket 4 months ago
tailscale cmd/tailscale/cli: stabilise the output of `tailscale lock status --json` 2 days ago
tailscaled cmd/cigocacher,go.mod: add cigocacher cmd 1 week ago
testcontrol all: use Go 1.22 range-over-int 2 years ago
testwrapper cmd/testwrapper/flakytest: use t.Attr annotation on flaky tests 2 months ago
tl-longchain all: rename variables with lowercase-l/uppercase-I 2 weeks ago
tsconnect types/netmap,*: remove some redundant fields from NetMap 2 weeks ago
tsidp cmd/cigocacher,go.mod: add cigocacher cmd 1 week ago
tsshd all: update copyright and license headers 3 years ago
tta all: use new LocalAPI client package location 10 months ago
vet tailcfg, control/controlclient: start moving MapResponse.DefaultAutoUpdate to a nodeattr 1 week ago
viewer cmd/{cloner,viewer}: handle maps of views 3 weeks ago
vnet cmd/vnet: add wsproxy mode 8 months ago
xdpderper tsweb: split promvarz into an optional dependency 9 months ago