From 8988d4fc200850c331b91ace1bbfd2cfd2eed0d7 Mon Sep 17 00:00:00 2001 From: max furman Date: Wed, 20 Nov 2019 14:29:40 -0800 Subject: [PATCH] get-hosts -> hosts * pass nil arg to offline as a fill-in for now --- command/ssh/getHosts.go | 14 +++++++------- command/ssh/ssh.go | 2 +- utils/cautils/offline.go | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/command/ssh/getHosts.go b/command/ssh/getHosts.go index c315d976..644e2489 100644 --- a/command/ssh/getHosts.go +++ b/command/ssh/getHosts.go @@ -10,13 +10,13 @@ import ( "github.com/urfave/cli" ) -func getHostsCommand() cli.Command { +func hostsCommand() cli.Command { return cli.Command{ - Name: "get-hosts", - Action: command.ActionFunc(getHostsAction), + Name: "hosts", + Action: command.ActionFunc(hostsAction), Usage: "returns a list of all valid hosts", - UsageText: `**step ssh get-hosts**`, - Description: `**step ssh get-hosts** returns a list of valid hosts for SSH. + UsageText: `**step ssh hosts**`, + Description: `**step ssh hosts** returns a list of valid hosts for SSH. This command returns a zero exit status then the server exists, it will return 1 otherwise. @@ -27,7 +27,7 @@ otherwise. Get a list of valid hosts for SSH: ''' -$ step ssh get-hosts +$ step ssh hosts '''`, Flags: []cli.Flag{ flags.CaURL, @@ -38,7 +38,7 @@ $ step ssh get-hosts } } -func getHostsAction(ctx *cli.Context) error { +func hostsAction(ctx *cli.Context) error { if err := errs.NumberOfArguments(ctx, 0); err != nil { return err } diff --git a/command/ssh/ssh.go b/command/ssh/ssh.go index bee3de52..9a5f95d9 100644 --- a/command/ssh/ssh.go +++ b/command/ssh/ssh.go @@ -50,7 +50,7 @@ $ step ssh certificate --host internal.example.com ssh_host_ecdsa_key proxyCommand(), proxycommandCommand(), checkHostCommand(), - getHostsCommand(), + hostsCommand(), renewCommand(), revokeCommand(), rekeyCommand(), diff --git a/utils/cautils/offline.go b/utils/cautils/offline.go index 0f93edda..ca748368 100644 --- a/utils/cautils/offline.go +++ b/utils/cautils/offline.go @@ -411,7 +411,7 @@ func (c *OfflineCA) SSHCheckHost(principal string) (*api.SSHCheckPrincipalRespon // SSHGetHosts is a wrapper on top of the CheckSSHHost method. It returns an // api.SSHCheckPrincipalResponse. func (c *OfflineCA) SSHGetHosts() (*api.SSHGetHostsResponse, error) { - hosts, err := c.authority.GetSSHHosts() + hosts, err := c.authority.GetSSHHosts(nil) if err != nil { return nil, err }