A better Rust ATProto crate
101
fork

Configure Feed

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

examples all working, axum shit deferred

+106 -662
+31 -578
Cargo.lock
··· 176 176 177 177 [[package]] 178 178 name = "arrayvec" 179 - version = "0.5.2" 180 - source = "registry+https://github.com/rust-lang/crates.io-index" 181 - checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" 182 - 183 - [[package]] 184 - name = "arrayvec" 185 179 version = "0.7.6" 186 180 source = "registry+https://github.com/rust-lang/crates.io-index" 187 181 checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" ··· 254 248 "aligned", 255 249 "anyhow", 256 250 "arg_enum_proc_macro", 257 - "arrayvec 0.7.6", 251 + "arrayvec", 258 252 "log", 259 253 "num-rational", 260 254 "num-traits", ··· 272 266 checksum = "8cfddb07216410377231960af4fcab838eaa12e013417781b78bd95ee22077f8" 273 267 dependencies = [ 274 268 "anyhow", 275 - "arrayvec 0.7.6", 269 + "arrayvec", 276 270 "log", 277 271 "nom", 278 272 "num-rational", ··· 285 279 source = "registry+https://github.com/rust-lang/crates.io-index" 286 280 checksum = "375082f007bd67184fb9c0374614b29f9aaa604ec301635f72338bb65386a53d" 287 281 dependencies = [ 288 - "arrayvec 0.7.6", 289 - ] 290 - 291 - [[package]] 292 - name = "axum" 293 - version = "0.8.8" 294 - source = "registry+https://github.com/rust-lang/crates.io-index" 295 - checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" 296 - dependencies = [ 297 - "axum-core", 298 - "bytes", 299 - "form_urlencoded", 300 - "futures-util", 301 - "http", 302 - "http-body", 303 - "http-body-util", 304 - "hyper", 305 - "hyper-util", 306 - "itoa", 307 - "matchit", 308 - "memchr", 309 - "mime", 310 - "percent-encoding", 311 - "pin-project-lite", 312 - "serde_core", 313 - "serde_json", 314 - "serde_path_to_error", 315 - "serde_urlencoded", 316 - "sync_wrapper", 317 - "tokio", 318 - "tower", 319 - "tower-layer", 320 - "tower-service", 321 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 322 - ] 323 - 324 - [[package]] 325 - name = "axum-core" 326 - version = "0.5.6" 327 - source = "registry+https://github.com/rust-lang/crates.io-index" 328 - checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" 329 - dependencies = [ 330 - "bytes", 331 - "futures-core", 332 - "http", 333 - "http-body", 334 - "http-body-util", 335 - "mime", 336 - "pin-project-lite", 337 - "sync_wrapper", 338 - "tower-layer", 339 - "tower-service", 340 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 341 - ] 342 - 343 - [[package]] 344 - name = "axum-macros" 345 - version = "0.5.0" 346 - source = "registry+https://github.com/rust-lang/crates.io-index" 347 - checksum = "604fde5e028fea851ce1d8570bbdc034bec850d157f7569d10f347d06808c05c" 348 - dependencies = [ 349 - "proc-macro2", 350 - "quote", 351 - "syn", 352 - ] 353 - 354 - [[package]] 355 - name = "axum-test" 356 - version = "18.7.0" 357 - source = "registry+https://github.com/rust-lang/crates.io-index" 358 - checksum = "0ce2a8627e8d8851f894696b39f2b67807d6375c177361d376173ace306a21e2" 359 - dependencies = [ 360 - "anyhow", 361 - "axum", 362 - "bytes", 363 - "bytesize", 364 - "cookie", 365 - "expect-json", 366 - "http", 367 - "http-body-util", 368 - "hyper", 369 - "hyper-util", 370 - "mime", 371 - "pretty_assertions", 372 - "reserve-port", 373 - "rust-multipart-rfc7578_2", 374 - "serde", 375 - "serde_json", 376 - "serde_urlencoded", 377 - "smallvec", 378 - "tokio", 379 - "tower", 380 - "url", 282 + "arrayvec", 381 283 ] 382 284 383 285 [[package]] ··· 445 347 checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" 446 348 447 349 [[package]] 448 - name = "bit-set" 449 - version = "0.8.0" 450 - source = "registry+https://github.com/rust-lang/crates.io-index" 451 - checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" 452 - dependencies = [ 453 - "bit-vec", 454 - ] 455 - 456 - [[package]] 457 - name = "bit-vec" 458 - version = "0.8.0" 459 - source = "registry+https://github.com/rust-lang/crates.io-index" 460 - checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" 461 - 462 - [[package]] 463 350 name = "bit_field" 464 351 version = "0.10.3" 465 352 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 562 449 ] 563 450 564 451 [[package]] 565 - name = "buffer" 566 - version = "0.1.9" 567 - source = "registry+https://github.com/rust-lang/crates.io-index" 568 - checksum = "aab7228d32b5d95be40adeba1d9461c8547b5dadf5f9cbfba09b6d578991df28" 569 - dependencies = [ 570 - "arrayvec 0.5.2", 571 - "mac 0.0.2", 572 - ] 573 - 574 - [[package]] 575 452 name = "built" 576 453 version = "0.8.0" 577 454 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 611 488 ] 612 489 613 490 [[package]] 614 - name = "bytesize" 615 - version = "2.3.1" 616 - source = "registry+https://github.com/rust-lang/crates.io-index" 617 - checksum = "6bd91ee7b2422bcb158d90ef4d14f75ef67f340943fc4149891dcce8f8b972a3" 618 - 619 - [[package]] 620 491 name = "cast" 621 492 version = "0.3.0" 622 493 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 848 719 checksum = "2f421161cb492475f1661ddc9815a745a1c894592070661180fdec3d4872e9c3" 849 720 850 721 [[package]] 851 - name = "cookie" 852 - version = "0.18.1" 853 - source = "registry+https://github.com/rust-lang/crates.io-index" 854 - checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" 855 - dependencies = [ 856 - "time", 857 - "version_check", 858 - ] 859 - 860 - [[package]] 861 722 name = "cordyceps" 862 723 version = "0.3.4" 863 724 source = "registry+https://github.com/rust-lang/crates.io-index" 864 725 checksum = "688d7fbb8092b8de775ef2536f36c8c31f2bc4006ece2e8d8ad2d17d00ce0a2a" 865 726 dependencies = [ 866 727 "loom", 867 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 728 + "tracing", 868 729 ] 869 730 870 731 [[package]] ··· 1167 1028 version = "0.2.3" 1168 1029 source = "registry+https://github.com/rust-lang/crates.io-index" 1169 1030 checksum = "ab03c107fafeb3ee9f5925686dbb7a73bc76e3932abb0d2b365cb64b169cf04c" 1170 - 1171 - [[package]] 1172 - name = "diff" 1173 - version = "0.1.13" 1174 - source = "registry+https://github.com/rust-lang/crates.io-index" 1175 - checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" 1176 1031 1177 1032 [[package]] 1178 1033 name = "digest" ··· 1264 1119 ] 1265 1120 1266 1121 [[package]] 1267 - name = "email_address" 1268 - version = "0.2.9" 1269 - source = "registry+https://github.com/rust-lang/crates.io-index" 1270 - checksum = "e079f19b08ca6239f47f8ba8509c11cf3ea30095831f7fed61441475edd8c449" 1271 - dependencies = [ 1272 - "serde", 1273 - ] 1274 - 1275 - [[package]] 1276 1122 name = "embedded-io" 1277 1123 version = "0.4.0" 1278 1124 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1283 1129 version = "0.6.1" 1284 1130 source = "registry+https://github.com/rust-lang/crates.io-index" 1285 1131 checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" 1286 - 1287 - [[package]] 1288 - name = "embedded-io-adapters" 1289 - version = "0.6.2" 1290 - source = "registry+https://github.com/rust-lang/crates.io-index" 1291 - checksum = "90ccf22c3feffc79593914c0b4be9a2ed6b11e44cf1f84fd6b77d2ee92de0077" 1292 - dependencies = [ 1293 - "embedded-io 0.6.1", 1294 - "embedded-io-async", 1295 - "tokio", 1296 - ] 1297 - 1298 - [[package]] 1299 - name = "embedded-io-async" 1300 - version = "0.6.1" 1301 - source = "registry+https://github.com/rust-lang/crates.io-index" 1302 - checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" 1303 - dependencies = [ 1304 - "embedded-io 0.6.1", 1305 - ] 1306 1132 1307 1133 [[package]] 1308 1134 name = "encode_unicode" ··· 1358 1184 checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 1359 1185 1360 1186 [[package]] 1361 - name = "erased-serde" 1362 - version = "0.4.10" 1363 - source = "registry+https://github.com/rust-lang/crates.io-index" 1364 - checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" 1365 - dependencies = [ 1366 - "serde", 1367 - "serde_core", 1368 - "typeid", 1369 - ] 1370 - 1371 - [[package]] 1372 1187 name = "errno" 1373 1188 version = "0.3.14" 1374 1189 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1376 1191 dependencies = [ 1377 1192 "libc", 1378 1193 "windows-sys 0.61.2", 1379 - ] 1380 - 1381 - [[package]] 1382 - name = "expect-json" 1383 - version = "1.10.1" 1384 - source = "registry+https://github.com/rust-lang/crates.io-index" 1385 - checksum = "869f97f4abe8e78fc812a94ad6b721d72c4fb5532877c79610f2c238d7ccf6c4" 1386 - dependencies = [ 1387 - "chrono", 1388 - "email_address", 1389 - "expect-json-macros", 1390 - "num", 1391 - "regex", 1392 - "serde", 1393 - "serde_json", 1394 - "thiserror 2.0.18", 1395 - "typetag", 1396 - "uuid", 1397 - ] 1398 - 1399 - [[package]] 1400 - name = "expect-json-macros" 1401 - version = "1.10.1" 1402 - source = "registry+https://github.com/rust-lang/crates.io-index" 1403 - checksum = "6e6fdf550180a6c29a28cb9aac262dc0064c25735641d2317f670075e9a469d9" 1404 - dependencies = [ 1405 - "proc-macro2", 1406 - "quote", 1407 - "syn", 1408 1194 ] 1409 1195 1410 1196 [[package]] ··· 1538 1324 source = "registry+https://github.com/rust-lang/crates.io-index" 1539 1325 checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" 1540 1326 dependencies = [ 1541 - "mac 0.1.1", 1327 + "mac", 1542 1328 "new_debug_unreachable", 1543 1329 ] 1544 1330 ··· 1795 1581 "slab", 1796 1582 "tokio", 1797 1583 "tokio-util", 1798 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 1584 + "tracing", 1799 1585 ] 1800 1586 1801 1587 [[package]] ··· 1819 1605 ] 1820 1606 1821 1607 [[package]] 1822 - name = "hash32" 1823 - version = "0.3.1" 1824 - source = "registry+https://github.com/rust-lang/crates.io-index" 1825 - checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" 1826 - dependencies = [ 1827 - "byteorder", 1828 - ] 1829 - 1830 - [[package]] 1831 1608 name = "hashbrown" 1832 1609 version = "0.14.5" 1833 1610 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1857 1634 checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" 1858 1635 dependencies = [ 1859 1636 "atomic-polyfill", 1860 - "hash32 0.2.1", 1637 + "hash32", 1861 1638 "rustc_version", 1862 1639 "serde", 1863 1640 "spin 0.9.8", ··· 1865 1642 ] 1866 1643 1867 1644 [[package]] 1868 - name = "heapless" 1869 - version = "0.9.2" 1870 - source = "registry+https://github.com/rust-lang/crates.io-index" 1871 - checksum = "2af2455f757db2b292a9b1768c4b70186d443bcb3b316252d6b540aec1cd89ed" 1872 - dependencies = [ 1873 - "hash32 0.3.1", 1874 - "stable_deref_trait", 1875 - ] 1876 - 1877 - [[package]] 1878 1645 name = "heck" 1879 1646 version = "0.4.1" 1880 1647 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1918 1685 "thiserror 1.0.69", 1919 1686 "tinyvec", 1920 1687 "tokio", 1921 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 1688 + "tracing", 1922 1689 "url", 1923 1690 ] 1924 1691 ··· 1940 1707 "smallvec", 1941 1708 "thiserror 1.0.69", 1942 1709 "tokio", 1943 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 1710 + "tracing", 1944 1711 ] 1945 1712 1946 1713 [[package]] ··· 1968 1735 checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4" 1969 1736 dependencies = [ 1970 1737 "log", 1971 - "mac 0.1.1", 1738 + "mac", 1972 1739 "markup5ever", 1973 1740 "proc-macro2", 1974 1741 "quote", ··· 2034 1801 "http", 2035 1802 "http-body", 2036 1803 "httparse", 2037 - "httpdate", 2038 1804 "itoa", 2039 1805 "pin-project-lite", 2040 1806 "pin-utils", ··· 2081 1847 "system-configuration", 2082 1848 "tokio", 2083 1849 "tower-service", 2084 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 1850 + "tracing", 2085 1851 "windows-registry", 2086 1852 ] 2087 1853 ··· 2397 2163 "thiserror 2.0.18", 2398 2164 "tiff 0.6.1", 2399 2165 "tokio", 2400 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 2166 + "tracing", 2401 2167 "trait-variant", 2402 2168 "viuer", 2403 2169 "webpage", ··· 2416 2182 ] 2417 2183 2418 2184 [[package]] 2419 - name = "jacquard-axum" 2420 - version = "0.11.0" 2421 - dependencies = [ 2422 - "axum", 2423 - "axum-macros", 2424 - "axum-test", 2425 - "base64 0.22.1", 2426 - "bytes", 2427 - "chrono", 2428 - "jacquard", 2429 - "jacquard-common", 2430 - "jacquard-derive", 2431 - "jacquard-identity", 2432 - "k256", 2433 - "miette", 2434 - "multibase", 2435 - "rand 0.8.5", 2436 - "reqwest", 2437 - "serde", 2438 - "serde_html_form", 2439 - "serde_json", 2440 - "thiserror 2.0.18", 2441 - "tokio", 2442 - "tower", 2443 - "tower-http", 2444 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 2445 - "tracing-subscriber 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", 2446 - ] 2447 - 2448 - [[package]] 2449 - name = "jacquard-codegen-tests" 2450 - version = "0.0.0" 2451 - dependencies = [ 2452 - "jacquard-common", 2453 - "jacquard-derive", 2454 - "jacquard-lexicon", 2455 - "miette", 2456 - "serde", 2457 - "serde_ipld_dagcbor", 2458 - "serde_json", 2459 - "smol_str", 2460 - "thiserror 2.0.18", 2461 - ] 2462 - 2463 - [[package]] 2464 2185 name = "jacquard-common" 2465 2186 version = "0.11.0" 2466 2187 dependencies = [ ··· 2481 2202 "http", 2482 2203 "ipld-core", 2483 2204 "k256", 2484 - "maitake-sync 0.1.2", 2205 + "maitake-sync", 2485 2206 "miette", 2486 2207 "multibase", 2487 2208 "multihash", ··· 2509 2230 "tokio", 2510 2231 "tokio-tungstenite-wasm", 2511 2232 "tokio-util", 2512 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 2233 + "tracing", 2513 2234 "trait-variant", 2514 2235 "unicode-segmentation", 2515 2236 "zstd", ··· 2550 2271 "serde_json", 2551 2272 "thiserror 2.0.18", 2552 2273 "tokio", 2553 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 2274 + "tracing", 2554 2275 "trait-variant", 2555 2276 ] 2556 2277 ··· 2638 2359 "smol_str", 2639 2360 "thiserror 2.0.18", 2640 2361 "tokio", 2641 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 2362 + "tracing", 2642 2363 "trait-variant", 2643 2364 "webbrowser", 2644 2365 ] ··· 2812 2533 ] 2813 2534 2814 2535 [[package]] 2815 - name = "lazy-collections" 2816 - version = "0.11.0" 2817 - dependencies = [ 2818 - "buffer", 2819 - "bytes", 2820 - "chrono", 2821 - "embedded-io 0.6.1", 2822 - "embedded-io-adapters", 2823 - "embedded-io-async", 2824 - "heapless 0.9.2", 2825 - "lock_api", 2826 - "loom", 2827 - "maitake-sync 0.2.2", 2828 - "managed", 2829 - "miette", 2830 - "n0-future", 2831 - "pin-project", 2832 - "postcard", 2833 - "proptest", 2834 - "serde", 2835 - "serde_bytes", 2836 - "tokio", 2837 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 2838 - "tracing 0.1.44 (git+https://github.com/tokio-rs/tracing)", 2839 - "tracing-subscriber 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", 2840 - "tracing-subscriber 0.3.23 (git+https://github.com/tokio-rs/tracing)", 2841 - ] 2842 - 2843 - [[package]] 2844 2536 name = "lazy_static" 2845 2537 version = "1.5.0" 2846 2538 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2937 2629 "cfg-if", 2938 2630 "generator", 2939 2631 "scoped-tls", 2940 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 2941 - "tracing-subscriber 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", 2632 + "tracing", 2633 + "tracing-subscriber", 2942 2634 ] 2943 2635 2944 2636 [[package]] ··· 2967 2659 2968 2660 [[package]] 2969 2661 name = "mac" 2970 - version = "0.0.2" 2971 - source = "registry+https://github.com/rust-lang/crates.io-index" 2972 - checksum = "1b1db08c0d0ddbb591e65f1da58d1cefccc94a2faa0c55bf979ce215a3e04d5e" 2973 - 2974 - [[package]] 2975 - name = "mac" 2976 2662 version = "0.1.1" 2977 2663 source = "registry+https://github.com/rust-lang/crates.io-index" 2978 2664 checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" ··· 2991 2677 ] 2992 2678 2993 2679 [[package]] 2994 - name = "maitake-sync" 2995 - version = "0.2.2" 2996 - source = "registry+https://github.com/rust-lang/crates.io-index" 2997 - checksum = "748f86d9befd480b602c3bebc9ef30dbf2f3dfc8acc4a73d07b90f0117e6de3f" 2998 - dependencies = [ 2999 - "cordyceps", 3000 - "loom", 3001 - "mutex-traits", 3002 - "mycelium-bitfield", 3003 - "pin-project", 3004 - "portable-atomic", 3005 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 3006 - ] 3007 - 3008 - [[package]] 3009 - name = "managed" 3010 - version = "0.8.0" 3011 - source = "registry+https://github.com/rust-lang/crates.io-index" 3012 - checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d" 3013 - 3014 - [[package]] 3015 2680 name = "markup5ever" 3016 2681 version = "0.12.1" 3017 2682 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3056 2721 dependencies = [ 3057 2722 "regex-automata", 3058 2723 ] 3059 - 3060 - [[package]] 3061 - name = "matchit" 3062 - version = "0.8.4" 3063 - source = "registry+https://github.com/rust-lang/crates.io-index" 3064 - checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" 3065 2724 3066 2725 [[package]] 3067 2726 name = "maybe-rayon" ··· 3236 2895 ] 3237 2896 3238 2897 [[package]] 3239 - name = "mutex-traits" 3240 - version = "1.0.1" 3241 - source = "registry+https://github.com/rust-lang/crates.io-index" 3242 - checksum = "3929f2b5633d29cf7b6624992e5f3c1e9334f1193423e12d17be4faf678cde3f" 3243 - 3244 - [[package]] 3245 2898 name = "mycelium-bitfield" 3246 2899 version = "0.1.5" 3247 2900 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3752 3405 "cobs", 3753 3406 "embedded-io 0.4.0", 3754 3407 "embedded-io 0.6.1", 3755 - "heapless 0.7.17", 3408 + "heapless", 3756 3409 "serde", 3757 3410 ] 3758 3411 ··· 3785 3438 version = "0.1.1" 3786 3439 source = "registry+https://github.com/rust-lang/crates.io-index" 3787 3440 checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" 3788 - 3789 - [[package]] 3790 - name = "pretty_assertions" 3791 - version = "1.4.1" 3792 - source = "registry+https://github.com/rust-lang/crates.io-index" 3793 - checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" 3794 - dependencies = [ 3795 - "diff", 3796 - "yansi", 3797 - ] 3798 3441 3799 3442 [[package]] 3800 3443 name = "prettyplease" ··· 3857 3500 ] 3858 3501 3859 3502 [[package]] 3860 - name = "proptest" 3861 - version = "1.10.0" 3862 - source = "registry+https://github.com/rust-lang/crates.io-index" 3863 - checksum = "37566cb3fdacef14c0737f9546df7cfeadbfbc9fef10991038bf5015d0c80532" 3864 - dependencies = [ 3865 - "bit-set", 3866 - "bit-vec", 3867 - "bitflags", 3868 - "num-traits", 3869 - "rand 0.9.2", 3870 - "rand_chacha 0.9.0", 3871 - "rand_xorshift", 3872 - "regex-syntax", 3873 - "rusty-fork", 3874 - "tempfile", 3875 - "unarray", 3876 - ] 3877 - 3878 - [[package]] 3879 3503 name = "pxfm" 3880 3504 version = "0.1.28" 3881 3505 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3918 3542 "socket2 0.6.3", 3919 3543 "thiserror 2.0.18", 3920 3544 "tokio", 3921 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 3545 + "tracing", 3922 3546 "web-time", 3923 3547 ] 3924 3548 ··· 3939 3563 "slab", 3940 3564 "thiserror 2.0.18", 3941 3565 "tinyvec", 3942 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 3566 + "tracing", 3943 3567 "web-time", 3944 3568 ] 3945 3569 ··· 3953 3577 "libc", 3954 3578 "once_cell", 3955 3579 "socket2 0.6.3", 3956 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 3580 + "tracing", 3957 3581 "windows-sys 0.60.2", 3958 3582 ] 3959 3583 ··· 4032 3656 ] 4033 3657 4034 3658 [[package]] 4035 - name = "rand_xorshift" 4036 - version = "0.4.0" 4037 - source = "registry+https://github.com/rust-lang/crates.io-index" 4038 - checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" 4039 - dependencies = [ 4040 - "rand_core 0.9.5", 4041 - ] 4042 - 4043 - [[package]] 4044 3659 name = "rav1e" 4045 3660 version = "0.8.1" 4046 3661 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 4049 3664 "aligned-vec", 4050 3665 "arbitrary", 4051 3666 "arg_enum_proc_macro", 4052 - "arrayvec 0.7.6", 3667 + "arrayvec", 4053 3668 "av-scenechange", 4054 3669 "av1-grain", 4055 3670 "bitstream-io", ··· 4228 3843 ] 4229 3844 4230 3845 [[package]] 4231 - name = "reserve-port" 4232 - version = "2.4.0" 4233 - source = "registry+https://github.com/rust-lang/crates.io-index" 4234 - checksum = "94070964579245eb2f76e62a7668fe87bd9969ed6c41256f3bf614e3323dd3cc" 4235 - dependencies = [ 4236 - "thiserror 2.0.18", 4237 - ] 4238 - 4239 - [[package]] 4240 3846 name = "resolv-conf" 4241 3847 version = "0.7.6" 4242 3848 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 4326 3932 ] 4327 3933 4328 3934 [[package]] 4329 - name = "rust-multipart-rfc7578_2" 4330 - version = "0.8.0" 4331 - source = "registry+https://github.com/rust-lang/crates.io-index" 4332 - checksum = "c839d037155ebc06a571e305af66ff9fd9063a6e662447051737e1ac75beea41" 4333 - dependencies = [ 4334 - "bytes", 4335 - "futures-core", 4336 - "futures-util", 4337 - "http", 4338 - "mime", 4339 - "rand 0.9.2", 4340 - "thiserror 2.0.18", 4341 - ] 4342 - 4343 - [[package]] 4344 3935 name = "rustc-demangle" 4345 3936 version = "0.1.27" 4346 3937 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 4441 4032 checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" 4442 4033 4443 4034 [[package]] 4444 - name = "rusty-fork" 4445 - version = "0.3.1" 4446 - source = "registry+https://github.com/rust-lang/crates.io-index" 4447 - checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" 4448 - dependencies = [ 4449 - "fnv", 4450 - "quick-error 1.2.3", 4451 - "tempfile", 4452 - "wait-timeout", 4453 - ] 4454 - 4455 - [[package]] 4456 4035 name = "ryu" 4457 4036 version = "1.0.23" 4458 4037 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 5032 4611 checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" 5033 4612 dependencies = [ 5034 4613 "futf", 5035 - "mac 0.1.1", 4614 + "mac", 5036 4615 "utf-8", 5037 4616 ] 5038 4617 ··· 5155 4734 checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" 5156 4735 dependencies = [ 5157 4736 "deranged", 5158 - "itoa", 5159 4737 "libc", 5160 4738 "num-conv", 5161 4739 "num_threads", 5162 4740 "powerfmt", 5163 4741 "serde_core", 5164 4742 "time-core", 5165 - "time-macros", 5166 4743 ] 5167 4744 5168 4745 [[package]] ··· 5170 4747 version = "0.1.8" 5171 4748 source = "registry+https://github.com/rust-lang/crates.io-index" 5172 4749 checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" 5173 - 5174 - [[package]] 5175 - name = "time-macros" 5176 - version = "0.2.27" 5177 - source = "registry+https://github.com/rust-lang/crates.io-index" 5178 - checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" 5179 - dependencies = [ 5180 - "num-conv", 5181 - "time-core", 5182 - ] 5183 4750 5184 4751 [[package]] 5185 4752 name = "tiny_http" ··· 5398 4965 "tokio", 5399 4966 "tower-layer", 5400 4967 "tower-service", 5401 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 5402 4968 ] 5403 4969 5404 4970 [[package]] ··· 5422 4988 "tower", 5423 4989 "tower-layer", 5424 4990 "tower-service", 5425 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 5426 4991 ] 5427 4992 5428 4993 [[package]] ··· 5443 5008 source = "registry+https://github.com/rust-lang/crates.io-index" 5444 5009 checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" 5445 5010 dependencies = [ 5446 - "log", 5447 5011 "pin-project-lite", 5448 - "tracing-attributes 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", 5449 - "tracing-core 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", 5450 - ] 5451 - 5452 - [[package]] 5453 - name = "tracing" 5454 - version = "0.1.44" 5455 - source = "git+https://github.com/tokio-rs/tracing#54ede4d5d85a536aed5485c5213011d9ec961935" 5456 - dependencies = [ 5457 - "pin-project-lite", 5458 - "tracing-attributes 0.1.31 (git+https://github.com/tokio-rs/tracing)", 5459 - "tracing-core 0.1.36 (git+https://github.com/tokio-rs/tracing)", 5012 + "tracing-attributes", 5013 + "tracing-core", 5460 5014 ] 5461 5015 5462 5016 [[package]] ··· 5471 5025 ] 5472 5026 5473 5027 [[package]] 5474 - name = "tracing-attributes" 5475 - version = "0.1.31" 5476 - source = "git+https://github.com/tokio-rs/tracing#54ede4d5d85a536aed5485c5213011d9ec961935" 5477 - dependencies = [ 5478 - "proc-macro2", 5479 - "quote", 5480 - "syn", 5481 - ] 5482 - 5483 - [[package]] 5484 5028 name = "tracing-core" 5485 5029 version = "0.1.36" 5486 5030 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 5491 5035 ] 5492 5036 5493 5037 [[package]] 5494 - name = "tracing-core" 5495 - version = "0.1.36" 5496 - source = "git+https://github.com/tokio-rs/tracing#54ede4d5d85a536aed5485c5213011d9ec961935" 5497 - dependencies = [ 5498 - "valuable", 5499 - ] 5500 - 5501 - [[package]] 5502 5038 name = "tracing-log" 5503 5039 version = "0.2.0" 5504 5040 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 5506 5042 dependencies = [ 5507 5043 "log", 5508 5044 "once_cell", 5509 - "tracing-core 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", 5510 - ] 5511 - 5512 - [[package]] 5513 - name = "tracing-log" 5514 - version = "0.2.0" 5515 - source = "git+https://github.com/tokio-rs/tracing#54ede4d5d85a536aed5485c5213011d9ec961935" 5516 - dependencies = [ 5517 - "log", 5518 - "once_cell", 5519 - "tracing-core 0.1.36 (git+https://github.com/tokio-rs/tracing)", 5045 + "tracing-core", 5520 5046 ] 5521 5047 5522 5048 [[package]] ··· 5532 5058 "sharded-slab", 5533 5059 "smallvec", 5534 5060 "thread_local", 5535 - "time", 5536 - "tracing 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 5537 - "tracing-core 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", 5538 - "tracing-log 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 5539 - ] 5540 - 5541 - [[package]] 5542 - name = "tracing-subscriber" 5543 - version = "0.3.23" 5544 - source = "git+https://github.com/tokio-rs/tracing#54ede4d5d85a536aed5485c5213011d9ec961935" 5545 - dependencies = [ 5546 - "matchers", 5547 - "nu-ansi-term", 5548 - "once_cell", 5549 - "regex-automata", 5550 - "sharded-slab", 5551 - "smallvec", 5552 - "thread_local", 5553 - "tracing 0.1.44 (git+https://github.com/tokio-rs/tracing)", 5554 - "tracing-core 0.1.36 (git+https://github.com/tokio-rs/tracing)", 5555 - "tracing-log 0.2.0 (git+https://github.com/tokio-rs/tracing)", 5061 + "tracing", 5062 + "tracing-core", 5063 + "tracing-log", 5556 5064 ] 5557 5065 5558 5066 [[package]] ··· 5623 5131 ] 5624 5132 5625 5133 [[package]] 5626 - name = "typeid" 5627 - version = "1.0.3" 5628 - source = "registry+https://github.com/rust-lang/crates.io-index" 5629 - checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" 5630 - 5631 - [[package]] 5632 5134 name = "typenum" 5633 5135 version = "1.19.0" 5634 5136 source = "registry+https://github.com/rust-lang/crates.io-index" 5635 5137 checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" 5636 5138 5637 5139 [[package]] 5638 - name = "typetag" 5639 - version = "0.2.21" 5640 - source = "registry+https://github.com/rust-lang/crates.io-index" 5641 - checksum = "be2212c8a9b9bcfca32024de14998494cf9a5dfa59ea1b829de98bac374b86bf" 5642 - dependencies = [ 5643 - "erased-serde", 5644 - "inventory", 5645 - "once_cell", 5646 - "serde", 5647 - "typetag-impl", 5648 - ] 5649 - 5650 - [[package]] 5651 - name = "typetag-impl" 5652 - version = "0.2.21" 5653 - source = "registry+https://github.com/rust-lang/crates.io-index" 5654 - checksum = "27a7a9b72ba121f6f1f6c3632b85604cac41aedb5ddc70accbebb6cac83de846" 5655 - dependencies = [ 5656 - "proc-macro2", 5657 - "quote", 5658 - "syn", 5659 - ] 5660 - 5661 - [[package]] 5662 - name = "unarray" 5663 - version = "0.1.4" 5664 - source = "registry+https://github.com/rust-lang/crates.io-index" 5665 - checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" 5666 - 5667 - [[package]] 5668 5140 name = "unicase" 5669 5141 version = "2.9.0" 5670 5142 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 5755 5227 checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 5756 5228 5757 5229 [[package]] 5758 - name = "uuid" 5759 - version = "1.22.0" 5760 - source = "registry+https://github.com/rust-lang/crates.io-index" 5761 - checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" 5762 - dependencies = [ 5763 - "js-sys", 5764 - "wasm-bindgen", 5765 - ] 5766 - 5767 - [[package]] 5768 5230 name = "v_frame" 5769 5231 version = "0.3.9" 5770 5232 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 5801 5263 "lazy_static", 5802 5264 "tempfile", 5803 5265 "termcolor", 5804 - ] 5805 - 5806 - [[package]] 5807 - name = "wait-timeout" 5808 - version = "0.2.1" 5809 - source = "registry+https://github.com/rust-lang/crates.io-index" 5810 - checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" 5811 - dependencies = [ 5812 - "libc", 5813 5266 ] 5814 5267 5815 5268 [[package]] ··· 6411 5864 checksum = "9bbb26405d8e919bc1547a5aa9abc95cbfa438f04844f5fdd9dc7596b748bf69" 6412 5865 dependencies = [ 6413 5866 "log", 6414 - "mac 0.1.1", 5867 + "mac", 6415 5868 "markup5ever", 6416 5869 ] 6417 5870
+1 -1
Cargo.toml
··· 1 1 [workspace] 2 2 resolver = "2" 3 - members = ["crates/*"] 3 + members = ["crates/jacquard", "crates/jacquard-common", "crates/jacquard-api", "crates/jacquard-lexgen", "crates/jacquard-lexicon", "crates/jacquard-derive", "crates/jacquard-repo", "crates/mini-moka-wasm"] 4 4 5 5 6 6 [workspace.package]
+18 -45
crates/jacquard-axum/tests/extractor_tests.rs
··· 1 1 use axum::{Json, Router, response::IntoResponse}; 2 2 use axum_test::TestServer; 3 3 use jacquard_axum::{ExtractXrpc, IntoRouter}; 4 + use jacquard_common::bos::{BosStr, DefaultStr}; 4 5 use jacquard_common::types::string::Did; 5 6 use serde::{Deserialize, Serialize}; 6 7 use std::collections::BTreeMap; 7 8 8 9 // Mock XRPC endpoint for testing 9 10 #[derive(Debug, Clone, Serialize, Deserialize)] 10 - struct TestQueryRequest<'a> { 11 - #[serde(borrow)] 12 - did: Did<'a>, 11 + #[serde(bound(deserialize = "S: serde::Deserialize<'de> + BosStr"))] 12 + struct TestQueryRequest<S: BosStr = DefaultStr> { 13 + did: Did<S>, 13 14 #[serde(default)] 14 15 limit: Option<u32>, 15 16 } 16 17 17 - impl jacquard::IntoStatic for TestQueryRequest<'_> { 18 - type Output = TestQueryRequest<'static>; 19 - 20 - fn into_static(self) -> Self::Output { 21 - TestQueryRequest { 22 - did: self.did.into_static(), 23 - limit: self.limit, 24 - } 25 - } 26 - } 27 - 28 18 #[derive(Debug, Clone, Serialize, Deserialize)] 29 - struct TestQueryResponse<'a> { 30 - #[serde(borrow)] 31 - did: Did<'a>, 19 + #[serde(bound(deserialize = "S: serde::Deserialize<'de> + BosStr"))] 20 + struct TestQueryResponse<S: BosStr = DefaultStr> { 21 + did: Did<S>, 32 22 #[serde(skip_serializing_if = "BTreeMap::is_empty", default)] 33 23 extra_data: BTreeMap<String, serde_json::Value>, 34 24 } 35 25 36 - impl jacquard::IntoStatic for TestQueryResponse<'_> { 37 - type Output = TestQueryResponse<'static>; 38 - 39 - fn into_static(self) -> Self::Output { 40 - TestQueryResponse { 41 - did: self.did.into_static(), 42 - extra_data: self.extra_data, 43 - } 44 - } 45 - } 46 - 47 26 #[derive(Debug, Clone, Serialize, Deserialize, thiserror::Error)] 48 27 #[error("test error")] 49 28 struct TestError; 50 29 51 - impl jacquard::IntoStatic for TestError { 52 - type Output = TestError; 53 - 54 - fn into_static(self) -> Self::Output { 55 - self 56 - } 57 - } 58 - 59 - impl jacquard::xrpc::XrpcResp for TestQueryResponse<'_> { 30 + impl jacquard::xrpc::XrpcResp for TestQueryResponse { 60 31 const NSID: &'static str = "com.example.test.query"; 61 32 const ENCODING: &'static str = "application/json"; 62 - type Output<'a> = TestQueryResponse<'a>; 63 - type Err<'a> = TestError; 33 + type Output<S: BosStr> = TestQueryResponse<S>; 34 + type Err = TestError; 64 35 } 65 36 66 - impl jacquard::xrpc::XrpcRequest for TestQueryRequest<'_> { 37 + impl<S: BosStr + serde::Serialize> jacquard::xrpc::XrpcRequest for TestQueryRequest<S> { 67 38 const NSID: &'static str = "com.example.test.query"; 68 39 const METHOD: jacquard::xrpc::XrpcMethod = jacquard::xrpc::XrpcMethod::Query; 69 - type Response = TestQueryResponse<'static>; 40 + type Response = TestQueryResponse; 70 41 } 71 42 72 - impl jacquard::xrpc::XrpcEndpoint for TestQueryRequest<'_> { 43 + impl jacquard::xrpc::XrpcEndpoint for TestQueryRequest { 73 44 const PATH: &'static str = "/xrpc/com.example.test.query"; 74 45 const METHOD: jacquard::xrpc::XrpcMethod = jacquard::xrpc::XrpcMethod::Query; 75 - type Request<'a> = TestQueryRequest<'a>; 76 - type Response = TestQueryResponse<'static>; 46 + type Request<S: BosStr> = TestQueryRequest<S>; 47 + type Response = TestQueryResponse; 77 48 } 78 49 79 - async fn test_handler(ExtractXrpc(req): ExtractXrpc<TestQueryRequest<'_>>) -> impl IntoResponse { 50 + async fn test_handler( 51 + ExtractXrpc(req): ExtractXrpc<TestQueryRequest, DefaultStr>, 52 + ) -> impl IntoResponse { 80 53 Json(TestQueryResponse { 81 54 did: req.did, 82 55 extra_data: BTreeMap::new(),
+16 -14
crates/jacquard-axum/tests/service_auth_tests.rs
··· 13 13 ExtractServiceAuth, ServiceAuthConfig, VerifiedServiceAuth, service_auth_middleware, 14 14 }; 15 15 use jacquard_common::{ 16 - CowStr, IntoStatic, 16 + CowStr, 17 + bos::BosStr, 18 + deps::smol_str::SmolStr, 17 19 service_auth::JwtHeader, 18 20 types::{ 19 21 did::Did, ··· 66 68 } 67 69 68 70 // Test helper: create DID document with k256 key 69 - fn create_test_did_doc(did: &str, public_key: &k256::ecdsa::VerifyingKey) -> DidDocument<'static> { 71 + fn create_test_did_doc(did: &str, public_key: &k256::ecdsa::VerifyingKey) -> DidDocument { 70 72 use std::collections::BTreeMap; 71 73 72 74 // Encode as compressed SEC1 ··· 82 84 83 85 DidDocument { 84 86 context: default_context(), 85 - id: Did::new_owned(did).unwrap().into_static(), 87 + id: Did::new_owned(did).unwrap(), 86 88 also_known_as: None, 87 89 verification_method: Some(vec![VerificationMethod { 88 - id: CowStr::Owned(format!("{}#atproto", did).into()), 89 - r#type: CowStr::new_static("Multikey"), 90 - controller: Some(CowStr::Owned(did.into())), 91 - public_key_multibase: Some(CowStr::Owned(multibase_key.into())), 90 + id: SmolStr::from(format!("{}#atproto", did)), 91 + r#type: SmolStr::new_static("Multikey"), 92 + controller: Some(SmolStr::from(did)), 93 + public_key_multibase: Some(SmolStr::from(multibase_key)), 92 94 extra_data: BTreeMap::new(), 93 95 }]), 94 96 service: None, ··· 99 101 // Mock resolver for tests 100 102 #[derive(Clone)] 101 103 struct MockResolver { 102 - did_doc: DidDocument<'static>, 104 + did_doc: DidDocument, 103 105 options: ResolverOptions, 104 106 } 105 107 106 108 impl MockResolver { 107 - fn new(did_doc: DidDocument<'static>) -> Self { 109 + fn new(did_doc: DidDocument) -> Self { 108 110 Self { 109 111 did_doc, 110 112 options: ResolverOptions::default(), ··· 117 119 &self.options 118 120 } 119 121 120 - fn resolve_handle( 122 + fn resolve_handle<S: BosStr + Sync>( 121 123 &self, 122 - _handle: &jacquard_common::types::string::Handle<'_>, 123 - ) -> impl Future<Output = Result<Did<'static>, IdentityError>> + Send { 124 + _handle: &jacquard_common::types::string::Handle<S>, 125 + ) -> impl Future<Output = Result<Did, IdentityError>> + Send { 124 126 async { Err(IdentityError::handle_resolution_exhausted()) } 125 127 } 126 128 127 - fn resolve_did_doc( 129 + fn resolve_did_doc<S: BosStr + Sync>( 128 130 &self, 129 - _did: &Did<'_>, 131 + _did: &Did<S>, 130 132 ) -> impl Future<Output = Result<DidDocResponse, IdentityError>> + Send { 131 133 let doc = self.did_doc.clone(); 132 134 async move {
+1 -1
crates/jacquard-common/Cargo.toml
··· 12 12 license.workspace = true 13 13 14 14 [features] 15 - default = ["std", "service-auth", "reqwest-client", "crypto", "websocket"] 15 + default = ["std", "service-auth", "reqwest-client", "crypto"] 16 16 std = [ 17 17 "dep:tokio", 18 18 "dep:tokio-util",
+12 -2
crates/jacquard-oauth/src/client.rs
··· 9 9 session::{ClientData, ClientSessionData, DpopClientData, SessionRegistry}, 10 10 types::{AuthorizeOptions, CallbackParams}, 11 11 }; 12 + #[cfg(feature = "websocket")] 13 + use jacquard_common::CowStr; 12 14 use jacquard_common::{ 13 - AuthorizationToken, CowStr, IntoStatic, 15 + AuthorizationToken, IntoStatic, 14 16 bos::BosStr, 15 17 deps::fluent_uri::Uri, 16 18 error::{AuthError, ClientError, XrpcResult}, ··· 1000 1002 .is_ok_and(|s| s.starts_with("DPoP ") && s.contains("error=\"invalid_token\"")), 1001 1003 _ => false, 1002 1004 }, 1003 - Ok(_) => false, 1005 + // Some servers return 200/401 with an error in the body rather than using 1006 + // WWW-Authenticate. Check the raw response bytes for the invalid_token pattern. 1007 + Ok(resp) => { 1008 + resp.status() == http::StatusCode::UNAUTHORIZED 1009 + || serde_json::from_slice::<serde_json::Value>(resp.buffer()) 1010 + .ok() 1011 + .and_then(|v| v.get("error")?.as_str().map(|s| s == "invalid_token")) 1012 + .unwrap_or(false) 1013 + } 1004 1014 } 1005 1015 } 1006 1016
+1 -1
crates/jacquard/Cargo.toml
··· 12 12 license.workspace = true 13 13 14 14 [features] 15 - default = ["api_full", "dns", "loopback", "derive", "cache", "websocket"] 15 + default = ["api_full", "dns", "loopback", "derive", "cache"] 16 16 derive = ["dep:jacquard-derive"] 17 17 # Minimal API bindings 18 18 api = ["jacquard-api/minimal"]
+3 -1
crates/jacquard/src/client/credential_session.rs
··· 516 516 { 517 517 true 518 518 } 519 - Ok(_) => false, 519 + // A 401 without WWW-Authenticate flows through as Ok(Response) with 401 status. 520 + // Check the status code directly to catch expired tokens signalled via body JSON. 521 + Ok(resp) if resp.status() == http::StatusCode::UNAUTHORIZED => true, 520 522 _ => false, 521 523 } 522 524 }
+2 -2
examples/axum_server.rs
··· 2 2 3 3 use axum::{Json, Router, extract::State, http::StatusCode, response::IntoResponse}; 4 4 use jacquard::{ 5 - CowStr, 5 + CowStr, DefaultStr, 6 6 api::com_atproto::identity::resolve_did::{ResolveDidOutput, ResolveDidRequest}, 7 7 identity::{JacquardResolver, resolver::IdentityResolver}, 8 8 types::value::to_data, ··· 14 14 #[axum_macros::debug_handler] 15 15 async fn resolve_did( 16 16 State(state): State<Arc<AppState>>, 17 - ExtractXrpc(args): ExtractXrpc<ResolveDidRequest, CowStr<'_>>, 17 + ExtractXrpc(args): ExtractXrpc<ResolveDidRequest, DefaultStr>, 18 18 ) -> Result<Json<ResolveDidOutput<CowStr<'static>>>, XrpcErrorResponse> { 19 19 let doc = state 20 20 .resolver
+1 -1
examples/moderated_timeline.rs
··· 89 89 .map(|did| did.to_cowstr()) 90 90 .collect(), 91 91 ); 92 - let request = GetTimeline::new().limit(args.limit).build(); 92 + let request: GetTimeline = GetTimeline::new().limit(args.limit).build(); 93 93 94 94 println!("\nFetching timeline with {} posts...\n", args.limit); 95 95
+2 -2
examples/public_atproto_feed.rs
··· 15 15 .to_owned(); 16 16 17 17 // Feed of posts about the AT Protocol 18 - let feed_uri = 18 + let feed_uri: AtUri = 19 19 AtUri::new_static("at://did:plc:oio4hkxaop4ao4wz2pp3f4cr/app.bsky.feed.generator/atproto") 20 20 .unwrap(); 21 21 22 22 let request = GetFeed::new().feed(feed_uri).limit(10).build(); 23 23 24 - let response = http.xrpc(&base.borrow()).send(&request).await?; 24 + let response = http.xrpc(base.borrow()).send(&request).await?; 25 25 let output = response.into_output()?; 26 26 27 27 println!("Latest posts from the AT Protocol feed:\n");
+2 -2
examples/read_whitewind_post.rs
··· 16 16 let args = Args::parse(); 17 17 18 18 // Parse the at:// URI 19 - let uri = AtUri::new(&args.uri)?; 19 + let uri = AtUri::new(args.uri.as_str())?; 20 20 21 21 // Create an unauthenticated agent for public record access 22 22 let agent = BasicClient::unauthenticated(); 23 23 24 24 // Use Agent's get_record helper with the at:// URI 25 - let response = agent.get_record::<Entry>(&uri).await?; 25 + let response = agent.get_record::<Entry, _>(&uri).await?; 26 26 let output = response.into_output()?; 27 27 28 28 println!("📚 WhiteWind Blog Entry\n");
+1 -1
examples/resolve_did.rs
··· 17 17 let args = Args::parse(); 18 18 19 19 // Parse the handle 20 - let handle = Handle::new(&args.handle)?; 20 + let handle = Handle::new(args.handle.as_str())?; 21 21 22 22 // Create an unauthenticated client with identity resolver 23 23 let client = BasicClient::unauthenticated();
+1 -1
examples/stream_get_blob.rs
··· 38 38 let output: StreamingResponse = agent 39 39 .download(GetBlob { 40 40 did: Did::new(args.did)?, 41 - cid: Cid::str(&args.cid), 41 + cid: Cid::new(args.cid.as_bytes())?, 42 42 }) 43 43 .await?; 44 44
+2 -2
examples/subscribe_jetstream.rs
··· 86 86 // Subscribe with no filters (firehose mode) 87 87 // Enable compression if zstd feature is available 88 88 #[cfg(feature = "zstd")] 89 - let params = { JetstreamParams::new().compress(true).build() }; 89 + let params: JetstreamParams = { JetstreamParams::new().compress(true).build() }; 90 90 91 91 #[cfg(not(feature = "zstd"))] 92 - let params = { JetstreamParams::new().build() }; 92 + let params: JetstreamParams = { JetstreamParams::new().build() }; 93 93 94 94 let stream = client.subscribe(&params).await.into_diagnostic()?; 95 95
+12 -8
examples/update_profile.rs
··· 1 1 use clap::Parser; 2 - use jacquard::CowStr; 3 2 use jacquard::api::app_bsky::actor::profile::Profile; 4 3 use jacquard::client::{Agent, AgentSessionExt, FileAuthStore}; 5 4 use jacquard::oauth::client::OAuthClient; 6 5 use jacquard::oauth::loopback::LoopbackConfig; 7 6 use jacquard::types::string::AtUri; 7 + use smol_str::SmolStr; 8 8 9 9 #[derive(Parser, Debug)] 10 10 #[command(author, version, about = "Update profile display name and description")] 11 11 struct Args { 12 12 /// Handle (e.g., alice.bsky.social), DID, or PDS URL 13 - input: CowStr<'static>, 13 + input: String, 14 14 15 15 /// New display name 16 16 #[arg(long)] ··· 31 31 32 32 let oauth = OAuthClient::with_default_config(FileAuthStore::new(&args.store)); 33 33 let session = oauth 34 - .login_with_local_server(args.input, Default::default(), LoopbackConfig::default()) 34 + .login_with_local_server( 35 + SmolStr::from(args.input), 36 + Default::default(), 37 + LoopbackConfig::default(), 38 + ) 35 39 .await?; 36 40 37 41 let agent: Agent<_> = Agent::from(session); ··· 44 48 45 49 // Profile records use "self" as the rkey 46 50 let uri_string = format!("at://{}/app.bsky.actor.profile/self", did); 47 - let uri = AtUri::new(&uri_string)?; 51 + let uri = AtUri::new(uri_string.as_str())?; 48 52 49 - // Update profile in-place using the fetch-modify-put pattern 53 + // Update profile in-place using the fetch-modify-put pattern. 50 54 agent 51 - .update_record::<Profile>(&uri, |profile| { 55 + .update_record::<Profile, _>(&uri, |profile| { 52 56 if let Some(name) = &args.display_name { 53 - profile.display_name = Some(CowStr::from(name.clone())); 57 + profile.display_name = Some(SmolStr::from(name.as_str())); 54 58 } 55 59 if let Some(desc) = &args.description { 56 - profile.description = Some(CowStr::from(desc.clone())); 60 + profile.description = Some(SmolStr::from(desc.as_str())); 57 61 } 58 62 }) 59 63 .await?;