An easy-to-host PDS on the ATProtocol, MacOS. Grandma-approved.

style: format create_did.rs per rustfmt standards

authored by malpercio.dev and committed by

Tangled 01b69050 cca03929

+19 -8
+19 -8
crates/relay/src/routes/create_did.rs
··· 94 94 })?; 95 95 96 96 // Step 5: Verify the ECDSA signature and derive the DID. 97 - let verified = 98 - crypto::verify_genesis_op(&signed_op_str, &rotation_key).map_err(|e| { 99 - tracing::warn!(error = %e, "genesis op verification failed"); 100 - ApiError::new(ErrorCode::InvalidClaim, format!("invalid signed genesis op: {e}")) 101 - })?; 97 + let verified = crypto::verify_genesis_op(&signed_op_str, &rotation_key).map_err(|e| { 98 + tracing::warn!(error = %e, "genesis op verification failed"); 99 + ApiError::new( 100 + ErrorCode::InvalidClaim, 101 + format!("invalid signed genesis op: {e}"), 102 + ) 103 + })?; 102 104 103 105 // Step 6: Semantic validation — ensure op fields match account and server config. 104 106 if verified.rotation_keys.first().map(String::as_str) != Some(&payload.rotation_key_public) { ··· 180 182 .await 181 183 .map_err(|e| { 182 184 tracing::error!(error = %e, plc_url = %plc_url, "failed to contact plc.directory"); 183 - ApiError::new(ErrorCode::PlcDirectoryError, "failed to contact plc.directory") 185 + ApiError::new( 186 + ErrorCode::PlcDirectoryError, 187 + "failed to contact plc.directory", 188 + ) 184 189 })?; 185 190 186 191 if !response.status().is_success() { ··· 295 300 .verification_methods 296 301 .get("atproto") 297 302 .ok_or_else(|| { 298 - ApiError::new(ErrorCode::InternalError, "atproto verification method not found in op") 303 + ApiError::new( 304 + ErrorCode::InternalError, 305 + "atproto verification method not found in op", 306 + ) 299 307 })?; 300 308 let public_key_multibase = atproto_did_key.strip_prefix("did:key:").ok_or_else(|| { 301 - ApiError::new(ErrorCode::InternalError, "atproto key is not a did:key: URI") 309 + ApiError::new( 310 + ErrorCode::InternalError, 311 + "atproto key is not a did:key: URI", 312 + ) 302 313 })?; 303 314 304 315 let service_endpoint = verified.atproto_pds_endpoint.as_deref().unwrap_or_default();