The ban ledger as "Bans" and "Persistent state" in SPEC.md give it, the part the first stage of the build order still lacks, and which the ban endpoints of #27 build on. One PR to next.
Causes: limit, attack and admin (crowdsec comes with its feed). An entry an admin adds to bans.json without a cause gets admin, and is written back so; any other cause is refused as now. The ban notes' earlier_bans count admin in place of without_cause.
A ban whose cause is admin is never dropped and does not count toward SWWAF_MAX_BANS; an admin keeps a ban smallwebwaf made by setting its cause to admin.
reason: a short text per entry. smallwebwaf sets it on the bans it makes (the limit broken, or the rule id); an admin's entry keeps what the admin wrote.
lifted: when an admin lifted the ban. An admin lifts a ban by setting it in bans.json; a lifted ban refuses nothing, is kept, and does not count toward a longer ban. Deleting the entry still forgets it.
Metrics count bans created with the cause admin too.
README.md shows adding, keeping and lifting a ban by editing bans.json.
Pre-1.0: no migration for a bans.json written by an earlier build.
Definition of done: tests show an admin's entry without a cause taken in as admin; admin bans never dropped and not counted toward SWWAF_MAX_BANS while bans smallwebwaf made are dropped; reason set and kept; a lifted ban refusing nothing, kept, and not counting toward a longer ban, both from the file at start and from an edit while running; each test failing with its rule broken; make check green; one PR to next, passed by a reviewer who did not write it.
Model: opus-5-5
The ban ledger as "Bans" and "Persistent state" in `SPEC.md` give it, the part the first stage of the build order still lacks, and which the ban endpoints of https://git.eeqj.de/sneak/smallwebwaf/issues/27 build on. One PR to `next`.
- Causes: `limit`, `attack` and `admin` (`crowdsec` comes with its feed). An entry an admin adds to `bans.json` without a cause gets `admin`, and is written back so; any other cause is refused as now. The ban notes' `earlier_bans` count `admin` in place of `without_cause`.
- A ban whose cause is `admin` is never dropped and does not count toward `SWWAF_MAX_BANS`; an admin keeps a ban `smallwebwaf` made by setting its cause to `admin`.
- `reason`: a short text per entry. `smallwebwaf` sets it on the bans it makes (the limit broken, or the rule id); an admin's entry keeps what the admin wrote.
- `lifted`: when an admin lifted the ban. An admin lifts a ban by setting it in `bans.json`; a lifted ban refuses nothing, is kept, and does not count toward a longer ban. Deleting the entry still forgets it.
- Metrics count bans created with the cause `admin` too.
- `README.md` shows adding, keeping and lifting a ban by editing `bans.json`.
Pre-1.0: no migration for a `bans.json` written by an earlier build.
Definition of done: tests show an admin's entry without a cause taken in as `admin`; `admin` bans never dropped and not counted toward `SWWAF_MAX_BANS` while bans `smallwebwaf` made are dropped; `reason` set and kept; a lifted ban refusing nothing, kept, and not counting toward a longer ban, both from the file at start and from an edit while running; each test failing with its rule broken; `make check` green; one PR to `next`, passed by a reviewer who did not write it.
Model: opus-5-5
clawbot
self-assigned this 2026-10-06 20:40:39 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The ban ledger as "Bans" and "Persistent state" in
SPEC.mdgive it, the part the first stage of the build order still lacks, and which the ban endpoints of #27 build on. One PR tonext.limit,attackandadmin(crowdseccomes with its feed). An entry an admin adds tobans.jsonwithout a cause getsadmin, and is written back so; any other cause is refused as now. The ban notes'earlier_banscountadminin place ofwithout_cause.adminis never dropped and does not count towardSWWAF_MAX_BANS; an admin keeps a bansmallwebwafmade by setting its cause toadmin.reason: a short text per entry.smallwebwafsets it on the bans it makes (the limit broken, or the rule id); an admin's entry keeps what the admin wrote.lifted: when an admin lifted the ban. An admin lifts a ban by setting it inbans.json; a lifted ban refuses nothing, is kept, and does not count toward a longer ban. Deleting the entry still forgets it.admintoo.README.mdshows adding, keeping and lifting a ban by editingbans.json.Pre-1.0: no migration for a
bans.jsonwritten by an earlier build.Definition of done: tests show an admin's entry without a cause taken in as
admin;adminbans never dropped and not counted towardSWWAF_MAX_BANSwhile banssmallwebwafmade are dropped;reasonset and kept; a lifted ban refusing nothing, kept, and not counting toward a longer ban, both from the file at start and from an edit while running; each test failing with its rule broken;make checkgreen; one PR tonext, passed by a reviewer who did not write it.Model: opus-5-5
Implemented in #88, for review.
Model: opus-5-5