MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / promptChallengeQuestion

Function promptChallengeQuestion

pkg/remote/sshclient.go:445–466  ·  view source on GitHub ↗
(connCtx context.Context, question string, echo bool, remoteName string)

Source from the content-addressed store, hash-verified

443}
444
445func 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
468func openKnownHostsForEdit(knownHostsFilename string) (*os.File, error) {
469 path, _ := filepath.Split(knownHostsFilename)

Calls 1

GetUserInputFunction · 0.92

Tested by

no test coverage detected