Commit graph parsimony/internal/cli/cli_test.go
Author SHA1 Message Date
tgiachi
eccd82af69 feat(cli): escape control characters from mail, refuse the token over plain http
- printable() shows C0, DEL and C1 control characters (except tab and newline; CRLF counts
  as a newline) as \xNN / \uNNNN, applied to every table cell, archive show, member
  listings, import reports and error text, so an escape sequence in a subject cannot
  drive the terminal.
- The client refuses to send the bearer token over http:// to a non-loopback host unless
  --insecure is given: usage error, exit 2. localhost, 127.0.0.0/8 and ::1 stay allowed.
  Offline commands (dkim) never build the client, so they are not affected.
- Tests: the helper, ESC sequences in archive ls/show, held ls, queue ls, list/member names,
  API errors and import reports; the URL check by flag and PARSIMONY_URL. README updated.
2026-11-10 11:57:58 +01:00
tgiachi
bcca031ea3 feat: show who really wrote a held message in the CLI and the UI
- Add SENDER and FROM columns to held ls, flagging a From header that differs from the sender
- Show the From header and a badge in the Held tab; keep the envelope sender visible
2026-11-10 11:40:31 +01:00
tgiachi
afd067688c feat: show failed deliveries in the API, CLI and UI 2026-11-09 20:34:37 +01:00
tgiachi
eb9e915805 fix(security): hold posts whose From header does not match the sender
- Judge membership on the envelope sender and require the From header to name the same address
- Hold mismatches (and missing, unparsable or multiple From addresses) for the admin instead of delivering
- Record why a message was held: new held.reason column, migrated, shown in the API, CLI and UI
- Accept an empty message in the held queue
- Document who may post
2026-11-09 20:23:07 +01:00
tgiachi
7ba07501c3 chore: Go 1.27.3, GPL-3.0-or-later licence, lint and vulnerability checks
- Require Go 1.27.3: fixes the standard library vulnerabilities govulncheck reported
- Add the GPLv3 text and the licence note
- Move shadcn to devDependencies: npm audit finds nothing in production dependencies
- Add make lint (staticcheck) to go-ci and a separate vuln job in CI
- Fix the staticcheck warning in a test
2026-11-09 20:18:57 +01:00
tgiachi
e7cc9cacfb test: close gaps found by mutation checks on DKIM
- Cover headers outside the signed list changing in transit, quoted local parts with @, signing errors and lowercase domains
- Ignore *.pem so a private key is never committed
2026-11-09 20:02:54 +01:00
tgiachi
1e223f1ad1 feat(cli): dkim keygen, record and check
- Create a signing key (mode 0600, never overwritten without --force) and print the DNS record and the config snippet
- Print the record of an existing key, split in DNS-sized strings
- Check that DNS publishes the key that matches the private key file
- Work offline of the API: no token needed
2026-11-09 20:01:36 +01:00
tgiachi
a170204ecb test: close gaps found by mutation checks on the archive import
- Cover the CRLF separator line, cycle roots entered from outside, linear rethreading of long chains
- Cover a read error mid-import, the "and N more" lines, and the mbox content type
- Cover clearing the previous result and the capped error list in the UI
2026-11-09 19:50:40 +01:00
tgiachi
cc47784fdb feat(cli): archive import from a file or stdin
- Add parsimony archive import <list> <file|->, streaming with no overall timeout
- Print imported, already present and failed counts; report failing messages and exit 1
- Support --json
2026-11-09 17:15:43 +01:00
tgiachi
2d8b0ccce6 feat(cli): command-line client for administration
- Add parsimony list, member, held, archive and queue subcommands over the REST API
- Read the token only from PARSIMONY_API_TOKEN; take the URL from --url or PARSIMONY_URL
- Print tables by default and JSON with --json
- Add member import from a file or stdin, reporting failing lines and exiting non-zero
- Require --yes for destructive commands
- Add parsimony serve; keep the old -config invocation working
- Run the CLI inside the container in the end-to-end test
- Test every command against the real API handler; mutation checks over the CLI
2026-11-09 16:57:25 +01:00