refactor: Sanitize log inputs in mcp_service, duckduckgo, auth, faq, message, and model handlers to enhance security

This commit is contained in:
wizardchen
2025-11-26 00:57:33 +08:00
parent 9fc6c949e5
commit 8e3c2d8547
6 changed files with 19 additions and 14 deletions
+3 -1
View File
@@ -10,6 +10,7 @@ import (
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
secutils "github.com/Tencent/WeKnora/internal/utils"
)
// AuthHandler implements HTTP request handlers for user authentication
@@ -58,7 +59,8 @@ func (h *AuthHandler) Register(c *gin.Context) {
c.Error(appErr)
return
}
req.Username = secutils.SanitizeForLog(req.Username)
req.Email = secutils.SanitizeForLog(req.Email)
// Call service to register user
user, err := h.userService.Register(ctx, &req)
if err != nil {