feat: make all operational constants configurable via bouncer.toml
Replace hardcoded values across network, captcha, email, and cert modules with BouncerConfig fields. All values have safe defaults and are overridable in the [bouncer] section of the config file. Configurable: probation_seconds, backoff_steps, nick_timeout, rejoin_delay, http_timeout, captcha_poll_interval/timeout, email_poll_interval/max_polls/request_timeout, cert_validity_days. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,15 @@ class TestGenerateCert:
|
||||
assert pem1 == pem2
|
||||
assert fp1 != fp2 # New cert = new fingerprint
|
||||
|
||||
def test_custom_validity_days(self, data_dir: Path) -> None:
|
||||
import datetime
|
||||
from cryptography import x509 as x509_mod
|
||||
pem = generate_cert(data_dir, "libera", "testnick", validity_days=365)
|
||||
cert_data = pem.read_bytes()
|
||||
cert_obj = x509_mod.load_pem_x509_certificate(cert_data)
|
||||
delta = cert_obj.not_valid_after_utc - cert_obj.not_valid_before_utc
|
||||
assert 364 <= delta.days <= 366
|
||||
|
||||
|
||||
class TestFingerprint:
|
||||
def test_format(self, data_dir: Path) -> None:
|
||||
|
||||
Reference in New Issue
Block a user