Music collection management tool
0
fork

Configure Feed

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

feat: celers install

+478 -78
+408 -14
Cargo.lock
··· 3 3 version = 4 4 4 5 5 [[package]] 6 + name = "aho-corasick" 7 + version = "1.1.4" 8 + source = "registry+https://github.com/rust-lang/crates.io-index" 9 + checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" 10 + dependencies = [ 11 + "memchr", 12 + ] 13 + 14 + [[package]] 6 15 name = "allocator-api2" 7 16 version = "0.2.21" 8 17 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 74 83 checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" 75 84 76 85 [[package]] 86 + name = "arc-swap" 87 + version = "1.9.1" 88 + source = "registry+https://github.com/rust-lang/crates.io-index" 89 + checksum = "6a3a1fd6f75306b68087b831f025c712524bcb19aad54e557b1129cfa0a2b207" 90 + dependencies = [ 91 + "rustversion", 92 + ] 93 + 94 + [[package]] 95 + name = "arcstr" 96 + version = "1.2.0" 97 + source = "registry+https://github.com/rust-lang/crates.io-index" 98 + checksum = "03918c3dbd7701a85c6b9887732e2921175f26c350b4563841d0958c21d57e6d" 99 + 100 + [[package]] 77 101 name = "argon2" 78 102 version = "0.5.3" 79 103 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 81 105 dependencies = [ 82 106 "base64ct", 83 107 "blake2", 84 - "cpufeatures", 108 + "cpufeatures 0.2.17", 85 109 "password-hash", 86 110 ] 87 111 88 112 [[package]] 113 + name = "async-lock" 114 + version = "3.4.2" 115 + source = "registry+https://github.com/rust-lang/crates.io-index" 116 + checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" 117 + dependencies = [ 118 + "event-listener", 119 + "event-listener-strategy", 120 + "pin-project-lite", 121 + ] 122 + 123 + [[package]] 89 124 name = "async-trait" 90 125 version = "0.1.89" 91 126 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 182 217 ] 183 218 184 219 [[package]] 220 + name = "backon" 221 + version = "1.6.0" 222 + source = "registry+https://github.com/rust-lang/crates.io-index" 223 + checksum = "cffb0e931875b666fc4fcb20fee52e9bbd1ef836fd9e9e04ec21555f9f85f7ef" 224 + dependencies = [ 225 + "fastrand", 226 + ] 227 + 228 + [[package]] 185 229 name = "base64" 186 230 version = "0.22.1" 187 231 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 249 293 ] 250 294 251 295 [[package]] 296 + name = "celers-broker-redis" 297 + version = "0.2.0" 298 + source = "registry+https://github.com/rust-lang/crates.io-index" 299 + checksum = "10ad07179b8d4cfbe4279d45a19466011f6adb60fd949d30f2c49579774dfcb4" 300 + dependencies = [ 301 + "async-trait", 302 + "celers-core", 303 + "celers-protocol", 304 + "chrono", 305 + "crc32fast", 306 + "oxiarc-deflate", 307 + "rand 0.10.1", 308 + "redis", 309 + "serde", 310 + "serde_json", 311 + "thiserror", 312 + "tokio", 313 + "tracing", 314 + "uuid", 315 + ] 316 + 317 + [[package]] 318 + name = "celers-core" 319 + version = "0.2.0" 320 + source = "registry+https://github.com/rust-lang/crates.io-index" 321 + checksum = "bda0437021c469101a5cae2e88400a0680d6d5f918a5b6e2c891443d53308548" 322 + dependencies = [ 323 + "async-trait", 324 + "chrono", 325 + "num_cpus", 326 + "oxicode", 327 + "rand 0.10.1", 328 + "regex", 329 + "serde", 330 + "serde_json", 331 + "thiserror", 332 + "tokio", 333 + "tracing", 334 + "uuid", 335 + ] 336 + 337 + [[package]] 338 + name = "celers-protocol" 339 + version = "0.2.0" 340 + source = "registry+https://github.com/rust-lang/crates.io-index" 341 + checksum = "63ec684f7440a2c012f03aff6e27d9d313ebd7e1c3577c01dd33c67c4520e433" 342 + dependencies = [ 343 + "base64", 344 + "chrono", 345 + "oxiarc-deflate", 346 + "serde", 347 + "serde_json", 348 + "uuid", 349 + ] 350 + 351 + [[package]] 252 352 name = "cfg-if" 253 353 version = "1.0.4" 254 354 source = "registry+https://github.com/rust-lang/crates.io-index" 255 355 checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" 256 356 257 357 [[package]] 358 + name = "chacha20" 359 + version = "0.10.0" 360 + source = "registry+https://github.com/rust-lang/crates.io-index" 361 + checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" 362 + dependencies = [ 363 + "cfg-if", 364 + "cpufeatures 0.3.0", 365 + "rand_core 0.10.1", 366 + ] 367 + 368 + [[package]] 258 369 name = "chrono" 259 370 version = "0.4.44" 260 371 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 315 426 checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" 316 427 317 428 [[package]] 429 + name = "combine" 430 + version = "4.6.7" 431 + source = "registry+https://github.com/rust-lang/crates.io-index" 432 + checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" 433 + dependencies = [ 434 + "bytes", 435 + "futures-core", 436 + "memchr", 437 + "pin-project-lite", 438 + "tokio", 439 + "tokio-util", 440 + ] 441 + 442 + [[package]] 318 443 name = "concurrent-queue" 319 444 version = "2.5.0" 320 445 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 355 480 ] 356 481 357 482 [[package]] 483 + name = "cpufeatures" 484 + version = "0.3.0" 485 + source = "registry+https://github.com/rust-lang/crates.io-index" 486 + checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" 487 + dependencies = [ 488 + "libc", 489 + ] 490 + 491 + [[package]] 358 492 name = "crc" 359 493 version = "3.4.0" 360 494 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 368 502 version = "2.5.0" 369 503 source = "registry+https://github.com/rust-lang/crates.io-index" 370 504 checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853" 505 + 506 + [[package]] 507 + name = "crc16" 508 + version = "0.4.0" 509 + source = "registry+https://github.com/rust-lang/crates.io-index" 510 + checksum = "338089f42c427b86394a5ee60ff321da23a5c89c9d89514c829687b26359fcff" 511 + 512 + [[package]] 513 + name = "crc32fast" 514 + version = "1.5.0" 515 + source = "registry+https://github.com/rust-lang/crates.io-index" 516 + checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" 517 + dependencies = [ 518 + "cfg-if", 519 + ] 371 520 372 521 [[package]] 373 522 name = "crossbeam-queue" ··· 459 608 checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 460 609 461 610 [[package]] 611 + name = "errno" 612 + version = "0.3.14" 613 + source = "registry+https://github.com/rust-lang/crates.io-index" 614 + checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" 615 + dependencies = [ 616 + "libc", 617 + "windows-sys 0.61.2", 618 + ] 619 + 620 + [[package]] 462 621 name = "etcetera" 463 622 version = "0.8.0" 464 623 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 479 638 "parking", 480 639 "pin-project-lite", 481 640 ] 641 + 642 + [[package]] 643 + name = "event-listener-strategy" 644 + version = "0.5.4" 645 + source = "registry+https://github.com/rust-lang/crates.io-index" 646 + checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" 647 + dependencies = [ 648 + "event-listener", 649 + "pin-project-lite", 650 + ] 651 + 652 + [[package]] 653 + name = "fastrand" 654 + version = "2.4.1" 655 + source = "registry+https://github.com/rust-lang/crates.io-index" 656 + checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" 482 657 483 658 [[package]] 484 659 name = "find-msvc-tools" ··· 608 783 609 784 [[package]] 610 785 name = "getrandom" 786 + version = "0.3.4" 787 + source = "registry+https://github.com/rust-lang/crates.io-index" 788 + checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" 789 + dependencies = [ 790 + "cfg-if", 791 + "libc", 792 + "r-efi 5.3.0", 793 + "wasip2", 794 + ] 795 + 796 + [[package]] 797 + name = "getrandom" 611 798 version = "0.4.2" 612 799 source = "registry+https://github.com/rust-lang/crates.io-index" 613 800 checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" 614 801 dependencies = [ 615 802 "cfg-if", 616 803 "libc", 617 - "r-efi", 804 + "r-efi 6.0.0", 805 + "rand_core 0.10.1", 618 806 "wasip2", 619 807 "wasip3", 620 808 ] ··· 650 838 version = "0.5.0" 651 839 source = "registry+https://github.com/rust-lang/crates.io-index" 652 840 checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 841 + 842 + [[package]] 843 + name = "hermit-abi" 844 + version = "0.5.2" 845 + source = "registry+https://github.com/rust-lang/crates.io-index" 846 + checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" 653 847 654 848 [[package]] 655 849 name = "hex" ··· 1060 1254 version = "0.1.0-alpha.0" 1061 1255 dependencies = [ 1062 1256 "axum", 1257 + "celers-broker-redis", 1063 1258 "clap", 1064 1259 "musica-api", 1065 1260 "musica-auth", ··· 1073 1268 name = "musica-api" 1074 1269 version = "0.1.0-alpha.0" 1075 1270 dependencies = [ 1076 - "argon2", 1077 1271 "axum", 1272 + "celers-core", 1078 1273 "chrono", 1079 1274 "musica-auth", 1080 1275 "musica-models", ··· 1123 1318 "chrono", 1124 1319 "musica-core", 1125 1320 "musica-result", 1321 + "serde", 1126 1322 "uuid", 1127 1323 ] 1128 1324 ··· 1166 1362 "num-integer", 1167 1363 "num-iter", 1168 1364 "num-traits", 1169 - "rand", 1365 + "rand 0.8.6", 1170 1366 "smallvec", 1171 1367 "zeroize", 1172 1368 ] ··· 1208 1404 ] 1209 1405 1210 1406 [[package]] 1407 + name = "num_cpus" 1408 + version = "1.17.0" 1409 + source = "registry+https://github.com/rust-lang/crates.io-index" 1410 + checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" 1411 + dependencies = [ 1412 + "hermit-abi", 1413 + "libc", 1414 + ] 1415 + 1416 + [[package]] 1211 1417 name = "once_cell" 1212 1418 version = "1.21.4" 1213 1419 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1226 1432 checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" 1227 1433 1228 1434 [[package]] 1435 + name = "oxiarc-core" 1436 + version = "0.2.7" 1437 + source = "registry+https://github.com/rust-lang/crates.io-index" 1438 + checksum = "09ce7cafbdf59b46e5d47462e66611315ba2239c78250dbe361e95fc6da7e400" 1439 + dependencies = [ 1440 + "thiserror", 1441 + ] 1442 + 1443 + [[package]] 1444 + name = "oxiarc-deflate" 1445 + version = "0.2.7" 1446 + source = "registry+https://github.com/rust-lang/crates.io-index" 1447 + checksum = "dec84c7b2aea69a5d8a4d215e196d31f23f8f138be61eb94da3bb69352951edb" 1448 + dependencies = [ 1449 + "oxiarc-core", 1450 + ] 1451 + 1452 + [[package]] 1453 + name = "oxicode" 1454 + version = "0.2.1" 1455 + source = "registry+https://github.com/rust-lang/crates.io-index" 1456 + checksum = "c25029524d85adf9d52b61a9cc6d2c0409ee284e6d9e21063373554cb90b8723" 1457 + dependencies = [ 1458 + "oxicode_derive", 1459 + "serde", 1460 + ] 1461 + 1462 + [[package]] 1463 + name = "oxicode_derive" 1464 + version = "0.2.1" 1465 + source = "registry+https://github.com/rust-lang/crates.io-index" 1466 + checksum = "b96668957815c168769d0b972205a275694b7781ccf810876ee63a77dbd660e0" 1467 + dependencies = [ 1468 + "proc-macro2", 1469 + "quote", 1470 + "syn", 1471 + ] 1472 + 1473 + [[package]] 1229 1474 name = "parking" 1230 1475 version = "2.2.1" 1231 1476 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1261 1506 checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" 1262 1507 dependencies = [ 1263 1508 "base64ct", 1264 - "rand_core", 1509 + "rand_core 0.6.4", 1265 1510 "subtle", 1266 1511 ] 1267 1512 ··· 1383 1628 1384 1629 [[package]] 1385 1630 name = "r-efi" 1631 + version = "5.3.0" 1632 + source = "registry+https://github.com/rust-lang/crates.io-index" 1633 + checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" 1634 + 1635 + [[package]] 1636 + name = "r-efi" 1386 1637 version = "6.0.0" 1387 1638 source = "registry+https://github.com/rust-lang/crates.io-index" 1388 1639 checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" ··· 1394 1645 checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" 1395 1646 dependencies = [ 1396 1647 "libc", 1397 - "rand_chacha", 1398 - "rand_core", 1648 + "rand_chacha 0.3.1", 1649 + "rand_core 0.6.4", 1650 + ] 1651 + 1652 + [[package]] 1653 + name = "rand" 1654 + version = "0.9.4" 1655 + source = "registry+https://github.com/rust-lang/crates.io-index" 1656 + checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" 1657 + dependencies = [ 1658 + "rand_chacha 0.9.0", 1659 + "rand_core 0.9.5", 1660 + ] 1661 + 1662 + [[package]] 1663 + name = "rand" 1664 + version = "0.10.1" 1665 + source = "registry+https://github.com/rust-lang/crates.io-index" 1666 + checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" 1667 + dependencies = [ 1668 + "chacha20", 1669 + "getrandom 0.4.2", 1670 + "rand_core 0.10.1", 1399 1671 ] 1400 1672 1401 1673 [[package]] ··· 1405 1677 checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1406 1678 dependencies = [ 1407 1679 "ppv-lite86", 1408 - "rand_core", 1680 + "rand_core 0.6.4", 1681 + ] 1682 + 1683 + [[package]] 1684 + name = "rand_chacha" 1685 + version = "0.9.0" 1686 + source = "registry+https://github.com/rust-lang/crates.io-index" 1687 + checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" 1688 + dependencies = [ 1689 + "ppv-lite86", 1690 + "rand_core 0.9.5", 1409 1691 ] 1410 1692 1411 1693 [[package]] ··· 1418 1700 ] 1419 1701 1420 1702 [[package]] 1703 + name = "rand_core" 1704 + version = "0.9.5" 1705 + source = "registry+https://github.com/rust-lang/crates.io-index" 1706 + checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" 1707 + dependencies = [ 1708 + "getrandom 0.3.4", 1709 + ] 1710 + 1711 + [[package]] 1712 + name = "rand_core" 1713 + version = "0.10.1" 1714 + source = "registry+https://github.com/rust-lang/crates.io-index" 1715 + checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" 1716 + 1717 + [[package]] 1718 + name = "redis" 1719 + version = "1.2.0" 1720 + source = "registry+https://github.com/rust-lang/crates.io-index" 1721 + checksum = "f44e94c96d8870a387d88ce3de3fdd608cbfc0705f03cb343cdde91509d3e49a" 1722 + dependencies = [ 1723 + "arc-swap", 1724 + "arcstr", 1725 + "async-lock", 1726 + "backon", 1727 + "bytes", 1728 + "cfg-if", 1729 + "combine", 1730 + "crc16", 1731 + "futures-channel", 1732 + "futures-util", 1733 + "itoa", 1734 + "log", 1735 + "num-bigint", 1736 + "percent-encoding", 1737 + "pin-project-lite", 1738 + "rand 0.9.4", 1739 + "ryu", 1740 + "sha1_smol", 1741 + "socket2", 1742 + "tokio", 1743 + "tokio-util", 1744 + "url", 1745 + "xxhash-rust", 1746 + ] 1747 + 1748 + [[package]] 1421 1749 name = "redox_syscall" 1422 1750 version = "0.5.18" 1423 1751 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1436 1764 ] 1437 1765 1438 1766 [[package]] 1767 + name = "regex" 1768 + version = "1.12.3" 1769 + source = "registry+https://github.com/rust-lang/crates.io-index" 1770 + checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" 1771 + dependencies = [ 1772 + "aho-corasick", 1773 + "memchr", 1774 + "regex-automata", 1775 + "regex-syntax", 1776 + ] 1777 + 1778 + [[package]] 1779 + name = "regex-automata" 1780 + version = "0.4.14" 1781 + source = "registry+https://github.com/rust-lang/crates.io-index" 1782 + checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" 1783 + dependencies = [ 1784 + "aho-corasick", 1785 + "memchr", 1786 + "regex-syntax", 1787 + ] 1788 + 1789 + [[package]] 1790 + name = "regex-syntax" 1791 + version = "0.8.10" 1792 + source = "registry+https://github.com/rust-lang/crates.io-index" 1793 + checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" 1794 + 1795 + [[package]] 1439 1796 name = "ring" 1440 1797 version = "0.17.14" 1441 1798 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1462 1819 "num-traits", 1463 1820 "pkcs1", 1464 1821 "pkcs8", 1465 - "rand_core", 1822 + "rand_core 0.6.4", 1466 1823 "signature", 1467 1824 "spki", 1468 1825 "subtle", ··· 1644 2001 checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" 1645 2002 dependencies = [ 1646 2003 "cfg-if", 1647 - "cpufeatures", 2004 + "cpufeatures 0.2.17", 1648 2005 "digest", 1649 2006 ] 1650 2007 1651 2008 [[package]] 2009 + name = "sha1_smol" 2010 + version = "1.0.1" 2011 + source = "registry+https://github.com/rust-lang/crates.io-index" 2012 + checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" 2013 + 2014 + [[package]] 1652 2015 name = "sha2" 1653 2016 version = "0.10.9" 1654 2017 source = "registry+https://github.com/rust-lang/crates.io-index" 1655 2018 checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" 1656 2019 dependencies = [ 1657 2020 "cfg-if", 1658 - "cpufeatures", 2021 + "cpufeatures 0.2.17", 1659 2022 "digest", 1660 2023 ] 1661 2024 ··· 1675 2038 checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1676 2039 1677 2040 [[package]] 2041 + name = "signal-hook-registry" 2042 + version = "1.4.8" 2043 + source = "registry+https://github.com/rust-lang/crates.io-index" 2044 + checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" 2045 + dependencies = [ 2046 + "errno", 2047 + "libc", 2048 + ] 2049 + 2050 + [[package]] 1678 2051 name = "signature" 1679 2052 version = "2.2.0" 1680 2053 source = "registry+https://github.com/rust-lang/crates.io-index" 1681 2054 checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" 1682 2055 dependencies = [ 1683 2056 "digest", 1684 - "rand_core", 2057 + "rand_core 0.6.4", 1685 2058 ] 1686 2059 1687 2060 [[package]] ··· 1859 2232 "memchr", 1860 2233 "once_cell", 1861 2234 "percent-encoding", 1862 - "rand", 2235 + "rand 0.8.6", 1863 2236 "rsa", 1864 2237 "serde", 1865 2238 "sha1", ··· 1899 2272 "md-5", 1900 2273 "memchr", 1901 2274 "once_cell", 1902 - "rand", 2275 + "rand 0.8.6", 1903 2276 "serde", 1904 2277 "serde_json", 1905 2278 "sha2", ··· 2089 2462 "bytes", 2090 2463 "libc", 2091 2464 "mio", 2465 + "parking_lot", 2092 2466 "pin-project-lite", 2467 + "signal-hook-registry", 2093 2468 "socket2", 2094 2469 "tokio-macros", 2095 2470 "windows-sys 0.61.2", ··· 2113 2488 checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" 2114 2489 dependencies = [ 2115 2490 "futures-core", 2491 + "pin-project-lite", 2492 + "tokio", 2493 + ] 2494 + 2495 + [[package]] 2496 + name = "tokio-util" 2497 + version = "0.7.18" 2498 + source = "registry+https://github.com/rust-lang/crates.io-index" 2499 + checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" 2500 + dependencies = [ 2501 + "bytes", 2502 + "futures-core", 2503 + "futures-sink", 2116 2504 "pin-project-lite", 2117 2505 "tokio", 2118 2506 ] ··· 2727 3115 version = "0.6.3" 2728 3116 source = "registry+https://github.com/rust-lang/crates.io-index" 2729 3117 checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" 3118 + 3119 + [[package]] 3120 + name = "xxhash-rust" 3121 + version = "0.8.15" 3122 + source = "registry+https://github.com/rust-lang/crates.io-index" 3123 + checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" 2730 3124 2731 3125 [[package]] 2732 3126 name = "yoke"
+14 -1
Cargo.toml
··· 1 1 [workspace] 2 2 resolver = "3" 3 - members = ["src/api", "src/auth","src/core","src/database", "src/main", "src/models", "src/result"] 3 + members = [ 4 + "src/api", 5 + "src/auth", 6 + "src/core", 7 + "src/database", 8 + "src/main", 9 + "src/models", 10 + "src/result", 11 + ] 4 12 5 13 [workspace.package] 6 14 edition = "2024" ··· 21 29 http = "1.4" 22 30 23 31 # Framework 32 + celers-core = "0.2" 33 + celers-protocol = "0.2" 34 + celers-broker-redis = "0.2" 35 + celers-worker = "0.2" 36 + celers-macros = "0.2" 24 37 clap = { version = "4.6", features = ["derive", "env"] } 25 38 tokio = { version = "1.52", features = ["rt-multi-thread", "macros"] } 26 39 serde = { version = "1.0", features = ["derive"] }
+2 -1
src/api/Cargo.toml
··· 9 9 musica-result = { workspace = true, features = ["axum"] } 10 10 musica-models.workspace = true 11 11 12 + celers-core.workspace = true 13 + 12 14 axum.workspace = true 13 15 chrono.workspace = true 14 16 serde.workspace = true 15 17 uuid.workspace = true 16 - argon2.workspace = true
+1 -37
src/api/src/endpoints/user/mod.rs
··· 1 1 use axum::{Json, extract::{Path, State}}; 2 - use argon2::{Argon2, PasswordHash, password_hash::PasswordVerifier}; 3 2 use chrono::{DateTime, Utc}; 4 - use musica_result::{AuthError, Error, Result}; 3 + use musica_result::{Error, Result}; 5 4 use musica_models::UserRepository; 6 5 use serde::{Deserialize, Serialize}; 7 6 use uuid::Uuid; ··· 12 11 axum::Router::new() 13 12 .route("/", axum::routing::get(list_users)) 14 13 .route("/username/{username}", axum::routing::get(get_user_by_username)) 15 - .route("/login", axum::routing::post(login)) 16 - } 17 - 18 - #[derive(Debug, Clone, Deserialize)] 19 - pub struct LoginRequest { 20 - pub username: String, 21 - pub password: String, 22 - } 23 - 24 - #[derive(Debug, Clone, Serialize)] 25 - pub struct LoginResponse { 26 - pub token: String, 27 - } 28 - 29 - pub async fn login( 30 - State(state): State<AppState>, 31 - Json(body): Json<LoginRequest>, 32 - ) -> Result<Json<LoginResponse>> { 33 - let user = UserRepository::get_by_username( 34 - state.db.as_ref(), 35 - body.username.clone(), 36 - ) 37 - .await? 38 - .ok_or_else(|| Error::NotFound { resource: "User".into() })?; 39 - 40 - let parsed_hash = PasswordHash::new(&user.password_hash) 41 - .map_err(|_| AuthError::AuthenticationFailed)?; 42 - 43 - Argon2::default() 44 - .verify_password(body.password.as_bytes(), &parsed_hash) 45 - .map_err(|_| AuthError::AuthenticationFailed)?; 46 - 47 - let token = state.jwt_secret.generate_token(user.id, &user.username, user.is_admin)?; 48 - 49 - Ok(Json(LoginResponse { token })) 50 14 } 51 15 52 16 pub async fn list_users(
+2
src/main/Cargo.toml
··· 9 9 musica-auth = { workspace = true, features = ["axum"] } 10 10 musica-database.workspace = true 11 11 12 + celers-broker-redis.workspace = true 13 + 12 14 axum.workspace = true 13 15 clap.workspace = true 14 16 tokio.workspace = true
+50 -25
src/main/src/main.rs
··· 1 1 use std::{net::SocketAddr, process::ExitCode}; 2 2 3 - use clap::Parser; 3 + use clap::{Parser, Subcommand}; 4 4 use musica_auth::jwt::JwtSecret; 5 5 use musica_database::PostgresRepositories; 6 6 use tokio::net::TcpListener; 7 - use tracing::info; 7 + use tracing::{error, info}; 8 8 9 9 #[derive(Parser)] 10 10 struct Args { 11 - #[clap(long, short, env = "MUSICA_BIND_ADDR", default_value = "0.0.0.0:5000")] 12 - pub bind_addr: SocketAddr, 11 + #[clap(subcommand)] 12 + pub command: Command, 13 13 14 14 #[clap(long, short, env = "MUSICA_DATABASE_URL", default_value = "postgres://postgres:postgres@localhost/postgres")] 15 15 pub database_url: String, 16 16 17 - #[clap(long, short, env = "MUSICA_JWT_SECRET", default_value = "super-secret-jwt-key-change-in-production")] 18 - pub jwt_secret: String, 17 + #[clap(long, short, env = "MUSICA_REDIS_URL", default_value = "redis://localhost:6379/0")] 18 + pub redis_url: String, 19 + } 20 + 21 + #[derive(Subcommand)] 22 + enum Command { 23 + /// Run the API server. 24 + Api { 25 + #[clap(long, short, env = "MUSICA_BIND_ADDR", default_value = "0.0.0.0:5000")] 26 + bind_addr: SocketAddr, 27 + 28 + #[clap(long, short, env = "MUSICA_JWT_SECRET", default_value = "super-secret-jwt-key-change-in-production")] 29 + jwt_secret: String, 30 + }, 31 + 32 + /// Run the background worker that processes jobs. 33 + Worker, 19 34 } 20 35 21 36 #[tokio::main] ··· 26 41 27 42 let pool = match musica_database::postgres::open_pool(args.database_url).await { 28 43 Ok(pool) => pool, 29 - Err(err) => { 30 - tracing::error!("Failed to connect to database: {err}"); 31 - return ExitCode::FAILURE; 32 - } 44 + Err(err) => { 45 + error!("Failed to connect to database: {err}"); 46 + return ExitCode::FAILURE; 47 + } 33 48 }; 34 49 35 50 let repo = PostgresRepositories::new(pool); 36 - let jwt_secret = JwtSecret::new(args.jwt_secret.as_bytes()); 51 + 52 + match args.command { 53 + Command::Api { bind_addr, jwt_secret } => { 54 + let jwt_secret = JwtSecret::new(jwt_secret.as_bytes()); 55 + 56 + let state = musica_api::state::AppState::new(Box::new(repo), jwt_secret); 57 + 58 + let router = musica_api::router(state); 59 + 60 + let listener = match TcpListener::bind(bind_addr).await { 61 + Ok(listener) => listener, 62 + Err(err) => { 63 + error!("Failed to bind to address {}: {err}", bind_addr); 64 + return ExitCode::FAILURE; 65 + } 66 + }; 37 67 38 - let state = musica_api::state::AppState::new(Box::new(repo), jwt_secret); 68 + info!("Listening on {}", bind_addr); 39 69 40 - let router = musica_api::router(state); 70 + if let Err(err) = axum::serve(listener, router).await { 71 + error!("Failed to serve API: {err}"); 72 + return ExitCode::FAILURE; 73 + }; 74 + }, 41 75 42 - let listener = match TcpListener::bind(args.bind_addr).await { 43 - Ok(listener) => listener, 44 - Err(err) => { 45 - tracing::error!("Failed to bind to address {}: {err}", args.bind_addr); 76 + Command::Worker => { 77 + error!("Not yet implemented!"); 46 78 return ExitCode::FAILURE; 47 79 } 48 - }; 49 - 50 - info!("Listening on {}", args.bind_addr); 51 - 52 - if let Err(err) = axum::serve(listener, router).await { 53 - tracing::error!("Failed to serve API: {err}"); 54 - return ExitCode::FAILURE; 55 - }; 80 + } 56 81 57 82 ExitCode::SUCCESS 58 83 }
+1
src/models/Cargo.toml
··· 11 11 async-trait.workspace = true 12 12 chrono.workspace = true 13 13 uuid.workspace = true 14 + serde.workspace = true