AUTH-1531: Named flags for ssh service tokens
This commit is contained in:
parent
6ca642e572
commit
58e5e9c9a4
|
@ -22,6 +22,12 @@ func ssh(c *cli.Context) error {
|
|||
return cli.ShowCommandHelp(c, "ssh")
|
||||
}
|
||||
headers := buildRequestHeaders(c.StringSlice("header"))
|
||||
if c.IsSet("service-token-id") {
|
||||
headers.Add("CF-Access-Client-Id", c.String("service-token-id"))
|
||||
}
|
||||
if c.IsSet("service-token-secret") {
|
||||
headers.Add("CF-Access-Client-Secret", c.String("service-token-secret"))
|
||||
}
|
||||
|
||||
if c.NArg() > 0 || c.IsSet("url") {
|
||||
localForwarder, err := config.ValidateUrl(c)
|
||||
|
|
|
@ -94,13 +94,26 @@ func Commands() []*cli.Command {
|
|||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "hostname",
|
||||
Usage: "specifics the hostname of your application.",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "url",
|
||||
Usage: "specifics the host:port to forward data to Cloudflare edge.",
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "header",
|
||||
Aliases: []string{"H"},
|
||||
Usage: "specific additional headers you wish to send.",
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "service-token-id",
|
||||
Aliases: []string{"id"},
|
||||
Usage: "specific an Access service token ID you wish to use.",
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "service-token-secret",
|
||||
Aliases: []string{"secret"},
|
||||
Usage: "specific an Access service token secret you wish to use.",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue