(connCtx context.Context, question string, echo bool, remoteName string)
| 443 | } |
| 444 | |
| 445 | func promptChallengeQuestion(connCtx context.Context, question string, echo bool, remoteName string) (answer string, err error) { |
| 446 | // limited to 15 seconds for some reason. this should be investigated more |
| 447 | // in the future |
| 448 | ctx, cancelFn := context.WithTimeout(connCtx, 60*time.Second) |
| 449 | defer cancelFn() |
| 450 | queryText := fmt.Sprintf( |
| 451 | "Keyboard Interactive Authentication requested from connection \n"+ |
| 452 | "%s\n\n"+ |
| 453 | "%s", remoteName, question) |
| 454 | request := &userinput.UserInputRequest{ |
| 455 | ResponseType: "text", |
| 456 | QueryText: queryText, |
| 457 | Markdown: true, |
| 458 | Title: "Keyboard Interactive Authentication", |
| 459 | PublicText: echo, |
| 460 | } |
| 461 | response, err := userinput.GetUserInput(ctx, request) |
| 462 | if err != nil { |
| 463 | return "", err |
| 464 | } |
| 465 | return response.Text, nil |
| 466 | } |
| 467 | |
| 468 | func openKnownHostsForEdit(knownHostsFilename string) (*os.File, error) { |
| 469 | path, _ := filepath.Split(knownHostsFilename) |
no test coverage detected