check / check (push) Failing after 2m23s
sneak ruled to remove it. Gone: the heuristic crowdsec, the ban cause crowdsec and its earlier_bans count, the tag crowdsec, the settings SWW_WAF_CROWDSEC_LAPI_URL and SWW_WAF_CROWDSEC_LAPI_KEY, the decision list fetch and parse in internal/reputation, their tests, and every mention in the README, SPEC.md and docs/. EVALUATION.md keeps its comparison of tools. The ban ledger's internal ban function loses its expires parameter, which only CrowdSec bans used. Model: opus-5-5
34 lines
925 B
Go
34 lines
925 B
Go
package reputation
|
|
|
|
import (
|
|
"context"
|
|
"net"
|
|
"net/http"
|
|
"net/netip"
|
|
)
|
|
|
|
// SetTransport has l's fetches go through transport instead of the
|
|
// network.
|
|
func (l *Lists) SetTransport(transport http.RoundTripper) {
|
|
l.httpClient.Transport = transport
|
|
}
|
|
|
|
// SetTransport has a's checks go through transport instead of the
|
|
// network.
|
|
func (a *AbuseIPDB) SetTransport(transport http.RoundTripper) {
|
|
a.httpClient.Transport = transport
|
|
}
|
|
|
|
// SetDial has d's queries go through dial instead of the network.
|
|
func (d *DNSBL) SetDial(
|
|
dial func(ctx context.Context, network, address string) (net.Conn, error),
|
|
) {
|
|
d.resolver = &net.Resolver{PreferGo: true, Dial: dial}
|
|
}
|
|
|
|
// LookUp asks zone about addr at once, as a query in the background does,
|
|
// and returns whether zone lists addr.
|
|
func (d *DNSBL) LookUp(zone string, addr netip.Addr) (bool, error) {
|
|
return d.lookUp(context.Background(), query{zone: zone, client: addr})
|
|
}
|