refactor: Sanitize log inputs across various handlers to enhance security
- Implemented input sanitization for logging in chunk, evaluation, initialization, knowledge, knowledgebase, mcp_service, model, tenant, and session handlers. - Updated logging statements to use sanitized values for sensitive information, preventing potential injection attacks.
This commit is contained in:
@@ -140,8 +140,8 @@ func Auth(tenantService interfaces.TenantService, userService interfaces.UserSer
|
||||
}
|
||||
|
||||
// GetTenantIDFromContext helper function to get tenant ID from context
|
||||
func GetTenantIDFromContext(ctx context.Context) (uint, error) {
|
||||
tenantID, ok := ctx.Value("tenantID").(uint)
|
||||
func GetTenantIDFromContext(ctx context.Context) (uint64, error) {
|
||||
tenantID, ok := ctx.Value("tenantID").(uint64)
|
||||
if !ok {
|
||||
return 0, errors.New("tenant ID not found in context")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user