Skip to main content

poll_key_bundle

Function poll_key_bundle 

Source
pub async fn poll_key_bundle(
    client: &RestClient,
    priv_b64: &str,
    user_id: &str,
) -> bool
Expand description

Poll GET /auth/key-bundle for up to 30s waiting for a key-bearer device to publish our encrypted user-key bundle. Returns true if a bundle arrived and the decrypted master key was persisted via credstore::write_encryption_key; returns false on timeout or any decode failure (with a single line printed to stderr per observed failure mode, mirroring the original CLI behavior).

priv_b64 is the local device’s freshly-generated ephemeral X25519 private key (matches the public key registered with the relay during auth login); user_id scopes the credstore entry.