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
+17
View File
@@ -87,4 +87,21 @@ std::string formatLicenseKey(const std::string& sanitized) {
return out;
}
std::string trim(const std::string& input) {
size_t start = 0;
size_t end = input.size();
while (start < end && std::isspace(static_cast<unsigned char>(input[start]))) {
++start;
}
while (end > start && std::isspace(static_cast<unsigned char>(input[end - 1]))) {
--end;
}
return input.substr(start, end - start);
}
bool isValidSystemName(const std::string& name) {
const std::string trimmed = trim(name);
return !trimmed.empty() && trimmed.size() <= SYSTEM_NAME_MAX_LENGTH;
}
} // namespace radiantwave::validation