An easy-to-host PDS on the ATProtocol, iPhone and MacOS. Maintain control of your keys and data, always.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(identity-wallet): address code review feedback for Phase 3

- Import ordering: move 'crypto' import before 'serde' (alphabetical)
- Add HTTP status code logging for GET /v1/relay/keys non-success path
- Add HTTP status code logging for POST /v1/dids non-success path
- Apply rustfmt canonical formatting to method chains

All formatting now passes 'cargo fmt --all --check'.
All 8 DID ceremony serialization tests pass.
Crate builds without warnings (clippy clean).

authored by

Malpercio and committed by
Tangled
8d9c8fdc 7efabe18

+24 -29
+24 -29
apps/identity-wallet/src-tauri/src/lib.rs
··· 2 2 pub mod http; 3 3 pub mod keychain; 4 4 5 + use crypto::{build_did_plc_genesis_op_with_external_signer, CryptoError, DidKeyUri}; 5 6 use serde::{Deserialize, Serialize}; 6 7 use std::sync::LazyLock; 7 - use crypto::{build_did_plc_genesis_op_with_external_signer, CryptoError, DidKeyUri}; 8 8 9 9 // ── Request / response types ──────────────────────────────────────────────── 10 10 ··· 257 257 })?; 258 258 259 259 // Step 2: Fetch the relay's active signing key (public, no auth required). 260 - let resp = RELAY_CLIENT 261 - .get("/v1/relay/keys") 262 - .await 263 - .map_err(|e| DIDCeremonyError::NetworkError { 264 - message: e.to_string(), 265 - })?; 260 + let resp = 261 + RELAY_CLIENT 262 + .get("/v1/relay/keys") 263 + .await 264 + .map_err(|e| DIDCeremonyError::NetworkError { 265 + message: e.to_string(), 266 + })?; 266 267 267 268 if resp.status().as_u16() == 503 { 268 269 return Err(DIDCeremonyError::NoRelaySigningKey); 269 270 } 270 271 if !resp.status().is_success() { 272 + tracing::warn!(status = %resp.status(), "GET /v1/relay/keys returned non-success status"); 271 273 return Err(DIDCeremonyError::RelayKeyFetchFailed); 272 274 } 273 275 274 - let relay_key: RelaySigningKey = resp 275 - .json() 276 - .await 277 - .map_err(|e| { 278 - tracing::warn!(error = %e, "failed to deserialize relay signing key response"); 279 - DIDCeremonyError::RelayKeyFetchFailed 280 - })?; 276 + let relay_key: RelaySigningKey = resp.json().await.map_err(|e| { 277 + tracing::warn!(error = %e, "failed to deserialize relay signing key response"); 278 + DIDCeremonyError::RelayKeyFetchFailed 279 + })?; 281 280 282 281 // Step 3: Build signed genesis op — device key as rotation key, relay key as signing key. 283 282 // The sign callback calls device_key::sign() so the private key never leaves the SE. ··· 323 322 })?; 324 323 325 324 if !resp.status().is_success() { 325 + tracing::warn!(status = %resp.status(), "POST /v1/dids returned non-success status"); 326 326 return Err(DIDCeremonyError::DidCreationFailed); 327 327 } 328 328 329 - let create_did_resp: CreateDidResponse = resp 330 - .json() 331 - .await 332 - .map_err(|e| { 333 - tracing::warn!(error = %e, "failed to deserialize POST /v1/dids response"); 334 - DIDCeremonyError::DidCreationFailed 335 - })?; 329 + let create_did_resp: CreateDidResponse = resp.json().await.map_err(|e| { 330 + tracing::warn!(error = %e, "failed to deserialize POST /v1/dids response"); 331 + DIDCeremonyError::DidCreationFailed 332 + })?; 336 333 337 334 // Step 6: Overwrite session-token with the upgraded full session token. 338 - keychain::store_item( 339 - "session-token", 340 - create_did_resp.session_token.as_bytes(), 341 - ) 342 - .map_err(|e| { 343 - tracing::warn!(error = %e, "failed to persist upgraded session-token to keychain"); 344 - DIDCeremonyError::KeychainError 345 - })?; 335 + keychain::store_item("session-token", create_did_resp.session_token.as_bytes()).map_err( 336 + |e| { 337 + tracing::warn!(error = %e, "failed to persist upgraded session-token to keychain"); 338 + DIDCeremonyError::KeychainError 339 + }, 340 + )?; 346 341 347 342 // Step 7: Persist the DID for use in subsequent app sessions. 348 343 keychain::store_item("did", create_did_resp.did.as_bytes()).map_err(|e| {