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:
Sylvia Crowe 2024-02-07 17:01:35 -08:00
parent 839e338dad
commit 84e7605e36
2 changed files with 5 additions and 5 deletions

View File

@ -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)
}
}

View File

@ -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)