···
endpoint::{StaticFileEndpoint, make_sync},
-
middleware::{CatchPanic, Cors, Tracing},
ApiResponse, ContactObject, ExternalDocumentObject, Object, OpenApi, OpenApiService,
···
-
// app.bsky.actor.getPreferences
-
// com.bad-example.pocket.getPreferences
/// com.bad-example.pocket.getPreferences
-
/// get stored bluesky prefs
-
path = "/app.bsky.actor.getPreferences",
-
async fn app_bsky_get_prefs(&self, XrpcAuth(auth): XrpcAuth) -> GetBskyPrefsResponse {
let (did, aud) = match self
-
.verify("app.bsky.actor.getPreferences", &auth.token)
···
-
async fn app_bsky_put_prefs(
XrpcAuth(auth): XrpcAuth,
Json(prefs): Json<Value>,
) -> PutBskyPrefsResponse {
let (did, aud) = match self
-
.verify("app.bsky.actor.getPreferences", &auth.token)
···
id: "#pocket_prefs".to_string(),
-
// id: "#bsky_appview".to_string(),
r#type: "PocketPreferences".to_string(),
service_endpoint: format!("https://{domain}"),
id: "#bsky_appview".to_string(),
-
// 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"))
.allow_method(Method::GET)
···
endpoint::{StaticFileEndpoint, make_sync},
+
middleware::{CatchPanic, Cors, SizeLimit, Tracing},
ApiResponse, ContactObject, ExternalDocumentObject, Object, OpenApi, OpenApiService,
···
/// com.bad-example.pocket.getPreferences
+
/// get stored preferencess
+
path = "/com.bad-example.pocket.getPreferences",
+
async fn pocket_get_prefs(&self, XrpcAuth(auth): XrpcAuth) -> GetBskyPrefsResponse {
let (did, aud) = match self
+
.verify("com.bad-example.pocket.getPreferences", &auth.token)
···
+
async fn pocket_put_prefs(
XrpcAuth(auth): XrpcAuth,
Json(prefs): Json<Value>,
) -> PutBskyPrefsResponse {
let (did, aud) = match self
+
.verify("com.bad-example.pocket.putPreferences", &auth.token)
···
id: "#pocket_prefs".to_string(),
r#type: "PocketPreferences".to_string(),
service_endpoint: format!("https://{domain}"),
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"))
+
.with(SizeLimit::new(100 * 2_usize.pow(10)))
.allow_method(Method::GET)