refactor: remove sensitive info logging even in debug mode

This commit is contained in:
Stavros
2025-01-28 17:36:06 +02:00
parent c54267f50d
commit 3efcb26db1
13 changed files with 58 additions and 58 deletions

View File

@@ -6,6 +6,7 @@ import (
"strings"
"github.com/charmbracelet/huh"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"golang.org/x/crypto/bcrypt"
@@ -21,6 +22,8 @@ var CreateCmd = &cobra.Command{
Short: "Create a user",
Long: `Create a user either interactively or by passing flags.`,
Run: func(cmd *cobra.Command, args []string) {
log.Logger = log.Level(zerolog.InfoLevel)
if interactive {
form := huh.NewForm(
huh.NewGroup(

View File

@@ -8,12 +8,17 @@ import (
)
func UserCmd() *cobra.Command {
// Create the user command
userCmd := &cobra.Command{
Use: "user",
Use: "user",
Short: "User utilities",
Long: `Utilities for creating and verifying tinyauth compatible users.`,
Long: `Utilities for creating and verifying tinyauth compatible users.`,
}
// Add subcommands
userCmd.AddCommand(create.CreateCmd)
userCmd.AddCommand(verify.VerifyCmd)
// Return the user command
return userCmd
}
}

View File

@@ -5,6 +5,7 @@ import (
"strings"
"github.com/charmbracelet/huh"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"golang.org/x/crypto/bcrypt"
@@ -21,6 +22,8 @@ var VerifyCmd = &cobra.Command{
Short: "Verify a user is set up correctly",
Long: `Verify a user is set up correctly meaning that it has a correct username and password.`,
Run: func(cmd *cobra.Command, args []string) {
log.Logger = log.Level(zerolog.InfoLevel)
if interactive {
form := huh.NewForm(
huh.NewGroup(