This repository has no description
0

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
dawn
date (Jul 31, 2026, 10:53 PM +0300) commit 6921d96e parent c3275cae change-id mqsllrou
+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::{ ··· 253 253 .route( 254 254 "/xrpc/sh.tangled.spindle.countSpindles", 255 255 get(count_spindles), 256 + ) 257 + .route( 258 + "/xrpc/sh.tangled.publicKey.getPublicKey", 259 + get(get_public_key), 256 260 ) 257 261 .route("/xrpc/sh.tangled.publicKey.listKeys", get(list_public_keys)) 258 262 .route( ··· 625 629 #[derive(Debug, Deserialize)] 626 630 struct GetPullQuery { 627 631 pull: AtUri<DefaultStr>, 632 + } 633 + 634 + #[derive(Debug, Deserialize)] 635 + struct GetPublicKeyQuery { 636 + #[serde(rename = "publicKey")] 637 + public_key: AtUri<DefaultStr>, 628 638 } 629 639 630 640 #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq)] ··· 1315 1325 ) -> Result<Json<Deduped<PullGetRecordOutput<DefaultStr>>>, XrpcError> { 1316 1326 let (body, value) = fetch::<PullRecord, Pull<DefaultStr>>(&state, &q.pull).await?; 1317 1327 Ok(Json(Deduped(PullGetRecordOutput { 1328 + cid: Some(body.cid.clone()), 1329 + uri: body.uri.clone(), 1330 + value, 1331 + }))) 1332 + } 1333 + 1334 + async fn get_public_key( 1335 + State(state): State<AppState>, 1336 + XrpcQuery(q): XrpcQuery<GetPublicKeyQuery>, 1337 + ) -> Result<Json<Deduped<PublicKeyGetRecordOutput<DefaultStr>>>, XrpcError> { 1338 + let (body, value) = 1339 + fetch::<PublicKeyRecord, PublicKey<DefaultStr>>(&state, &q.public_key).await?; 1340 + Ok(Json(Deduped(PublicKeyGetRecordOutput { 1318 1341 cid: Some(body.cid.clone()), 1319 1342 uri: body.uri.clone(), 1320 1343 value,
+1
flake.nix
··· 411 411 fenix.packages.${system}.stable.rust-src 412 412 fenix.packages.${system}.stable.clippy 413 413 fenix.packages.${system}.stable.rustfmt 414 + fenix.packages.${system}.stable.rust-analyzer 414 415 fenix.packages.${system}.targets.wasm32-unknown-unknown.stable.rust-std 415 416 ]) 416 417 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 + }