fix: remove show password in auth list (#1061)

Signed-off-by: Kay Yan <kay.yan@daocloud.io>
Co-authored-by: Aris Boutselis <arisboutselis08@gmail.com>
This commit is contained in:
Kay Yan
2024-04-16 14:20:20 +08:00
committed by GitHub
parent 9dfcce842e
commit 9e0263778f

View File

@@ -24,7 +24,6 @@ import (
) )
var details bool var details bool
var userInput string
var listCmd = &cobra.Command{ var listCmd = &cobra.Command{
Use: "list", Use: "list",
@@ -39,11 +38,6 @@ var listCmd = &cobra.Command{
os.Exit(1) os.Exit(1)
} }
if details {
fmt.Println("Show password ? (y/n)")
fmt.Scan(&userInput)
}
// Print the default if it is set // Print the default if it is set
fmt.Print(color.YellowString("Default: \n")) fmt.Print(color.YellowString("Default: \n"))
if configAI.DefaultProvider != "" { if configAI.DefaultProvider != "" {
@@ -66,7 +60,7 @@ var listCmd = &cobra.Command{
if details { if details {
for _, provider := range configAI.Providers { for _, provider := range configAI.Providers {
if provider.Name == aiBackend { if provider.Name == aiBackend {
printDetails(provider, userInput) printDetails(provider)
} }
} }
} }
@@ -91,7 +85,7 @@ func init() {
listCmd.Flags().BoolVar(&details, "details", false, "Print active provider configuration details") listCmd.Flags().BoolVar(&details, "details", false, "Print active provider configuration details")
} }
func printDetails(provider ai.AIProvider, userInput string) { func printDetails(provider ai.AIProvider) {
if provider.Model != "" { if provider.Model != "" {
fmt.Printf(" - Model: %s\n", provider.Model) fmt.Printf(" - Model: %s\n", provider.Model)
} }