Mint licenses with the buyer's org name; heal ctm_ orgs at re-sign #18

Merged
Cordy merged 3 commits from fix/org-name into main 2026-07-31 10:16:41 +00:00
Owner

Closes #17

The org field is sealed into the signed payload and Cairn displays it verbatim, so it must be a name — not ctm_….

Mint-time resolution order (webhook): checkout-supplied custom_data.org → the buyer account's organization name (email → account → org, the store already has it) → the Paddle customer id strictly as a last resort for buyers without an account. A ctm_ org is now impossible for any account-holding buyer.

Heal at re-sign: refreshWith calls healCtmOrgLocked — if the stored org has the ctm_ prefix and the owning account has a named org, the re-signed license carries the name. Pre-existing licenses (Nikola's included) heal on their next renewal or seat change; custom names are never overwritten (test-pinned).

Tests cover all four paths: checkout name wins, account-name fallback, no-account last resort, and heal-on-refresh including the never-overwrite guarantee.

Companion cairn-site PR adds the buy-box field that feeds custom_data.org.

Closes #17 The `org` field is sealed into the signed payload and Cairn displays it verbatim, so it must be a name — not `ctm_…`. **Mint-time resolution order** (webhook): checkout-supplied `custom_data.org` → the buyer account's organization name (email → account → org, the store already has it) → the Paddle customer id strictly as a last resort for buyers without an account. A `ctm_` org is now impossible for any account-holding buyer. **Heal at re-sign:** `refreshWith` calls `healCtmOrgLocked` — if the stored org has the `ctm_` prefix and the owning account has a named org, the re-signed license carries the name. Pre-existing licenses (Nikola's included) heal on their next renewal or seat change; custom names are never overwritten (test-pinned). Tests cover all four paths: checkout name wins, account-name fallback, no-account last resort, and heal-on-refresh including the never-overwrite guarantee. Companion cairn-site PR adds the buy-box field that feeds `custom_data.org`.
Cordy merged commit 60a410324d into main 2026-07-31 10:16:41 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/cairn-license-server#18
No description provided.