You've already forked step-ca-cli
mirror of
https://github.com/smallstep/cli.git
synced 2025-08-09 03:22:43 +03:00
Add console flag to ssh commands
This commit adds the `--console` flag to the following commands: * `step ssh certificate` * `step ssh config` * `step ssh hosts` * `step ssh login` * `step ssh proxycommand`
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package oauth
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"crypto/x509"
|
||||
@@ -901,11 +900,9 @@ func (o *oauth) DoDeviceAuthorization() (*token, error) {
|
||||
idr.Interval = defaultDeviceAuthzInterval
|
||||
}
|
||||
|
||||
fmt.Fprintf(os.Stderr, "Visit %s and enter the code: (press 'ENTER' to open default browser)\n", idr.VerificationURI)
|
||||
fmt.Fprintf(os.Stderr, "Visit %s and enter the code:\n", idr.VerificationURI)
|
||||
fmt.Fprintln(os.Stderr, idr.UserCode)
|
||||
|
||||
go openBrowserIfAsked(o, idr.VerificationURI)
|
||||
|
||||
// Poll the Token endpoint until the user completes the flow.
|
||||
data = url.Values{}
|
||||
data.Set("client_id", o.clientID)
|
||||
@@ -939,13 +936,6 @@ func (o *oauth) DoDeviceAuthorization() (*token, error) {
|
||||
}
|
||||
}
|
||||
|
||||
func openBrowserIfAsked(o *oauth, u string) {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
reader.ReadString('\n')
|
||||
|
||||
exec.OpenInBrowser(u, o.browser)
|
||||
}
|
||||
|
||||
var errHTTPToken = errors.New("bad request; token not returned")
|
||||
|
||||
func (o *oauth) deviceAuthzTokenPoll(data url.Values) (*token, error) {
|
||||
|
Reference in New Issue
Block a user