feat(licenses): full commercial license management system v1.26.1-moko.06.02.00 #402
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Full commercial license management system for organizations selling Joomla, WordPress, and Dolibarr extensions. 14 commits implementing:
Test plan
All implemented issues have testing plans as comments. Label:
pending: testing.go test -run TestAPILicense ./tests/integration/🤖 Generated with Claude Code
SECURITY: ValidateLicenseKeyForRepo() now checks the package's RepoScope field against the requesting repo ID. A package scoped to repo A will reject keys when accessed from repo B's update feed. Update server and download gating both use the new function. Master/internal keys bypass repo scope checks. RepoScope supports: "all" (any repo), single repo ID string, or JSON array of repo IDs like ["1","5","12"]. Also adds POST /license-keys/{id}/revoke API endpoint that was missing from the API but existed in web handlers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>New endpoint: GET /{owner}/{repo}/updates/wordpress.json Generates JSON compatible with the YahnisElsts plugin-update-checker library — the standard for commercial WordPress plugin self-hosted updates. Returns name, slug, version, download_url, homepage, requires_php, author, sections (changelog HTML), icons, and banners. License key validation: reads from ?license_key=, ?dlid=, or ?key= query params (PUC sends these via addQueryArgFilter). When RequireKey is enabled, returns minimal empty response without download_url. Changelog section built from release notes (last 10 stable releases), converting markdown list items to HTML <ul>/<li> elements. Icon/banner URLs point to conventional paths in the repo: assets/icon-128x128.png, assets/icon-256x256.png assets/banner-772x250.png, assets/banner-1544x500.png Route registered at /updates/wordpress.json alongside existing /updates.xml (Joomla) and /updates/dolibarr.json. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>SECURITY: Add verifyPackageOwnership/verifyKeyOwnership checks to all API handlers that accept ID parameters. Prevents cross-org access where an admin of org A could modify org B's license data. FIX: RepoScope validation now properly parses JSON arrays using json.Unmarshal instead of strings.Contains. The old approach matched substrings (repo ID "2" matched inside "12"). Now uses typed int64 comparison. FIX: Add {{$.CsrfTokenHtml}} to both delete confirmation modal forms (package and key) in repo and org templates. Without CSRF tokens, the form-fetch-action POST requests would be rejected. FIX: HTML-escape release notes in WordPress changelog to prevent XSS via malicious release note content reaching WP admin dashboards. FIX: Parse AllowedChannels JSON format before comma-split fallback to avoid garbage values from splitting JSON arrays by comma. FIX: Add missing third return value (false) on error path in validateUpdateKey to prevent compile error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>