From c0fcab01ac27bd6674d9119bee1199c992d17a04 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 13 Dec 2022 13:31:21 -0800 Subject: [PATCH] client/tailscale: fix request object for key creation. The request takes key capabilities as an argument, but wrapped in a parent object. Signed-off-by: David Anderson --- client/tailscale/keys.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/tailscale/keys.go b/client/tailscale/keys.go index ddd0c94fe..1713182ef 100644 --- a/client/tailscale/keys.go +++ b/client/tailscale/keys.go @@ -72,7 +72,10 @@ func (c *Client) Keys(ctx context.Context) ([]string, error) { // can be created. Returns the key itself, which cannot be retrieved again // later, and the key metadata. func (c *Client) CreateKey(ctx context.Context, caps KeyCapabilities) (string, *Key, error) { - bs, err := json.Marshal(caps) + keyRequest := struct { + Capabilities KeyCapabilities `json:"capabilities"` + }{caps} + bs, err := json.Marshal(keyRequest) if err != nil { return "", nil, err }