mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
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 <danderson@tailscale.com>
This commit is contained in:
parent
3f4d51c588
commit
c0fcab01ac
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user