Skip to content

fix(developer-license): sign every Pro feature and no image digests - #122

Merged
Harol-Reina merged 1 commit into
mainfrom
fix/developer-licence-features
Oct 4, 2026
Merged

Harol-Reina merged 1 commit into
mainfrom
fix/developer-licence-features

Conversation

@Harol-Reina

Copy link
Copy Markdown
Contributor

Summary

The free Tier 0.5 developer licence validated Invalid in Pro, so nobody evaluating Verbara saw any Pro feature.

  • Feature bits: the issuer signed Features = 511 (the 9 bits that existed when it was written). Pro requires the Developer tier to carry the full canonical set (LicenseFeature.All, 12 bits = 4095). The bits are now listed by name in functions/api/developer-license/license-features.ts, mirroring Pro's LicenseFeature, and FEATURES_ALL is computed from that list. tests/unit/license-features.test.ts pins the 12 names, values and order.
  • No image digests in the licence: AuthorizedImageDigests is no longer embedded. The field is omitted (not []): Pro serializes it WhenWritingNull, so an empty array breaks the signature. The release digest ledger (data/authorized-digests.json, loadRegistry) stays for the drift check; the unused 6-digest selection is removed.
  • D1 audit row: features = 4095; authorized_image_digests takes its '[]' default.
  • Docs: data/README.md, docs/operations/issuer-setup.md (Features: 4095, no digests), gates.yaml. Test stubs now match URLs by exact hostname.
  • coverage-floor.json: lines_valid_min 300 → 290 (dead code removed; 296 lines measured; reason in _comment).

Proven end to end: a licence issued through the real onRequestPost (ephemeral test key) validates Valid in Pro's actual LicenseValidator (Features = All, no digests key); the previous code validates Invalid; a .lic with "AuthorizedImageDigests": [] added by hand validates Invalid.

Not fixed here (separate, pre-existing): a licensee containing +, & or non-ASCII characters still validates Invalid — Pro's canonical JSON escapes them (System.Text.Json default encoder) and JSON.stringify does not. The deployed Worker version cannot be checked from here.

Test plan

  • npm run check, lint, test:i18n, validate:digests, npm test (91), build, validate:html, script suites, coverage floor + patch (100 %) + exclusion baseline
  • mutations: dropping CsatRunner → 4 tests red; writing AuthorizedImageDigests: [] → 2 tests red
  • end-to-end validation against Pro LicenseValidator (implementer and an independent verifier, separate harnesses)
  • codeql-branch stamped d1e9e04b

🤖 Generated with Claude Code

The issuer signed Features = 511 (the 9 feature bits that existed when it was
written) while Pro requires the full canonical set for the Developer tier
(LicenseFeature.All, 12 bits = 4095), so every free licence validated Invalid.
The bits are now listed by name, mirroring Pro's LicenseFeature, and ALL is
computed from that list; a unit test pins the 12 names and values.

It also stops embedding AuthorizedImageDigests (PDR-0003 amendment C6). The
field is omitted, not empty: Pro serializes it WhenWritingNull, so an empty
array breaks the signature. The release digest ledger stays for the drift
check. Proven end to end: an issued licence validates Valid in Pro's real
LicenseValidator; the old code validates Invalid.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
verbara-website d1e9e04 Commit Preview URL

Branch Preview URL
Oct 03 2026, 11:39 PM

@Harol-Reina
Harol-Reina added this pull request to the merge queue Oct 4, 2026
Merged via the queue into main with commit fd6a723 Oct 4, 2026
10 checks passed
@Harol-Reina
Harol-Reina deleted the fix/developer-licence-features branch October 4, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant