merge: integrate upstream license-tier updates
This commit is contained in:
+3
-2
@@ -307,11 +307,12 @@ Sami explicitly stated he wants email auth as an OPTION alongside TOTP, not a re
|
|||||||
- **result:** 19/19 platform-paths tests pass (8 new for assertSafe + 3 new for isMountedCheck). 5/5 start.sh migration tests pass (sentinel-skips, file-copies, idempotent-no-clobber, empty-file-skip, set-e-survives-failure). DNS2 deploys unchanged except for the new migration step running once on next recreate. Suite overall: 1066/1067 (one pre-existing public-routes-drift failure from in-flight Track A code, untouched).
|
- **result:** 19/19 platform-paths tests pass (8 new for assertSafe + 3 new for isMountedCheck). 5/5 start.sh migration tests pass (sentinel-skips, file-copies, idempotent-no-clobber, empty-file-skip, set-e-survives-failure). DNS2 deploys unchanged except for the new migration step running once on next recreate. Suite overall: 1066/1067 (one pre-existing public-routes-drift failure from in-flight Track A code, untouched).
|
||||||
|
|
||||||
### DC-052: License-tier enforcement — Free caps user count at 3, gates share features on Pro
|
### DC-052: License-tier enforcement — Free caps user count at 3, gates share features on Pro
|
||||||
- **status:** todo
|
- **status:** done
|
||||||
- **owner:** unclaimed
|
- **owner:** hermes
|
||||||
- **details:** Per `/root/dashcaddy/PRODUCT-SPEC-DECISIONS.md` (locked 2026-07-20): Free = up to 3 users, Pro = unlimited. The DC-048 user-store needs a `countUsers()` helper. The `/api/v1/auth/admin/invites` POST handler must check `if (users.count() >= 3 && !licenseManager.isPro()) throw new ValidationError('upgrade required', 'tier')`. Same check on `POST /admin/users` (pre-authorize). Share-link creation routes (DC-053) gate on `licenseManager.isPro()`. **Free has NO trial path** — there is no automatic Pro trial, no time-limited upsell. The user picks Free or Pro deliberately. **LIFETIME keys are creator-only**: the API rejects any LIFETIME code at `verifyCode` time in production. The `license-keygen.js --lifetime` path stays on Sami's dev machine only; it's never wired to Stripe Checkout.
|
- **details:** Per `/root/dashcaddy/PRODUCT-SPEC-DECISIONS.md` (locked 2026-07-20): Free = up to 3 users, Pro = unlimited. The DC-048 user-store needs a `countUsers()` helper. The `/api/v1/auth/admin/invites` POST handler must check `if (users.count() >= 3 && !licenseManager.isPro()) throw new ValidationError('upgrade required', 'tier')`. Same check on `POST /admin/users` (pre-authorize). Share-link creation routes (DC-053) gate on `licenseManager.isPro()`. **Free has NO trial path** — there is no automatic Pro trial, no time-limited upsell. The user picks Free or Pro deliberately. **LIFETIME keys are creator-only**: the API rejects any LIFETIME code at `verifyCode` time in production. The `license-keygen.js --lifetime` path stays on Sami's dev machine only; it's never wired to Stripe Checkout.
|
||||||
- **impact:** First pricing enforcement. Without this, Pro is just a label. With this, every upgrade path has a clear moment to upsell.
|
- **impact:** First pricing enforcement. Without this, Pro is just a label. With this, every upgrade path has a clear moment to upsell.
|
||||||
- **prerequisite:** DC-048 (shipped).
|
- **prerequisite:** DC-048 (shipped).
|
||||||
|
- **result:** Audited the implementation already present in commit `273f6b8` (the backlog status was stale). `user-store.js` exposes atomic `countUsers()`. Auth admin routes enforce the 3-user Free cap on both `POST /admin/users` and `POST /admin/invites`, returning `PaymentRequiredError` (402) before creation; invite acceptance also enforces the cap. Share creation is Pro-gated in DC-053. `LicenseManager.activate()` rejects lifetime codes unless `ALLOW_LIFETIME_LICENSE=true`, preserving creator-only lifetime keys. Existing regression suite `license-tier-enforcement.test.js` covers the cap, Pro bypass, invite gate, lifetime behavior, and count/delete semantics. Full Jest baseline and post-audit: **52 suites, 1372 tests passed**. ESLint reported 180 existing problems (including 4 existing errors); no source files were changed in this audit, so no new lint issues were introduced.
|
||||||
|
|
||||||
### DC-053: Public share links + Tailscale-mediated share — Pro-gated
|
### DC-053: Public share links + Tailscale-mediated share — Pro-gated
|
||||||
- **status:** done
|
- **status:** done
|
||||||
|
|||||||
Reference in New Issue
Block a user