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:
@@ -17,4 +17,14 @@ std::string sanitizeLicenseKey(const std::string& input);
|
||||
// characters (XXXX-XXXX-XXXX-XXXX). Partial input yields partial output.
|
||||
std::string formatLicenseKey(const std::string& sanitized);
|
||||
|
||||
// The maximum length of a System Name (per the API contract).
|
||||
constexpr size_t SYSTEM_NAME_MAX_LENGTH = 40;
|
||||
|
||||
// Removes leading and trailing ASCII whitespace from `input`.
|
||||
std::string trim(const std::string& input);
|
||||
|
||||
// Returns true when `name` (already trimmed) is a valid System Name: 1-40
|
||||
// characters. Empty or whitespace-only names are invalid (never a clear).
|
||||
bool isValidSystemName(const std::string& name);
|
||||
|
||||
} // namespace radiantwave::validation
|
||||
|
||||
Reference in New Issue
Block a user