mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 13:49:40 +08:00
`/sync` and `/heartbeat` are the only endpoints reachable without a DeepTutor session, and both resolved their store before checking the credential. Two consequences: - Constructing a `MarginNoteStore` mkdir's and installs the schema, so an unauthenticated `POST /sync` created a database per distinct `X-MN4-KB` value. `MarginNoteStore.open_existing` gives the device path a way to look without writing; no file, no store, 403. - Pairing runs under `require_auth` and lands in the caller's own workspace, while the device endpoints carry no session and resolve the default one. Wherever those differ the token issued at pairing could never be found again, so every sync 403'd forever. Both paths now name the workspace they mean through one resolver, and pairing refuses rather than hand out a credential the sync path cannot read. Also bound one batch (`objects` / `deleted_ids` / `cursor` / device name), and promote `_default_db_path` to `default_db_path` since two other modules already import it across the package boundary.