From cbef689903cfd30d2fa56912614115427004a92b Mon Sep 17 00:00:00 2001 From: samialabri Date: Thu, 15 Oct 2026 21:31:46 +0900 Subject: [PATCH] kv-proto: add PreloginResponse for GET /v1/auth/prelogin A new device needs account_id and the KDF params to derive AUTH_INPUT before it can build KE1, so they cannot come only from login/start. Co-Authored-By: Claude Opus 5.5 --- crates/kv-proto/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/kv-proto/src/lib.rs b/crates/kv-proto/src/lib.rs index bae488a..e495cf1 100644 --- a/crates/kv-proto/src/lib.rs +++ b/crates/kv-proto/src/lib.rs @@ -134,6 +134,14 @@ pub struct SetupRequest { pub device: DeviceEnroll, } +/// `GET /v1/auth/prelogin`: the public inputs a new device needs to derive `AUTH_INPUT` +/// before it can build `ke1` (docs/02 "Key derivation"). Unauthenticated, rate limited. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct PreloginResponse { + pub account_id: Uuid, + pub kdf: KdfParams, +} + /// `POST /v1/auth/login/start`. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct LoginStart {