fix(kiosk): accept integer kiosk_id in claim response

Server returns kiosk_id as integer (not yet migrated to UUIDv7).
ClaimResp.kiosk_id changed from Option<String> to Option<Value>
to handle both integer and string. This was causing a panic on
deserialization after successful pairing.

Also simplified Coolify version arg.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mitchell R 2026-05-26 04:06:00 +02:00
parent cefd378b67
commit bc7b7695d8
No known key found for this signature in database

View file

@ -300,7 +300,7 @@ fn encrypt_key_file() -> PathBuf {
#[derive(Deserialize)]
struct ClaimResp {
status: String,
kiosk_id: Option<String>,
kiosk_id: Option<serde_json::Value>,
kiosk_key: Option<String>,
kiosk_name: Option<String>,
cluster_key: Option<String>,
@ -329,7 +329,12 @@ pub fn poll_claim(server: &str, code: &str) -> (String, String) {
let key = claim.kiosk_key.expect("missing kiosk_key");
let name = claim.kiosk_name.unwrap_or_else(|| "kiosk".into());
if let Some(ref id) = claim.kiosk_id {
crate::axiom::set_kiosk_id(id.clone());
let id_str = match id {
serde_json::Value::String(s) => s.clone(),
serde_json::Value::Number(n) => n.to_string(),
other => other.to_string(),
};
crate::axiom::set_kiosk_id(id_str);
}
crate::at_rest::write_encrypted(&key_file(), key.as_bytes())
.expect("failed to save kiosk key");