at main 29 lines 879 B view raw
1//! com.atproto.identity.* endpoint handlers 2 3use axum::{Json, extract::State}; 4use jacquard::IntoStatic; 5use jacquard::types::ident::AtIdentifier; 6use jacquard_axum::ExtractXrpc; 7use weaver_api::com_atproto::identity::resolve_handle::{ 8 ResolveHandleOutput, ResolveHandleRequest, 9}; 10 11use crate::endpoints::actor::resolve_actor; 12use crate::endpoints::repo::XrpcErrorResponse; 13use crate::server::AppState; 14 15/// Handle com.atproto.identity.resolveHandle 16pub async fn resolve_handle( 17 State(state): State<AppState>, 18 ExtractXrpc(args): ExtractXrpc<ResolveHandleRequest>, 19) -> Result<Json<ResolveHandleOutput<'static>>, XrpcErrorResponse> { 20 let did = resolve_actor(&state, &AtIdentifier::Handle(args.handle)).await?; 21 22 Ok(Json( 23 ResolveHandleOutput { 24 did: did.into_static(), 25 extra_data: None, 26 } 27 .into_static(), 28 )) 29}