mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-08 19:38:51 +01:00
refactor: change argument order in GetUserInput
This is a simple change to move the context to the first argument of GetUserInput to match the convention used elsewhere in the code.
This commit is contained in:
parent
839e338dad
commit
84e7605e36
@ -73,7 +73,7 @@ func createInteractivePasswordCallbackPrompt() func() (secret string, err error)
|
||||
QueryText: "Password:",
|
||||
Title: "Password Authentication",
|
||||
}
|
||||
response, err := sstore.MainBus.GetUserInput(request, ctx)
|
||||
response, err := sstore.MainBus.GetUserInput(ctx, request)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@ -133,7 +133,7 @@ func promptChallengeQuestion(question string, echo bool) (answer string, err err
|
||||
QueryText: question,
|
||||
Title: "Keyboard Interactive Authentication",
|
||||
}
|
||||
response, err := sstore.MainBus.GetUserInput(request, ctx)
|
||||
response, err := sstore.MainBus.GetUserInput(ctx, request)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@ -216,7 +216,7 @@ func createUnknownKeyVerifier(knownHostsFile string, hostname string, remote str
|
||||
return func() (*scpacket.UserInputResponsePacketType, error) {
|
||||
ctx, cancelFn := context.WithTimeout(context.Background(), 60*time.Second)
|
||||
defer cancelFn()
|
||||
return sstore.MainBus.GetUserInput(request, ctx)
|
||||
return sstore.MainBus.GetUserInput(ctx, request)
|
||||
}
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ func createMissingKnownHostsVerifier(knownHostsFile string, hostname string, rem
|
||||
return func() (*scpacket.UserInputResponsePacketType, error) {
|
||||
ctx, cancelFn := context.WithTimeout(context.Background(), 60*time.Second)
|
||||
defer cancelFn()
|
||||
return sstore.MainBus.GetUserInput(request, ctx)
|
||||
return sstore.MainBus.GetUserInput(ctx, request)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -316,7 +316,7 @@ func (bus *UpdateBus) GetUserInputChannel(id string) (chan *scpacket.UserInputRe
|
||||
return uich, ok
|
||||
}
|
||||
|
||||
func (bus *UpdateBus) GetUserInput(userInputRequest *UserInputRequestType, ctx context.Context) (*scpacket.UserInputResponsePacketType, error) {
|
||||
func (bus *UpdateBus) GetUserInput(ctx context.Context, userInputRequest *UserInputRequestType) (*scpacket.UserInputResponsePacketType, error) {
|
||||
id, uich := bus.registerUserInputChannel()
|
||||
defer bus.unregisterUserInputChannel(id)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user