Monorepo for Tangled tangled.org
3

Configure Feed

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

bobbin: add sh.tangled.publicKey.getPublicKey

mimicing getIssue/getStar etc.

Signed-off-by: oppiliappan <me@oppi.li>

author
oppiliappan
committer
Tangled
date (Jul 24, 2026, 9:09 PM +0300) commit 24e4c43f parent dfdf4d6f change-id vmuynxls
+66 -1
+24 -1
bobbin/crates/xrpc/src/lib.rs
··· 58 58 Status as PipelineStatus, StatusRecord as PipelineStatusRecord, 59 59 }; 60 60 use bobbin_types::sh_tangled::pipeline::{Pipeline, PipelineRecord}; 61 - use bobbin_types::sh_tangled::public_key::{PublicKey, PublicKeyRecord}; 61 + use bobbin_types::sh_tangled::public_key::{PublicKey, PublicKeyGetRecordOutput, PublicKeyRecord}; 62 62 use bobbin_types::sh_tangled::repo::artifact::{Artifact, ArtifactRecord}; 63 63 use bobbin_types::sh_tangled::repo::collaborator::{Collaborator, CollaboratorRecord}; 64 64 use bobbin_types::sh_tangled::repo::issue::state::{ ··· 242 242 .route( 243 243 "/xrpc/sh.tangled.spindle.countSpindles", 244 244 get(count_spindles), 245 + ) 246 + .route( 247 + "/xrpc/sh.tangled.publicKey.getPublicKey", 248 + get(get_public_key), 245 249 ) 246 250 .route("/xrpc/sh.tangled.publicKey.listKeys", get(list_public_keys)) 247 251 .route( ··· 613 617 #[derive(Debug, Deserialize)] 614 618 struct GetPullQuery { 615 619 pull: AtUri<DefaultStr>, 620 + } 621 + 622 + #[derive(Debug, Deserialize)] 623 + struct GetPublicKeyQuery { 624 + #[serde(rename = "publicKey")] 625 + public_key: AtUri<DefaultStr>, 616 626 } 617 627 618 628 #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq)] ··· 1303 1313 ) -> Result<Json<Deduped<PullGetRecordOutput<DefaultStr>>>, XrpcError> { 1304 1314 let (body, value) = fetch::<PullRecord, Pull<DefaultStr>>(&state, &q.pull).await?; 1305 1315 Ok(Json(Deduped(PullGetRecordOutput { 1316 + cid: Some(body.cid.clone()), 1317 + uri: body.uri.clone(), 1318 + value, 1319 + }))) 1320 + } 1321 + 1322 + async fn get_public_key( 1323 + State(state): State<AppState>, 1324 + XrpcQuery(q): XrpcQuery<GetPublicKeyQuery>, 1325 + ) -> Result<Json<Deduped<PublicKeyGetRecordOutput<DefaultStr>>>, XrpcError> { 1326 + let (body, value) = 1327 + fetch::<PublicKeyRecord, PublicKey<DefaultStr>>(&state, &q.public_key).await?; 1328 + Ok(Json(Deduped(PublicKeyGetRecordOutput { 1306 1329 cid: Some(body.cid.clone()), 1307 1330 uri: body.uri.clone(), 1308 1331 value,
+1
flake.nix
··· 397 397 fenix.packages.${system}.stable.rust-src 398 398 fenix.packages.${system}.stable.clippy 399 399 fenix.packages.${system}.stable.rustfmt 400 + fenix.packages.${system}.stable.rust-analyzer 400 401 fenix.packages.${system}.targets.wasm32-unknown-unknown.stable.rust-std 401 402 ]) 402 403 pkgs.coreutils # for those of us who are on systems that use busybox (alpine)
+41
lexicons/publicKey/getPublicKey.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "sh.tangled.publicKey.getPublicKey", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "parameters": { 8 + "type": "params", 9 + "required": ["publicKey"], 10 + "properties": { 11 + "publicKey": { 12 + "type": "string", 13 + "format": "at-uri", 14 + "description": "AT-URI of the sh.tangled.publicKey record to fetch." 15 + } 16 + } 17 + }, 18 + "output": { 19 + "encoding": "application/json", 20 + "schema": { 21 + "type": "object", 22 + "required": ["uri", "value"], 23 + "properties": { 24 + "uri": { 25 + "type": "string", 26 + "format": "at-uri" 27 + }, 28 + "cid": { 29 + "type": "string", 30 + "format": "cid" 31 + }, 32 + "value": { 33 + "type": "unknown", 34 + "description": "Embedded sh.tangled.publicKey record." 35 + } 36 + } 37 + } 38 + } 39 + } 40 + } 41 + }