From e64bf4f0d1129d14143ab124805508c37f523d8c Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Sun, 26 Apr 2026 17:17:44 +0200 Subject: [PATCH] feat: add cameleer-license-minter dependency and V002 migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds Ed25519 license minting library, signing_keys table, renames tiers (LOW→STARTER, MID→TEAM, HIGH→BUSINESS, BUSINESS→ENTERPRISE), adds label + grace_period_days to licenses, drops features column. Co-Authored-By: Claude Opus 4.6 (1M context) --- pom.xml | 7 ++++ .../db/migration/V002__license_minter.sql | 34 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/main/resources/db/migration/V002__license_minter.sql diff --git a/pom.xml b/pom.xml index b14f49b..9785b57 100644 --- a/pom.xml +++ b/pom.xml @@ -100,6 +100,13 @@ 3.4.1 + + + com.cameleer + cameleer-license-minter + 1.0-SNAPSHOT + + org.springframework.boot diff --git a/src/main/resources/db/migration/V002__license_minter.sql b/src/main/resources/db/migration/V002__license_minter.sql new file mode 100644 index 0000000..91318de --- /dev/null +++ b/src/main/resources/db/migration/V002__license_minter.sql @@ -0,0 +1,34 @@ +-- V002: License minter integration +-- Ed25519 signing keys for license minting +CREATE TABLE signing_keys ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + public_key_b64 TEXT NOT NULL, + private_key_b64 TEXT NOT NULL, + active BOOLEAN NOT NULL DEFAULT TRUE, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +-- Rename tiers: LOW→STARTER, MID→TEAM, HIGH→BUSINESS, BUSINESS→ENTERPRISE +-- Single CASE pass to avoid double-rename +UPDATE tenants SET tier = CASE tier + WHEN 'LOW' THEN 'STARTER' + WHEN 'MID' THEN 'TEAM' + WHEN 'HIGH' THEN 'BUSINESS' + WHEN 'BUSINESS' THEN 'ENTERPRISE' + ELSE tier +END WHERE tier IN ('LOW', 'MID', 'HIGH', 'BUSINESS'); + +UPDATE licenses SET tier = CASE tier + WHEN 'LOW' THEN 'STARTER' + WHEN 'MID' THEN 'TEAM' + WHEN 'HIGH' THEN 'BUSINESS' + WHEN 'BUSINESS' THEN 'ENTERPRISE' + ELSE tier +END WHERE tier IN ('LOW', 'MID', 'HIGH', 'BUSINESS'); + +-- Add new license columns for Ed25519 model +ALTER TABLE licenses ADD COLUMN label VARCHAR(255); +ALTER TABLE licenses ADD COLUMN grace_period_days INTEGER NOT NULL DEFAULT 0; + +-- Drop features column (server enforces caps, not feature flags) +ALTER TABLE licenses DROP COLUMN features;