S010: logins, cookies, proxies, sites and certificates

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-25 05:58:23 -06:00
commit c09ea494b7

View file

@ -106,5 +106,15 @@ Verified: `--test relink` (13 tests, 5 runs), `--lib`, `http`, `manager`, `recov
- Adopt: `manager.check_partial(path, NewLink) -> Reply<Found>` (`partial.name`, `partial.bytes()`, `checked`), then `Command::Adopt { task, found }`. The other program's file is copied (a reflink where the disk can) and never changed.
Not done: only aria2's list is read, written from its manual from memory and never tried on a file aria2 made (not installed here); other managers' files count from the start until the first difference. Chrome's and Firefox's files are simulated. Old keyring items are not deleted (S010 told). Checks with logins and proxies come with S010's commit. Boxes were ticked together at the end, against rule 3.
## S010 — Logins, cookies and proxies (2026-11-25)
Done: `core::{auth, cookie, proxy, secret, site, tls}`; `http` follows redirects itself. Choices: D-037 to D-039. Outside the plan's files: settings `sites`, `proxy`, `proxy_bypass`; `Bus::Session`; `ErrorKind::Proxy`; `error` (TLS and proxy reasons); `manager` (`Config::sites`).
Verified: `--test auth` green (21: redirect leaks, store, logs and arguments searched for secrets, fake Secret Service and portal on a private D-Bus, stub proxies, certificates); all of core green; clippy clean for the new code.
- The app must make one `Sites::new(ClientOptions, &settings, Arc::new(Secrets::new(Bus::Session)), Bus::Session)` (not on the window's thread), set `config.sites`, and call `sites.set(&settings)` after changes. Without it: no logins, no proxies.
- `Site` (in `settings.sites`): `pattern`, `secret`, `max_connections`, `speed_limit`, `user_agent`, `proxy`, `folder`, `certificate`. `sites.rules(&url)` is what counts for a link: `folder` is for the Add dialog, `speed_limit` for S009.
- `secrets.save(name, host label, &Secret{home, login, cookies, headers}) -> Kept`; show `Kept::words()` when there are any. Put `name` in `Site::secret` or `Task::secret`; a task's secret needs `home` = its link. `auth::take_login(link)` takes a login out of a link before it is stored. `sites.save_proxy_login(proxy, login)`.
- A proxy is `system`, `direct`, `http://…`, `https://…` or `socks5://…`. `sites.trust.refused(host)` is the certificate to put in `Site::certificate` when the user says so.
Not done: the exception shows a fingerprint only (no issuer or dates); proxies that ask for anything but a plain login; FTP logins; connections of a host are still first come, first served. Never tried against the real keyring, portal, servers or proxies.
Seen: until fixed, a test's `dbus-daemon --session` started real services from the system's list (gnome-keyring's starter found the running one and ended; portal, gvfs). No secret was read or written, nothing was left over. `auth.rs` has a bus without services; `recover.rs` still has the old one, but asks for no such names. Boxes were ticked together at the end, against rule 3.
## Later
-