Kiosk: System Name storage, validation, sync, and sent on license validation

Adds local System Name persistence (trimmed, 1-40) in system_kv, an
injectable sync module with conflict/invalid revert and a pending-sync
flag, a background SystemNameSync worker (retries on boot and on a timer),
and api_client support for PUT /licenses/{key}/system-name plus the
additive systemName field/systemNameStatus on license validation. The
license service sends the stored name and applies the status. Covers
validation, pending retry, and conflict revert with a faked HTTP layer.
This commit is contained in:
NeilClack
2026-09-29 09:57:52 -05:00
parent 003a90d810
commit e7df02344b
16 changed files with 812 additions and 13 deletions
+16
View File
@@ -12,4 +12,20 @@ constexpr const char* KV_LICENSE_KEY = "license_key";
// outages do not revoke a known-good license.
constexpr const char* KV_LICENSE_LAST_VERIFIED = "license_last_verified";
// The System Name the user typed on the Kiosk (trimmed). A human-readable label
// set only here; never a reference or key.
constexpr const char* KV_SYSTEM_NAME = "system_name";
// The last System Name the server accepted. Used to revert a local change when
// the server reports a conflict or invalid value.
constexpr const char* KV_SYSTEM_NAME_SYNCED = "system_name_synced";
// "1" while the local System Name still needs to be sent to the portal (e.g.
// the license is not validated yet, or a previous sync failed).
constexpr const char* KV_SYSTEM_NAME_PENDING = "system_name_pending_sync";
// The most recent System Name status message to show the user (e.g. a conflict
// message after a background sync). Cleared once consumed/acknowledged.
constexpr const char* KV_SYSTEM_NAME_MESSAGE = "system_name_message";
} // namespace radiantwave::db