Files
openwaf/scripts
Pavlo Ratushnyi dbf3c725e6 an operator block can now be time-boxed, on the wire and on the page
The model always had it: BlockEntry.ExpiresAt, DecisionEngine asking IsLive
before honouring a row, and the listing printing the column since OPEN-28.
What did not exist was a way to set it — AddOperatorAsync wrote ExpiresAt =
null for every operator block, and NewBlockRequest had no field for it. So
"block this for the night" meant "block this, and remember to delete it in
the morning", while the exemption form beside it already had a minutes box.

POST /admin-api/blocks now takes expiresInMinutes with the same 1..5,256,000
bound and the same rule as the exemption's field: present sets the expiry,
absent means the block stands until someone takes it off. Re-blocking an
address that already carries an expiry moves it, because the second call
means its own duration from now. 0 and 5,256,001 are a 400 naming the field
rather than a permanent block bought by a zero in a box. The console gets the
minutes input and refuses a zero before the round trip.

Measured on this tree: build 0 warnings / 0 errors, unit 132/132, integration
185/185 in 19 s (4 new: the expiry lands and the listing says so; 0, -10 and
5,256,001 refused by name with nothing written and the address still itself;
a block past its expiry stops being enforced while a second blocked address
stays blocked and the dead row shows as expired rather than vanishing; a
second POST moves the expiry), smoke 28/0, console 78 assertions 0 failed.
The console gate run also printed the row it wrote: expiry cell
"2026-10-04 15:05:37" against a permanent block's empty one.
2026-10-04 16:08:37 +02:00
..