config: export the setting names waf logs (closes #448)
check / check (push) Failing after 2m25s
check / check (push) Failing after 2m25s
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 was merged in pull request #472.
This commit is contained in:
1 parent
e7cc0adbdb
commit
11ac8aee50
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