AUTH-2505 added aliases

This commit is contained in:
Dalton 2020-05-13 13:53:31 -05:00
parent 83a1dc93d8
commit 8c870c19a6
4 changed files with 15 additions and 11 deletions

View File

@ -85,13 +85,13 @@ func Commands() []*cli.Command {
return []*cli.Command{
{
Name: "access",
Category: "Access (BETA)",
Aliases: []string{"forward"},
Category: "Access",
Usage: "access <subcommand>",
Description: `(BETA) Cloudflare Access protects internal resources by securing, authenticating and monitoring access
Description: `Cloudflare Access protects internal resources by securing, authenticating and monitoring access
per-user and by application. With Cloudflare Access, only authenticated users with the required permissions are
able to reach sensitive resources. The commands provided here allow you to interact with Access protected
applications from the command line. This feature is considered beta. Your feedback is greatly appreciated!
https://cfl.re/CLIAuthBeta`,
applications from the command line.`,
Subcommands: []*cli.Command{
{
Name: "login",
@ -133,22 +133,24 @@ func Commands() []*cli.Command {
{
Name: "ssh",
Action: errorHandler(ssh),
Aliases: []string{"rdp", "tcp"},
Aliases: []string{"rdp", "tcp", "smb"},
Usage: "",
ArgsUsage: "",
Description: `The ssh subcommand sends data over a proxy to the Cloudflare edge.`,
Flags: []cli.Flag{
&cli.StringFlag{
Name: sshHostnameFlag,
Usage: "specify the hostname of your application.",
Name: sshHostnameFlag,
Aliases: []string{"tunnel-host", "T"},
Usage: "specify the hostname of your application.",
},
&cli.StringFlag{
Name: sshDestinationFlag,
Usage: "specify the destination address of your SSH server.",
},
&cli.StringFlag{
Name: sshURLFlag,
Usage: "specify the host:port to forward data to Cloudflare edge.",
Name: sshURLFlag,
Aliases: []string{"listener", "L"},
Usage: "specify the host:port to forward data to Cloudflare edge.",
},
&cli.StringSliceFlag{
Name: sshHeaderFlag,

View File

@ -631,6 +631,8 @@ func hostnameFromURI(uri string) string {
return addPortIfMissing(u, 22)
case "rdp":
return addPortIfMissing(u, 3389)
case "smb":
return addPortIfMissing(u, 445)
case "tcp":
return addPortIfMissing(u, 7864) // just a random port since there isn't a default in this case
}

View File

@ -23,7 +23,7 @@ const (
)
var (
supportedProtocols = []string{"http", "https", "rdp"}
supportedProtocols = []string{"http", "https", "rdp", "ssh", "smb", "tcp"}
validationTimeout = time.Duration(30 * time.Second)
)

View File

@ -308,7 +308,7 @@ func TestNewAccessValidatorErr(t *testing.T) {
urls := []string{
"",
"tcp://test.cloudflareaccess.com",
"ftp://test.cloudflareaccess.com",
"wss://cloudflarenone.com",
}