feat: importer IMVU accounts and settings from the console (#14)
Release / release (push) Successful in 4s
CI / test (push) Successful in 1m25s
CI / image (apps/api/Dockerfile, t5de-hub-api) (push) Successful in 6s
CI / image (apps/web/Dockerfile, t5de-hub-web) (push) Successful in 14s

Co-authored-by: dhkatz <[email protected]>
This commit was merged in pull request #14.
This commit is contained in:
dhkatz authored and dhkatz committed 2026-11-07 19:00:01 +00:00
1 parent 7ece681eef
commit e6a97be894
16 files changed
+5538 -13

No files matched your search

+51 -6
View File
@@ -120,17 +120,48 @@ don't keep it: the consent is gone.
## `t5de-importer`
A Go program (its own repository) beside a `t5de-catalog`; it stores nothing lasting but its working files.
A Go program (its own repository) beside a `t5de-catalog`; it stores nothing lasting but its working files, its key
pair and the IMVU accounts' passwords.
- Configuration: `HUB_URL`, `CATALOG_ID`, `IMPORTER_KEY` (from enabling imports on the catalog), `IMPORTER_RATE`
(requests a second to IMVU, default 2), optionally an IMVU account for exact revisions (`IMVU_USERNAME`,
`IMVU_PASSWORD`; the operator's choice and risk; the hub never holds IMVU credentials).
- Everything is set from the console (the catalog's Imports page) except what it needs to reach the hub:
`HUB_URL`, `CATALOG_ID`, `IMPORTER_KEY` (from turning imports on), `IMPORTER_DATA` (its folder). The rest
(requests a second to IMVU, jobs at a time, the IMVU accounts and their order) comes from
`GET /api/v1/importer/config`, polled every minute.
- Revisions: without an IMVU account, the CDN is probed (`HEAD productdata/<id>/<n>`) once per product; afterwards a
recheck tries the next few numbers. With one, `authorizeProducts` gives exact revisions.
- Reads CFLs with t5de-api's `cfl` package; the conversion follows `@imvu/chkn` (dhkatz/imvu.js) as a reference.
- Validates with t5de-api's `pack` rules before uploading; a product breaking them fails with the reason. (The spike
checks whether typical IMVU products fit; imports may need their own limits.)
### IMVU accounts
Signed out, IMVU shows no info for Access Pass products (see "Built"), so an importer needs an IMVU account with
Access Pass to import them, and accounts give exact revisions. The catalog's team adds them on the console; their
passwords never reach the hub readable, and are kept only by the importer.
- On first start the importer makes an RSA key pair (3072-bit, RSA-OAEP with SHA-256) in `IMPORTER_DATA` and sends
the public key with `POST /api/v1/importer/hello {version, publicKey}`. The console shows its fingerprint and
version and when it was last heard from.
- Adding an account (`import:run`): the console looks the username up on IMVU (public info: avatar, ID, Access
Pass, age verified) and asks to confirm it in a dialog showing that, with a warning if it has no Access Pass
and the importer key's fingerprint. The password is encrypted in the browser (WebCrypto) with the importer's
public key; the hub stores only that sealed blob, hands it to the importer in its config, and deletes it once the
importer confirms it has it (or after 7 days).
- Several accounts, in an order the team sets: the importer uses the first that signs in and moves to the next when
one fails. It reports each account's state (`ok`, `sign_in_failed`, `needs_password`, plus whether IMVU shows it
Access Pass) with `POST /api/v1/importer/accounts/:id`, shown on the console. Before that an account is `waiting`
(sealed, not yet with the importer) or `received`. At most 10 accounts.
- If the importer's key pair changes (a new install), passwords sealed for the old key can't be read: those
accounts show "needs password" until re-entered.
- Removing an account tells the importer to forget it. Adding, new passwords and removing are audited
(`catalog.importer_account`), as are settings (`catalog.importer_settings`) and a new importer key pair
(`catalog.importer_hello`).
- Built (2026-11-07): all of the above on the hub and the console, except the importer's report of AP products' info
(with the importer).
- What the importer sees with an account (creator, name, rating of AP products) it reports to the hub with the job
(`POST /api/v1/importer/jobs/:id {product: {creatorId, name, rating}}`), trusted from that catalog's importer
only, for products IMVU hides from the hub.
## Hub routes
| | |
@@ -147,6 +178,17 @@ A Go program (its own repository) beside a `t5de-catalog`; it stores nothing las
| `POST /api/v1/catalogs/:id/importer` | `{enabled?}` (`import:run`; turning on returns the importer `key`, shown once) and `{paused?}` (`import:pause`) |
| `POST /api/v1/catalogs/:id/importer/key` | (`import:run`) → `{key}`: a new importer key |
| `POST /api/v1/catalogs/:id/importer/jobs/:job/retry` | (`import:run`) a failed or done job queued again |
| `GET /api/v1/catalogs/:id/importer/imvu-account?username=` | (`import:run`) `{imvuId, username, picture, accessPass, ageVerified}`: IMVU's public info, for the confirmation dialog |
| `POST /api/v1/catalogs/:id/importer/accounts` | (`import:run`) `{imvuId, sealed, fingerprint}` → 201 `{account}`. `fingerprint` must be the importer's key's (409 `importer_key_changed`; 409 `no_importer` before it has said hello); one per IMVU account (409 `exists`), at most 10. |
| `PUT /api/v1/catalogs/:id/importer/accounts/:account/password` | (`import:run`) `{sealed, fingerprint}`: a new password |
| `POST /api/v1/catalogs/:id/importer/accounts/:account/move` | (`import:run`) `{direction: "up" \| "down"}` |
| `DELETE /api/v1/catalogs/:id/importer/accounts/:account` | (`import:run`) |
| `POST /api/v1/catalogs/:id/importer/settings` | (`import:run`) `{rate (0.2-10 requests a second to IMVU), concurrency (1-8 jobs at once)}` |
`GET /api/v1/catalogs/:id/importer` also has `program: {version, seenAt, fingerprint, publicKey}` (`publicKey` only
with `import:run`), `settings`, and `accounts: [{id, imvuId, username, state, stateMessage, stateAt, accessPass,
ageVerified}]` (state: `waiting` for the importer, `received`, `ok`, `sign_in_failed`, `needs_password`). Never a
password, sealed or not.
For importers (`Authorization: Importer <catalog ID>:<key>`) in products.md.
@@ -167,8 +209,11 @@ deleted ones and IDs that never existed (404 only for a few very old IDs), so th
(`userimages-akm.imvu.com/productdata/<id>/<n>/`) serves AP and even deleted products' files without signing in
(made-up IDs 404), but they carry no creator, name or rating, which a grant needs to cover a product. The shop page
(`www.imvu.com/shop/product.php?products_id=`) tells them apart: an AP product redirects to sign-in, a deleted one
says "Not Found". For AP products, the importer's IMVU account (with Access Pass) would report the product info to
the hub: decide with the spike.
says "Not Found". For AP products, the importer's IMVU account (with Access Pass) reports the product info to the
hub ("IMVU accounts" above). Also signed out: `client-dynamic.imvu.com/api/shop/product.php` and
`api.imvu.com/creator/creator-<id>` need an account, and search refuses AP (`ap_search_denied`, with
`product_rating` other than `0,5`), but `api.imvu.com/product?creator=<username>` lists a shop's other products
(100 a page, `next` relation), which whole-shop grants use.
Still to do: admin-recorded grants, proofs and unclaimed creators (and claiming); `GET /imports/available` for the
proxy's shop button; t5de-catalog accepting `t5de-import` tokens on uploads; the spike and `t5de-importer`.