bans: one ledger method makes a request's ban, one place decides observe mode (closes #444)
check / check (push) Failing after 1m42s
check / check (push) Failing after 1m42s
The ledger's BanForLimit, WouldBanForLimit, BanForAttack and WouldBanForAttack become Ban and WouldBan, which take the cause and the notes in one bans.Grounds. The waf's banForLimit and banForAttack fill in what differs and call banClient, the one function that tests observe mode on the way to a ban. Behaviour is unchanged; tests change only where they called the four methods. Model: opus-5-5
This commit is contained in:
1 parent
967ccdf75e
commit
035edf26e8
10 files changed
+392
-261
No files matched your search
@@ -130,11 +130,9 @@ func TestObserveModeRaisesTheBanAlertsItWouldHave(t *testing.T) {
|
||||
// A ban for a clear sign of attack, which a request under it would make
|
||||
// permanent.
|
||||
group := netip.MustParsePrefix(ipv6Group)
|
||||
attackBan, _ := server.Ledger.BanForAttack(
|
||||
group,
|
||||
start,
|
||||
bans.Notes{RuleID: "probe"},
|
||||
)
|
||||
attackBan, _ := server.Ledger.Ban(group, start, bans.Grounds{
|
||||
Cause: bans.CauseAttack, Notes: bans.Notes{RuleID: "probe"},
|
||||
})
|
||||
|
||||
// The third request breaks the limit, and so does the fourth, within the
|
||||
// cooldown, which raises nothing. The probe is a clear sign of attack.
|
||||
|
||||
Reference in new issue
Block a user