diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-10 10:28:07 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-10 10:28:07 +0200 |
| commit | 5f9bbeb509773e5280995b39b44cf9be9c29ece2 (patch) | |
| tree | b5670ea4ef424921407ce1049d0ab2bc235561a9 /LICENSE | |
| parent | be392fe195f8f15dbe263b4c39d609bce95a8615 (diff) | |
| download | abusectl-5f9bbeb509773e5280995b39b44cf9be9c29ece2.tar.gz abusectl-5f9bbeb509773e5280995b39b44cf9be9c29ece2.zip | |
feat: read the reporter identity from config
The reporter's identity is the one identifier this tool discloses
deliberately, so it comes from config only and parse never supplies it. An
empty value is absent, the same rule the rest of the config follows.
Three departures from the plan, each a defect in its code:
A non-string value is REJECTED, not dropped. The plan filtered on
isinstance(value, str), so name = 42 or email = ["a@b"] silently vanished
and read back as not-configured. This file already learned that lesson from
ipaddress.ip_network(42) returning a valid-looking 0.0.0.42/32: a wrong
value that reads as plausible is worse than an error. Dropping the email
would strip the reply address from every report while the user believed
they were identified, so the typo is reported against the file that holds
it, the way a non-string trusted_relays entry already is.
The value is stored STRIPPED. The plan tested value.strip() for truthiness
but stored the original, so name = " A Reporter " reached the From
display name as "From: A Reporter <...>", verbatim and unquoted.
Only the three keys the spec names are carried across, and text_part no
longer subscripts them. Each key is individually skippable and config drops
a skipped one, so a partial identity is the normal shape, yet text_part
read identity['name'] and identity['org'] directly: a config naming only an
email raised KeyError on a case that had parsed perfectly. The "Reported
by:" line is now joined from the parts present, so a missing org leaves no
stray comma. A wholly unconfigured identity still raises in build(); how to
refuse that belongs to the cli task, not here.
The dataclass field defaults to an empty dict rather than editing every
construction site, and the mutable-dict-in-a-frozen-dataclass is left as
is: report only reads it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LByBnw83xr9YP85nskzkyE
Diffstat (limited to 'LICENSE')
0 files changed, 0 insertions, 0 deletions
