···
endpoint::{StaticFileEndpoint, make_sync},
7
-
middleware::{CatchPanic, Cors, Tracing},
7
+
middleware::{CatchPanic, Cors, SizeLimit, Tracing},
ApiResponse, ContactObject, ExternalDocumentObject, Object, OpenApi, OpenApiService,
···
97
-
// app.bsky.actor.getPreferences
98
-
// com.bad-example.pocket.getPreferences
/// com.bad-example.pocket.getPreferences
104
-
/// get stored bluesky prefs
101
+
/// get stored preferencess
106
-
path = "/app.bsky.actor.getPreferences",
103
+
path = "/com.bad-example.pocket.getPreferences",
110
-
async fn app_bsky_get_prefs(&self, XrpcAuth(auth): XrpcAuth) -> GetBskyPrefsResponse {
107
+
async fn pocket_get_prefs(&self, XrpcAuth(auth): XrpcAuth) -> GetBskyPrefsResponse {
let (did, aud) = match self
113
-
.verify("app.bsky.actor.getPreferences", &auth.token)
110
+
.verify("com.bad-example.pocket.getPreferences", &auth.token)
···
132
-
async fn app_bsky_put_prefs(
129
+
async fn pocket_put_prefs(
XrpcAuth(auth): XrpcAuth,
Json(prefs): Json<Value>,
) -> PutBskyPrefsResponse {
let (did, aud) = match self
139
-
.verify("app.bsky.actor.getPreferences", &auth.token)
136
+
.verify("com.bad-example.pocket.putPreferences", &auth.token)
···
id: "#pocket_prefs".to_string(),
171
-
// id: "#bsky_appview".to_string(),
r#type: "PocketPreferences".to_string(),
service_endpoint: format!("https://{domain}"),
id: "#bsky_appview".to_string(),
177
-
// id: "#bsky_appview".to_string(),
r#type: "BlueskyAppview".to_string(),
service_endpoint: format!("https://{domain}"),
···
.nest("/xrpc/", api_service)
.at("/.well-known/did.json", get_did_doc(domain))
.at("/", StaticFileEndpoint::new("./static/index.html"))
199
+
.with(SizeLimit::new(100 * 2_usize.pow(10)))
.allow_method(Method::GET)