tangled
alpha
login
or
join now
hotsocket.fyi
/
microcosm-rs
forked from
microcosm.blue/microcosm-rs
0
fork
atom
Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
0
fork
atom
overview
issues
pulls
pipelines
debugging serviceEndpoint casing lksdfjlkasdj
bad-example.com
6 months ago
4e0bca48
d42f70cf
+20
-7
2 changed files
expand all
collapse all
unified
split
pocket
src
server.rs
reflector
src
main.rs
+19
-7
pocket/src/server.rs
···
94
94
verifier: TokenVerifier,
95
95
}
96
96
97
97
+
// app.bsky.actor.getPreferences
98
98
+
// com.bad-example.pocket.getPreferences
99
99
+
97
100
#[OpenApi]
98
101
impl Xrpc {
99
102
/// com.bad-example.pocket.getPreferences
100
103
///
101
104
/// get stored bluesky prefs
102
105
#[oai(
103
103
-
path = "/com.bad-example.pocket.getPreferences",
106
106
+
path = "/app.bsky.actor.getPreferences",
104
107
method = "get",
105
108
tag = "ApiTags::Pocket"
106
109
)]
···
156
159
#[derive(Debug, Clone, Serialize)]
157
160
struct AppViewDoc {
158
161
id: String,
159
159
-
service: [AppViewService; 1],
162
162
+
service: [AppViewService; 2],
160
163
}
161
164
/// Serve a did document for did:web for this to be an xrpc appview
162
165
fn get_did_doc(domain: &str) -> impl Endpoint + use<> {
163
166
let doc = poem::web::Json(AppViewDoc {
164
167
id: format!("did:web:{domain}"),
165
165
-
service: [AppViewService {
166
166
-
id: "#pocket_prefs".to_string(),
167
167
-
r#type: "PocketPreferences".to_string(),
168
168
-
service_endpoint: format!("https://{domain}"),
169
169
-
}],
168
168
+
service: [
169
169
+
AppViewService {
170
170
+
id: "#pocket_prefs".to_string(),
171
171
+
// id: "#bsky_appview".to_string(),
172
172
+
r#type: "PocketPreferences".to_string(),
173
173
+
service_endpoint: format!("https://{domain}"),
174
174
+
},
175
175
+
AppViewService {
176
176
+
id: "#bsky_appview".to_string(),
177
177
+
// id: "#bsky_appview".to_string(),
178
178
+
r#type: "BlueskyAppview".to_string(),
179
179
+
service_endpoint: format!("https://{domain}"),
180
180
+
},
181
181
+
],
170
182
});
171
183
make_sync(move |_| doc.clone())
172
184
}
+1
reflector/src/main.rs
···
20
20
}
21
21
22
22
#[derive(Debug, Clone, Serialize)]
23
23
+
#[serde(rename_all = "camelCase")]
23
24
struct DidService {
24
25
id: String,
25
26
r#type: String,