Skip to content

license: require the signed license file, drop by-email activation#8

Merged
peterdsp merged 1 commit into
mainfrom
feat/offline-file-activation
Jul 8, 2026
Merged

license: require the signed license file, drop by-email activation#8
peterdsp merged 1 commit into
mainfrom
feat/offline-file-activation

Conversation

@peterdsp

@peterdsp peterdsp commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Closes the freeload hole you spotted: previously the app posted a buyer's email to the server and got the license back, so anyone who knew a licensed address (including the public admin email) could unlock for free.

Change

Activation now requires the signed .klipa license file itself, verified offline:

  • activate_from_clipboard parses the pasted license blob and checks the Ed25519 signature offline against the embedded public key. No network. Knowing an email is no longer enough - you need the signed file.
  • verify_blob drops the email argument (a valid signature is the proof); reverify_if_stale becomes a cheap offline integrity check instead of a server round-trip.
  • Removed the license endpoint const and http::post_json - the license feature no longer touches the network.
  • Menu label → "Activate (paste license file)"; welcome page, READMEs, and the license-server docs updated.

Paired with the server change (PromptBar) that disables klipa's /activate email-lookup (returns 403) and inlines the license in the purchase email so it's easy to copy.

Tradeoff

No online revocation - a refund can't be remotely revoked, since a valid license is a permanent signed file. Acceptable for a €1.99 open-source "honest nudge" gate.

Testing

cargo test -p klipa-ui (8 pass, incl. real-signature verify + tamper). Clean build on default, mas, mas weather, no-default-features. App Store build unaffected (license compiled out).

Activation previously posted the buyer's email to the license server and
got the license back - which meant anyone who knew a buyer's address
(e.g. the public admin email) could unlock for free. Now activation
requires the signed .klipa license file itself.

- activate_from_clipboard parses the pasted license blob and verifies the
  Ed25519 signature offline; no network call. Knowing an email is no
  longer sufficient - you need the signed file.
- verify_blob drops the email argument (possession of a valid signature
  is the proof); reverify_if_stale becomes a cheap offline integrity
  re-check instead of a server round-trip.
- Remove the now-unused license endpoint const and http::post_json; the
  license feature no longer touches the network.
- Menu label -> "Activate (paste license file)". Docs/welcome/READMEs
  updated for the file-based flow.

Tradeoff: no online revocation (a refund can't be revoked remotely) -
acceptable for a EUR 1.99 open-source "honest nudge" gate. App Store
build is unaffected (license feature compiled out).
Copilot AI review requested due to automatic review settings July 8, 2026 14:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@peterdsp
peterdsp merged commit 6712202 into main Jul 8, 2026
4 checks passed
@peterdsp
peterdsp deleted the feat/offline-file-activation branch July 8, 2026 14:32
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.

2 participants