mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2026-02-04 08:18:34 +00:00
feat(BRIDGE-424): FIDO2 GUI support.
This commit is contained in:
@ -45,6 +45,11 @@ func (f *frontendCLI) yesNoQuestion(question string) bool {
|
||||
return len(answer) > 0 // Empty is false.
|
||||
}
|
||||
|
||||
func (f *frontendCLI) PromptAndWaitReturn(prompt string) {
|
||||
f.Print(prompt, ". Press Enter/Return to continue: ")
|
||||
f.ReadLine()
|
||||
}
|
||||
|
||||
func (f *frontendCLI) readStringInAttempts(title string, readFunc func() string, isOK func(string) bool) (value string) {
|
||||
f.Printf("%s: ", title)
|
||||
value = readFunc()
|
||||
@ -60,6 +65,10 @@ func (f *frontendCLI) readStringInAttempts(title string, readFunc func() string,
|
||||
return
|
||||
}
|
||||
|
||||
func (f *frontendCLI) ReadSecurityKeyPin() string {
|
||||
return f.readStringInAttempts("Security key PIN", f.ReadPassword, isNotEmpty)
|
||||
}
|
||||
|
||||
func (f *frontendCLI) printAndLogError(args ...interface{}) {
|
||||
log.Error(args...)
|
||||
f.Println(args...)
|
||||
@ -110,15 +119,3 @@ Recommendation:
|
||||
a different network to access Proton Mail.
|
||||
`)
|
||||
}
|
||||
|
||||
func sliceAnyToByteArray(s []any) []byte {
|
||||
result := make([]byte, len(s))
|
||||
for i, val := range s {
|
||||
if intVal, ok := val.(float64); ok {
|
||||
result[i] = byte(intVal)
|
||||
} else {
|
||||
panic("boom")
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user