knowless 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -17,6 +17,32 @@ Versioning is [SemVer](https://semver.org/).
17
17
  test message to `shamRecipient` and confirms the local MTA
18
18
  discarded it. Targeted for v0.2.0.
19
19
 
20
+ ## [0.1.10] — 2026-04-28
21
+
22
+ addypin manual smoke continued. Two DX docs improvements; no code
23
+ changes.
24
+
25
+ ### Documentation
26
+
27
+ - **GUIDE: "Local development setup" section (AF-16).** Covers the
28
+ five flags that turn knowless from "production-tuned, defensive"
29
+ to "developer-friendly, get-out-of-my-way" — `cookieSecure: false`,
30
+ `devLogMagicLinks: true`, `maxLoginRequestsPerIpPerHour: 0`,
31
+ `maxNewHandlesPerIpPerHour: 0`, `openRegistration: true`. Each
32
+ flag explained with what it solves and a sharp warning about
33
+ shipping it. Considered auto-disabling rate limits whenever
34
+ `devLogMagicLinks: true` to save typing, but rejected the
35
+ coupling — operators turning on `devLogMagicLinks` briefly to
36
+ debug a single email in prod should NOT have rate limits silently
37
+ dropped at the same time.
38
+ - **GUIDE: silent-miss debug line is now promoted as a feature
39
+ (AF-17).** The `[knowless dev:<from>] silent-miss: handle for
40
+ "X" does not exist (openRegistration=false)` stderr hint
41
+ introduced in AF-7.2 was buried in the CHANGELOG; it now leads
42
+ the dev-setup section. First-time closed-reg friction was costing
43
+ every adopter the same ~30 min; the hint cuts that to seconds
44
+ but only if you know it exists.
45
+
20
46
  ## [0.1.9] — 2026-04-28
21
47
 
22
48
  addypin manual smoke turned up one real bug, one defaults footgun,
package/GUIDE.md CHANGED
@@ -398,6 +398,59 @@ reverse proxy gates upstreams via `/verify` returning 200/401 +
398
398
  `handleFromRequest` — same answer, no sub-request round-trip, no
399
399
  header parsing.
400
400
 
401
+ ### Local development setup
402
+
403
+ Production defaults are tuned to bite bots, not to be friendly to a
404
+ developer hammering the same address from `127.0.0.1` for the
405
+ hundredth time. Use a dedicated dev config:
406
+
407
+ ```js
408
+ const auth = knowless({
409
+ // ...required fields
410
+ cookieSecure: false, // localhost-only HTTP origins (AF-4.4)
411
+ devLogMagicLinks: true, // print magic links to stderr when SMTP fails (AF-6.2)
412
+ maxLoginRequestsPerIpPerHour: 0, // disable per-IP login cap
413
+ maxNewHandlesPerIpPerHour: 0, // disable per-IP create cap
414
+ openRegistration: true, // skip the pre-seeding step in dev
415
+ });
416
+ ```
417
+
418
+ Why each flag matters in dev:
419
+
420
+ - **`cookieSecure: false`** — without it, `http://localhost` browsers
421
+ reject the session cookie silently. The library logs a stderr
422
+ warning at startup so you can't accidentally ship this to prod.
423
+ - **`devLogMagicLinks: true`** — when SMTP is unreachable (no local
424
+ Postfix yet), magic-link URLs print to stderr tagged
425
+ `[knowless dev:<from>] magic link: ...`. Click straight from the
426
+ terminal. **Bonus diagnostic** (AF-7.2): on a sham/silent-miss
427
+ path, you get `[knowless dev:<from>] silent-miss: handle for
428
+ "X" does not exist (openRegistration=false)` instead — surfaces
429
+ the closed-reg gotcha that costs everyone the same 30 minutes
430
+ the first time.
431
+ - **`maxLoginRequestsPerIpPerHour: 0` and `maxNewHandlesPerIpPerHour:
432
+ 0`** — disable per-IP rate caps. The defaults (30 / 3 per hour)
433
+ are sane for prod but shoot you in the foot during repeated test
434
+ runs. The counters **persist in the SQLite file** across process
435
+ restarts, so even rebooting the dev server doesn't clear them —
436
+ you'd have to delete the DB or wait an hour. Setting both to 0
437
+ in dev avoids the surprise.
438
+ - **`openRegistration: true`** — saves you from manually pre-seeding
439
+ every test email via `auth.deriveHandle` + your own store insert.
440
+
441
+ > **Don't ship this config.** Each of these flags weakens a specific
442
+ > defense. They are coupled to your environment, not to each other —
443
+ > intentionally. (We considered auto-disabling rate limits whenever
444
+ > `devLogMagicLinks` is true, but rejected: an operator turning on
445
+ > `devLogMagicLinks` to debug a single email in production should
446
+ > NOT have rate limits silently dropped at the same time.)
447
+
448
+ For end-to-end mail rendering checks (verify the `bodyFooter`,
449
+ inspect the magic-link line for QP soft-breaks, confirm the
450
+ right `subjectOverride` shipped), point dev knowless at MailHog
451
+ on `localhost:1025`. Setup walkthrough lives in
452
+ [`OPS.md` §11b](OPS.md).
453
+
401
454
  ### Step 7: GDPR right-to-erasure
402
455
 
403
456
  The store interface exposes `deleteHandle(handle)` — atomic delete
package/README.md CHANGED
@@ -7,7 +7,7 @@ that don't need to email their users for anything but the sign-in link.
7
7
  npm install knowless
8
8
  ```
9
9
 
10
- > v0.1.9 | Node.js >= 20 | 2 deps (nodemailer, better-sqlite3) | Apache-2.0
10
+ > v0.1.10 | Node.js >= 20 | 2 deps (nodemailer, better-sqlite3) | Apache-2.0
11
11
 
12
12
  ## What this is
13
13
 
@@ -1,7 +1,7 @@
1
1
  # knowless -- Integration Guide
2
2
 
3
3
  > For AI assistants and developers wiring knowless into a project.
4
- > v0.1.9 | Node.js >= 20 | 2 deps (nodemailer, better-sqlite3) | Apache-2.0
4
+ > v0.1.10 | Node.js >= 20 | 2 deps (nodemailer, better-sqlite3) | Apache-2.0
5
5
 
6
6
  ## What this is
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knowless",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Small, opinionated, full-stack passwordless auth for Node.js services that don't need to email their users for anything but the sign-in link.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",