Skip to content

Commit

Permalink
fkx
Browse files Browse the repository at this point in the history
  • Loading branch information
LordofAvernus committed Jan 24, 2025
1 parent 8c0b2a2 commit dd73085
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion sqle/driver/mysql/rule/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func AddResult(result *driverV2.AuditResults, currentRule driverV2.Rule, ruleNam
return
}
level := currentRule.Level
message := RuleHandlerMap[ruleName].Message
message := GetAllRule()[ruleName].Message
result.Add(level, ruleName, plocale.Bundle.LocalizeAll(message), args...)
}

Expand Down Expand Up @@ -312,6 +312,17 @@ var (
AIRuleHandlerMap = map[string]RuleHandler{}
)

func GetAllRule() map[string]RuleHandler {
allRuleHandlerMap := make(map[string]RuleHandler, len(AIRuleHandlerMap)+len(RuleHandlerMap))
for ruleName, aiHandler := range AIRuleHandlerMap {
RuleHandlerMap[ruleName] = aiHandler
}
for ruleName, ruleHandler := range RuleHandlerMap {
allRuleHandlerMap[ruleName] = ruleHandler
}
return allRuleHandlerMap
}

const DefaultSingleParamKeyName = "first_key" // For most of the rules, it is just has one param, this is first params.

const (
Expand Down

0 comments on commit dd73085

Please sign in to comment.