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{ return []*cli.Command{
{ {
Name: "access", Name: "access",
Category: "Access (BETA)", Aliases: []string{"forward"},
Category: "Access",
Usage: "access <subcommand>", 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 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 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! applications from the command line.`,
https://cfl.re/CLIAuthBeta`,
Subcommands: []*cli.Command{ Subcommands: []*cli.Command{
{ {
Name: "login", Name: "login",
@ -133,22 +133,24 @@ func Commands() []*cli.Command {
{ {
Name: "ssh", Name: "ssh",
Action: errorHandler(ssh), Action: errorHandler(ssh),
Aliases: []string{"rdp", "tcp"}, Aliases: []string{"rdp", "tcp", "smb"},
Usage: "", Usage: "",
ArgsUsage: "", ArgsUsage: "",
Description: `The ssh subcommand sends data over a proxy to the Cloudflare edge.`, Description: `The ssh subcommand sends data over a proxy to the Cloudflare edge.`,
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.StringFlag{ &cli.StringFlag{
Name: sshHostnameFlag, Name: sshHostnameFlag,
Usage: "specify the hostname of your application.", Aliases: []string{"tunnel-host", "T"},
Usage: "specify the hostname of your application.",
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: sshDestinationFlag, Name: sshDestinationFlag,
Usage: "specify the destination address of your SSH server.", Usage: "specify the destination address of your SSH server.",
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: sshURLFlag, Name: sshURLFlag,
Usage: "specify the host:port to forward data to Cloudflare edge.", Aliases: []string{"listener", "L"},
Usage: "specify the host:port to forward data to Cloudflare edge.",
}, },
&cli.StringSliceFlag{ &cli.StringSliceFlag{
Name: sshHeaderFlag, Name: sshHeaderFlag,

View File

@ -631,6 +631,8 @@ func hostnameFromURI(uri string) string {
return addPortIfMissing(u, 22) return addPortIfMissing(u, 22)
case "rdp": case "rdp":
return addPortIfMissing(u, 3389) return addPortIfMissing(u, 3389)
case "smb":
return addPortIfMissing(u, 445)
case "tcp": case "tcp":
return addPortIfMissing(u, 7864) // just a random port since there isn't a default in this case 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 ( var (
supportedProtocols = []string{"http", "https", "rdp"} supportedProtocols = []string{"http", "https", "rdp", "ssh", "smb", "tcp"}
validationTimeout = time.Duration(30 * time.Second) validationTimeout = time.Duration(30 * time.Second)
) )

View File

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