mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-30 01:17:21 +02:00
cmd/pomerium-cli: do not require terminal with cached creds (#1196)
This commit is contained in:
parent
fa43db80c1
commit
a555e5fcc3
1 changed files with 5 additions and 4 deletions
|
@ -47,10 +47,6 @@ var kubernetesCmd = &cobra.Command{
|
||||||
var kubernetesExecCredentialCmd = &cobra.Command{
|
var kubernetesExecCredentialCmd = &cobra.Command{
|
||||||
Use: "exec-credential",
|
Use: "exec-credential",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
if !terminal.IsTerminal(int(os.Stdin.Fd())) {
|
|
||||||
return fmt.Errorf("only interactive sessions are supported")
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(args) < 1 {
|
if len(args) < 1 {
|
||||||
return fmt.Errorf("server url is required")
|
return fmt.Errorf("server url is required")
|
||||||
}
|
}
|
||||||
|
@ -66,6 +62,11 @@ var kubernetesExecCredentialCmd = &cobra.Command{
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// require interactive session to handle login
|
||||||
|
if !terminal.IsTerminal(int(os.Stdin.Fd())) {
|
||||||
|
return fmt.Errorf("only interactive sessions are supported")
|
||||||
|
}
|
||||||
|
|
||||||
li, err := net.Listen("tcp", "127.0.0.1:0")
|
li, err := net.Listen("tcp", "127.0.0.1:0")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatalf("failed to start listener: %v", err)
|
fatalf("failed to start listener: %v", err)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue