diff --git a/atrium-api/src/did_doc.rs b/atrium-api/src/did_doc.rs index 23408add..4d7b72e3 100644 --- a/atrium-api/src/did_doc.rs +++ b/atrium-api/src/did_doc.rs @@ -39,6 +39,12 @@ impl DidDocument { pub fn get_pds_endpoint(&self) -> Option { self.get_service_endpoint("#atproto_pds", "AtprotoPersonalDataServer") } + pub fn get_feed_gen_endpoint(&self) -> Option { + self.get_service_endpoint("#bsky_fg", "BskyFeedGenerator") + } + pub fn get_notif_endpoint(&self) -> Option { + self.get_service_endpoint("#bsky_notif", "BskyNotificationService") + } fn get_service_endpoint(&self, id: &str, r#type: &str) -> Option { let full_id = self.id.to_string() + id; if let Some(services) = &self.service { @@ -62,4 +68,11 @@ impl DidDocument { }) .unwrap_or_default() } + pub fn get_signing_key(&self) -> Option<&VerificationMethod> { + self.verification_method.as_ref().and_then(|methods| { + methods.iter().find(|method| { + method.id == "#atproto" || method.id == format!("{}#atproto", self.id) + }) + }) + } }