S010: logins, cookies, proxies, sites and certificates
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
parent
6bdbd20e10
commit
c09ea494b7
3 changed files with 2358 additions and 62 deletions
|
|
@ -36,3 +36,6 @@
|
|||
- D-034 — 2026-11-25 — A new link is judged by size, versions and bytes: the last 4096 bytes of up to 32 finished ranges, the first ones and 8 places in between. Equal samples with a matching tag or date are "same", without are "probably same". Another tag or date counts against it only on the same server, and a differing tag with the same date decides nothing. — Two servers name the same file differently. — 02, 04, 05
|
||||
- D-035 — 2026-11-25 — Without ranges a new task starts over and the old one keeps its file until the new one is whole (`tasks.replaces`), then goes to the bin. — Nothing is lost if the new link fails too. — 02, 04
|
||||
- D-036 — 2026-11-25 — Other programs' unfinished files are copied, never moved or written. Zero-filled stretches count only where the server has zeros too. — The browser may still have the file open, and space is often taken before it is filled. — 02, 04, 05
|
||||
- D-037 — 2026-11-25 — Secrets go to the Secret Service over zbus, with the unencrypted ("plain") session and no keyring crate. Without a keyring, or when it stays locked, they are kept in memory until Medlar closes, and that is said. — Whoever could read the user's bus may ask for the secrets anyway; no new dependency. — 02, 04, 05
|
||||
- D-038 — 2026-11-25 — Redirects are followed by Medlar, ≤ 10, each with its own rules, proxy and cookies. To another site (scheme, host or port; http to https on the standard ports is the same) only User-Agent, Accept, Accept-Language and Referer go along. Logins are sent only when asked for, never from a link with TLS to one without; a site's login needs a pattern with one owner. — reqwest keeps unknown headers across hosts. — 02, 05, 06
|
||||
- D-039 — 2026-11-25 — Site rules and the app's proxy are settings. Proxy: the download's, else the site's, else the bypass list, else the app's (`system` at first: environment, then the desktop's portal). A proxy that makes no sense or fails is never gone around; SOCKS5 always resolves names itself. A certificate exception is one SHA-256 for one exact host. — No leaks. Replaces "no proxy from the environment" of D-017 for the app; plain `http::client` still has none. — 02, 04
|
||||
|
|
|
|||
|
|
@ -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
|
||||
-
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ Title and text: `error.<kind>` and `error.<kind>.why` in the catalogue; button:
|
|||
| Kind | Title | Severity | Tried again | Fix |
|
||||
|---|---|---|---|---|
|
||||
| `dns` | Server not found | passing | later 5–300 s | Network settings (`check_network`) |
|
||||
| `proxy` | No connection through the proxy | passing | later 5–300 s | Network settings (`check_network`) |
|
||||
| `unreachable` | Server out of reach | passing | later 5–300 s | Network settings (`check_network`) |
|
||||
| `refused` | Connection refused | passing | later 5–300 s | Try again (`try_again`) |
|
||||
| `timeout` | Server does not answer | passing | later 5–300 s | Try again (`try_again`) |
|
||||
|
|
|
|||
Loading…
Reference in a new issue