config: export the setting names waf logs (closes #448)
check / check (push) Failing after 1m46s
check / check (push) Failing after 1m46s
waf wrote eight setting names as string literals into log lines and ban notes, and config wrote each again where it reads the setting. A rename that missed one would log a setting that does not exist. config now exports a constant for each name, used by its reader and by waf. Model: opus-5-5
This commit is contained in:
1 parent
967ccdf75e
commit
8035fddcbd
3 files changed
+40
-25
No files matched your search
@@ -7,6 +7,7 @@ import (
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
"sneak.berlin/go/smallwebwaf/internal/config"
|
||||
"sneak.berlin/go/smallwebwaf/internal/requestlog"
|
||||
)
|
||||
|
||||
@@ -33,7 +34,8 @@ func (countries) check(
|
||||
return &verdict{
|
||||
action: requestlog.ActionCountryDenied,
|
||||
figures: map[string]any{
|
||||
"country": country, "setting": "SWW_WAF_EXCLUSIVELY_ALLOWED_COUNTRIES",
|
||||
"country": country,
|
||||
"setting": config.ExclusivelyAllowedCountriesSetting,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user