Parakeet is a Rust-based Bluesky AppServer aiming to implement most of the functionality required to support the Bluesky client
appview atproto bluesky rust appserver
66
fork

Configure Feed

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

chore: a few formatting and clippy fixes

Mia a44c3614 2bc182b1

+16 -12
+1 -1
consumer/src/utils.rs
··· 2 2 use serde::{Deserialize, Deserializer, Serialize, Serializer}; 3 3 4 4 // see https://deer.social/profile/did:plc:63y3oh7iakdueqhlj6trojbq/post/3ltuv4skhqs2h 5 - pub fn safe_string<'de, D: Deserializer<'de>>(deserializer: D) -> Result<String, D::Error> { 5 + pub fn safe_string<'de, D: Deserializer<'de>>(deserializer: D) -> Result<String, D::Error> { 6 6 let str = String::deserialize(deserializer)?; 7 7 8 8 Ok(str.replace('\u{0000}', ""))
+2 -2
lexica/src/app_bsky/actor.rs
··· 48 48 "all" => Ok(ChatAllowIncoming::All), 49 49 "none" => Ok(ChatAllowIncoming::None), 50 50 "following" => Ok(ChatAllowIncoming::Following), 51 - x => Err(format!("Unrecognized variant {}", x)), 51 + x => Err(format!("Unrecognized variant {x}")), 52 52 } 53 53 } 54 54 } ··· 74 74 fn from_str(s: &str) -> Result<Self, Self::Err> { 75 75 match s { 76 76 "app.bsky.actor.status#live" => Ok(Status::Live), 77 - x => Err(format!("Unrecognized variant {}", x)), 77 + x => Err(format!("Unrecognized variant {x}")), 78 78 } 79 79 } 80 80 }
+3 -3
lexica/src/com_atproto/label.rs
··· 49 49 "inform" => Ok(Severity::Inform), 50 50 "alert" => Ok(Severity::Alert), 51 51 "none" => Ok(Severity::None), 52 - x => Err(format!("Unrecognized variant {}", x)), 52 + x => Err(format!("Unrecognized variant {x}")), 53 53 } 54 54 } 55 55 } ··· 80 80 "content" => Ok(Blurs::Content), 81 81 "media" => Ok(Blurs::Media), 82 82 "none" => Ok(Blurs::None), 83 - x => Err(format!("Unrecognized variant {}", x)), 83 + x => Err(format!("Unrecognized variant {x}")), 84 84 } 85 85 } 86 86 } ··· 119 119 "warn" => Ok(LabelDefaultSetting::Warn), 120 120 "hide" => Ok(LabelDefaultSetting::Hide), 121 121 "show" => Ok(LabelDefaultSetting::Show), 122 - x => Err(format!("Unrecognized variant {}", x)), 122 + x => Err(format!("Unrecognized variant {x}")), 123 123 } 124 124 } 125 125 }
+2 -2
lexica/src/com_atproto/moderation.rs
··· 46 46 "com.atproto.moderation.defs#reasonRude" => Ok(ReasonType::Rude), 47 47 "com.atproto.moderation.defs#reasonOther" => Ok(ReasonType::Other), 48 48 "com.atproto.moderation.defs#reasonAppeal" => Ok(ReasonType::Appeal), 49 - x => Err(format!("Unrecognized variant {}", x)), 49 + x => Err(format!("Unrecognized variant {x}")), 50 50 } 51 51 } 52 52 } ··· 77 77 "account" => Ok(SubjectType::Account), 78 78 "record" => Ok(SubjectType::Record), 79 79 "chat" => Ok(SubjectType::Chat), 80 - x => Err(format!("Unrecognized variant {}", x)), 80 + x => Err(format!("Unrecognized variant {x}")), 81 81 } 82 82 } 83 83 }
+8 -4
parakeet/src/xrpc/extract.rs
··· 83 83 84 84 match state.jwt.resolve_and_verify_jwt(hdr.token()).await { 85 85 Some(claims) => match &state.did_allowlist { 86 - Some(allowlist) if !allowlist.contains(&claims.iss) => Err((StatusCode::FORBIDDEN, "forbidden".to_string())), 87 - _ => Ok(AtpAuth(claims.iss)) 86 + Some(allowlist) if !allowlist.contains(&claims.iss) => { 87 + Err((StatusCode::FORBIDDEN, "forbidden".to_string())) 88 + } 89 + _ => Ok(AtpAuth(claims.iss)), 88 90 }, 89 91 None => Err((StatusCode::INTERNAL_SERVER_ERROR, "JWT error".to_string())), 90 92 } ··· 110 112 111 113 match state.jwt.resolve_and_verify_jwt(hdr.token()).await { 112 114 Some(claims) => match &state.did_allowlist { 113 - Some(allowlist) if !allowlist.contains(&claims.iss) => Err((StatusCode::FORBIDDEN, "forbidden".to_string())), 114 - _ => Ok(Some(AtpAuth(claims.iss))) 115 + Some(allowlist) if !allowlist.contains(&claims.iss) => { 116 + Err((StatusCode::FORBIDDEN, "forbidden".to_string())) 117 + } 118 + _ => Ok(Some(AtpAuth(claims.iss))), 115 119 }, 116 120 None => Err((StatusCode::INTERNAL_SERVER_ERROR, "JWT error".to_string())), 117 121 }