atproto pds in zig pds.zat.dev
pds atproto
24

Configure Feed

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

Use zat signCommit for repo commits

zzstoatzz (Jul 2, 2026, 9:46 PM -0500) 29fd5e22 93757b42

+11 -19
+2 -2
build.zig.zon
··· 5 5 .minimum_zig_version = "0.16.0", 6 6 .dependencies = .{ 7 7 .zat = .{ 8 - .url = "https://tangled.org/zat.dev/zat/archive/v0.3.9.tar.gz", 9 - .hash = "zat-0.3.9-5PuC7v6aCgDbfEdNEUxbSbbpq27V5upmAsa6J-kqdCXx", 8 + .url = "https://tangled.org/zat.dev/zat/archive/v0.3.10.tar.gz", 9 + .hash = "zat-0.3.10-5PuC7rnoCgBcN3vEheCoTrbqOeLkGe8TuNpnP2jypNP6", 10 10 }, 11 11 .zqlite = .{ 12 12 .url = "git+https://github.com/karlseguin/zqlite.zig?ref=master#05a88d6758753e1c63fdd45b211dde2057094b0c",
+9 -17
src/storage/store.zig
··· 4766 4766 prev_cid_raw: ?[]const u8, 4767 4767 keypair: *const zat.Keypair, 4768 4768 ) !SignedCommit { 4769 - var unsigned_entries = try allocator.alloc(zat.cbor.Value.MapEntry, 5); 4770 - unsigned_entries[0] = .{ .key = "did", .value = .{ .text = did } }; 4771 - unsigned_entries[1] = .{ .key = "version", .value = .{ .unsigned = 3 } }; 4772 - unsigned_entries[2] = .{ .key = "data", .value = .{ .cid = data_cid } }; 4773 - unsigned_entries[3] = .{ .key = "rev", .value = .{ .text = rev } }; 4774 - unsigned_entries[4] = .{ .key = "prev", .value = if (prev_cid_raw) |raw| .{ .cid = .{ .raw = raw } } else .null }; 4775 - const unsigned_value: zat.cbor.Value = .{ .map = unsigned_entries }; 4776 - const unsigned_bytes = try zat.cbor.encodeAlloc(allocator, unsigned_value); 4777 - const sig = try keypair.sign(unsigned_bytes); 4778 - 4779 - var signed_entries = try allocator.alloc(zat.cbor.Value.MapEntry, 6); 4780 - @memcpy(signed_entries[0..5], unsigned_entries); 4781 - signed_entries[5] = .{ .key = "sig", .value = .{ .bytes = &sig.bytes } }; 4782 - const signed_bytes = try zat.cbor.encodeAlloc(allocator, .{ .map = signed_entries }); 4783 - const commit_cid = try zat.cbor.Cid.forDagCbor(allocator, signed_bytes); 4769 + const signed = try zat.signCommit(allocator, .{ 4770 + .did = did, 4771 + .rev = rev, 4772 + .data = data_cid, 4773 + .prev = if (prev_cid_raw) |raw| .{ .raw = raw } else null, 4774 + }, keypair); 4775 + defer allocator.free(signed.cid.raw); 4784 4776 return .{ 4785 - .cid = try cidText(allocator, commit_cid.raw), 4786 - .data = signed_bytes, 4777 + .cid = try cidText(allocator, signed.cid.raw), 4778 + .data = signed.bytes, 4787 4779 }; 4788 4780 } 4789 4781