Rename the settings whose names do not say what they control (closes #234)
check / check (push) Waiting to run

Applies the setting renames of the naming audit under the SWW_WAF_ and
SWW_RPROXY_ prefixes, with sneak's names for the IP reputation cache
time and the two time limits, which now take milliseconds. The rproxy
log field default_disposition becomes waf_backend_no_answer, and
config.Config and config.FromEnvironment become config.WAF and
config.WAFFromEnvironment. Go fields, test names and prose follow. No
aliases; nothing reads the old names.

Model: opus-5-5
This commit is contained in:
clawbot committed 2026-11-12 09:48:09 +00:00
1 parent 3304beca46
commit 4d4ae61abf
100 files changed
+2261 -2019

No files matched your search

+7 -7
View File
@@ -37,7 +37,7 @@ const (
ScopeASN = "asn"
// ScopeTotal is the whole service.
ScopeTotal = "total"
// ScopeWatchedNet is a named netblock of SWW_WAF_WATCH_NETS.
// ScopeWatchedNet is a named netblock of SWW_WAF_ANOMALY_WATCHED_NETS.
ScopeWatchedNet = "watched_net"
)
@@ -68,7 +68,7 @@ type Thresholds struct {
BytesPerHour int64
}
// NamedNetblock is a netblock SWW_WAF_WATCH_NETS names.
// NamedNetblock is a netblock SWW_WAF_ANOMALY_WATCHED_NETS names.
type NamedNetblock struct {
Name string
Netblock netip.Prefix
@@ -78,12 +78,12 @@ type NamedNetblock struct {
type Params struct {
// The thresholds of each scope: SWW_WAF_ANOMALY_CLIENT_*,
// SWW_WAF_ANOMALY_NET_*, SWW_WAF_ANOMALY_ASN_*, SWW_WAF_ANOMALY_TOTAL_* and
// SWW_WAF_WATCH_*.
Client, Net, ASN, Total, Watch Thresholds
// SWW_WAF_ANOMALY_WATCHED_NET_*.
Client, Net, ASN, Total, WatchedNet Thresholds
// NetV4Prefix and NetV6Prefix are the lengths of the netblock around a
// client (SWW_WAF_ANOMALY_NET_V4_PREFIX and SWW_WAF_ANOMALY_NET_V6_PREFIX).
NetV4Prefix, NetV6Prefix int
// NamedNetblocks are SWW_WAF_WATCH_NETS.
// NamedNetblocks are SWW_WAF_ANOMALY_WATCHED_NETS.
NamedNetblocks []NamedNetblock
// Alerts receive the anomaly alerts.
Alerts *alerts.Queue
@@ -119,7 +119,7 @@ type Request struct {
// ASN, ASName and Country are the client's as looked up, each "" when
// unknown.
ASN, ASName, Country string
// Bytes are the request's bytes, as SWW_WAF_BYTES_COUNT counts them.
// Bytes are the request's bytes, as SWW_WAF_BYTES_COUNTED counts them.
Bytes int64
}
@@ -271,7 +271,7 @@ func (c *Counters) scopesOf(r Request) []scope {
scope: ScopeWatchedNet,
netblock: named.Netblock,
name: named.Name,
}, p.Watch,
}, p.WatchedNet,
})
}
}