atproto utils for zig zat.dev
atproto sdk zig

docs: collapsible sections in readme, add MIT license

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Changed files
+48 -16
+21
LICENSE
··· 1 + MIT License 2 + 3 + Copyright (c) 2025 nate nowack 4 + 5 + Permission is hereby granted, free of charge, to any person obtaining a copy 6 + of this software and associated documentation files (the "Software"), to deal 7 + in the Software without restriction, including without limitation the rights 8 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 + copies of the Software, and to permit persons to whom the Software is 10 + furnished to do so, subject to the following conditions: 11 + 12 + The above copyright notice and this permission notice shall be included in all 13 + copies or substantial portions of the Software. 14 + 15 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 + SOFTWARE.
+27 -16
README.md
··· 5 5 ## install 6 6 7 7 ```bash 8 - zig fetch --save https://tangled.org/zzstoatzz.io/zat/archive/main 8 + zig fetch --save https://tangled.sh/zzstoatzz.io/zat/archive/main 9 9 ``` 10 10 11 11 then in `build.zig`: ··· 17 17 18 18 ## what's here 19 19 20 - ### string primitives 21 - 22 - parsing and validation for atproto string identifiers: 20 + <details> 21 + <summary><strong>string primitives</strong> - parsing and validation for atproto identifiers</summary> 23 22 24 23 - **Tid** - timestamp identifiers (base32-sortable) 25 24 - **Did** - decentralized identifiers ··· 38 37 } 39 38 ``` 40 39 41 - ### did resolution 40 + </details> 42 41 43 - resolve `did:plc` and `did:web` identifiers to their documents: 42 + <details> 43 + <summary><strong>did resolution</strong> - resolve did:plc and did:web to documents</summary> 44 44 45 45 ```zig 46 46 var resolver = zat.DidResolver.init(allocator); ··· 55 55 const key = doc.signingKey(); // verification method 56 56 ``` 57 57 58 - ### handle resolution 58 + </details> 59 59 60 - resolve handles to DIDs via HTTP well-known: 60 + <details> 61 + <summary><strong>handle resolution</strong> - resolve handles to DIDs via HTTP well-known</summary> 61 62 62 63 ```zig 63 64 var resolver = zat.HandleResolver.init(allocator); ··· 69 70 // did = "did:plc:z72i7hdynmk6r22z27h6tvur" 70 71 ``` 71 72 72 - ### xrpc client 73 + </details> 73 74 74 - call AT Protocol endpoints: 75 + <details> 76 + <summary><strong>xrpc client</strong> - call AT Protocol endpoints</summary> 75 77 76 78 ```zig 77 79 var client = zat.XrpcClient.init(allocator, "https://bsky.social"); ··· 88 90 } 89 91 ``` 90 92 91 - ### json helpers 93 + </details> 92 94 93 - navigate nested json without verbose if-chains: 95 + <details> 96 + <summary><strong>json helpers</strong> - navigate nested json without verbose if-chains</summary> 94 97 95 98 ```zig 96 99 // runtime paths for one-offs: ··· 108 111 const post = try zat.json.extractAt(FeedPost, allocator, value, .{"post"}); 109 112 ``` 110 113 111 - ### jwt verification 114 + </details> 112 115 113 - verify service auth tokens: 116 + <details> 117 + <summary><strong>jwt verification</strong> - verify service auth tokens</summary> 114 118 115 119 ```zig 116 120 var jwt = try zat.Jwt.parse(allocator, token_string); ··· 126 130 127 131 supports ES256 (P-256) and ES256K (secp256k1) signing algorithms. 128 132 129 - ### multibase decoding 133 + </details> 130 134 131 - decode public keys from DID documents: 135 + <details> 136 + <summary><strong>multibase decoding</strong> - decode public keys from DID documents</summary> 132 137 133 138 ```zig 134 139 const key_bytes = try zat.multibase.decode(allocator, "zQ3sh..."); ··· 139 144 // parsed.raw: 33-byte compressed public key 140 145 ``` 141 146 147 + </details> 148 + 142 149 ## specs 143 150 144 151 validation follows [atproto.com/specs](https://atproto.com/specs/atp). 152 + 153 + ## license 154 + 155 + MIT