A better Rust ATProto crate

some niceties for agent session

Orual 220b03d3 5ac10ae3

Changed files
+19 -5
crates
jacquard
src
+19 -5
crates/jacquard/src/client.rs
··· 27 27 28 28 use crate::client::credential_session::{CredentialSession, SessionKey}; 29 29 30 - pub(crate) const NSID_REFRESH_SESSION: &str = "com.atproto.server.refreshSession"; 31 - 32 - /// Basic client wrapper: reqwest transport + in-memory session store. 33 - pub struct BasicClient(); //AtClient<reqwest::Client, MemorySessionStore<Did<'static>, AuthSession>>); 34 - 35 30 /// App password session information from `com.atproto.server.createSession` 36 31 /// 37 32 /// Contains the access and refresh tokens along with user identity information. ··· 256 251 async move { self.inner.send(request).await } 257 252 } 258 253 } 254 + 255 + impl<A: AgentSession> From<A> for Agent<A> { 256 + fn from(inner: A) -> Self { 257 + Self::new(inner) 258 + } 259 + } 260 + 261 + /// Alias for an agent over a credential (app‑password) session. 262 + pub type CredentialAgent<S, T> = Agent<CredentialSession<S, T>>; 263 + /// Alias for an agent over an OAuth (DPoP) session. 264 + pub type OAuthAgent<T, S> = Agent<OAuthSession<T, S>>; 265 + 266 + /// BasicClient: in-memory store + public resolver over a credential session. 267 + pub type BasicClient = Agent< 268 + CredentialSession< 269 + MemorySessionStore<SessionKey, AtpSession>, 270 + jacquard_identity::PublicResolver, 271 + >, 272 + >;