Bump all dependencies to latest
Browse files at this commitea35e583ef0693c2ecdfba85b16716174c049aecParent: 54ec62d- chore
- bump all dependencies to latest
46 changed files +237 -163
- Cargo.lock +153 -75
- Cargo.toml +6 -6
- src/ai/server.rs +2 -2
- src/db/badge.rs +1 -1
- src/db/builder.rs +1 -1
- src/db/page.rs +1 -1
- src/db/pomodoro.rs +3 -3
- src/db/pool_question.rs +12 -12
- src/db/profile.rs +5 -5
- src/db/solution.rs +6 -6
- src/db/work_entry.rs +1 -1
- src/domain/answer_image.rs +1 -1
- src/domain/appointment.rs +1 -1
- src/domain/bank_question_image.rs +1 -1
- src/domain/board.rs +1 -1
- src/domain/board_stroke.rs +1 -1
- src/domain/builder.rs +1 -1
- src/domain/chatbot_message.rs +1 -1
- src/domain/chatbot_thread.rs +1 -1
- src/domain/course.rs +1 -1
- src/domain/course_note.rs +1 -1
- src/domain/course_note_file.rs +1 -1
- src/domain/course_session.rs +1 -1
- src/domain/event.rs +1 -1
- src/domain/exam.rs +1 -1
- src/domain/exam_question.rs +4 -4
- src/domain/homework.rs +1 -1
- src/domain/homework_file.rs +2 -2
- src/domain/meal_ledger.rs +1 -1
- src/domain/message.rs +1 -1
- src/domain/monotonic_id.rs +1 -1
- src/domain/note.rs +1 -1
- src/domain/note_file.rs +1 -1
- src/domain/payment_ledger.rs +1 -1
- src/domain/pomodoro.rs +1 -1
- src/domain/pool_question.rs +1 -1
- src/domain/question_image.rs +1 -1
- src/domain/rag_output.rs +1 -1
- src/domain/session.rs +1 -1
- src/domain/solution.rs +1 -1
- src/domain/subject.rs +2 -2
- src/domain/term.rs +1 -1
- src/domain/user.rs +6 -10
- src/domain/work_entry.rs +1 -1
- src/web/questions.rs +2 -2
- src/web/users.rs +1 -1
Cargo.lockmodified+153 -75
| @@ -134,9 +134,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 134 | 134 | checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072" |
| 135 | 135 | dependencies = [ |
| 136 | 136 | "base64ct", |
| 137 | - "blake2", | |
| 137 | + "blake2 0.10.6", | |
| 138 | 138 | "cpufeatures 0.2.17", |
| 139 | - "password-hash", | |
| 139 | + "password-hash 0.5.0", | |
| 140 | +] | |
| 141 | + | |
| 142 | +[[package]] | |
| 143 | +name = "argon2" | |
| 144 | +version = "0.6.0" | |
| 145 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 146 | +checksum = "134c52ddac6d63c576bef8168db10c83c49c26444ecbc68060fef078925a901c" | |
| 147 | +dependencies = [ | |
| 148 | + "base64ct", | |
| 149 | + "blake2 0.11.0", | |
| 150 | + "cpufeatures 0.3.1", | |
| 151 | + "password-hash 0.6.1", | |
| 140 | 152 | ] |
| 141 | 153 | |
| 142 | 154 | [[package]] |
| @@ -250,7 +262,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" | ||
| 250 | 262 | dependencies = [ |
| 251 | 263 | "proc-macro2", |
| 252 | 264 | "quote", |
| 253 | - "syn 3.0.3", | |
| 265 | + "syn 3.0.5", | |
| 254 | 266 | ] |
| 255 | 267 | |
| 256 | 268 | [[package]] |
| @@ -390,9 +402,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" | ||
| 390 | 402 | |
| 391 | 403 | [[package]] |
| 392 | 404 | name = "base64" |
| 393 | -version = "0.23.0" | |
| 405 | +version = "0.23.1" | |
| 394 | 406 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 395 | -checksum = "b25655df2c3cdd83c5e5b293b88acd880332b2ddadd7c30ac43144fdc0033da9" | |
| 407 | +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" | |
| 396 | 408 | |
| 397 | 409 | [[package]] |
| 398 | 410 | name = "base64ct" |
| @@ -484,6 +496,15 @@ dependencies = [ | ||
| 484 | 496 | "digest 0.10.7", |
| 485 | 497 | ] |
| 486 | 498 | |
| 499 | +[[package]] | |
| 500 | +name = "blake2" | |
| 501 | +version = "0.11.0" | |
| 502 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 503 | +checksum = "5b5d4d889834ee8ecfc0f8426ad30faf7cdcb10f741a8e6d7224d95325479f6f" | |
| 504 | +dependencies = [ | |
| 505 | + "digest 0.11.3", | |
| 506 | +] | |
| 507 | + | |
| 487 | 508 | [[package]] |
| 488 | 509 | name = "blake3" |
| 489 | 510 | version = "1.8.5" |
| @@ -495,7 +516,7 @@ dependencies = [ | ||
| 495 | 516 | "cc", |
| 496 | 517 | "cfg-if", |
| 497 | 518 | "constant_time_eq", |
| 498 | - "cpufeatures 0.3.0", | |
| 519 | + "cpufeatures 0.3.1", | |
| 499 | 520 | ] |
| 500 | 521 | |
| 501 | 522 | [[package]] |
| @@ -636,9 +657,9 @@ dependencies = [ | ||
| 636 | 657 | |
| 637 | 658 | [[package]] |
| 638 | 659 | name = "cc" |
| 639 | -version = "1.3.0" | |
| 660 | +version = "1.4.5" | |
| 640 | 661 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 641 | -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" | |
| 662 | +checksum = "005ec2760ca554fae18df7a11195552ec576cd665632a881bc011d5bb2fd4d80" | |
| 642 | 663 | dependencies = [ |
| 643 | 664 | "find-msvc-tools", |
| 644 | 665 | "jobserver", |
| @@ -660,12 +681,12 @@ checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" | ||
| 660 | 681 | |
| 661 | 682 | [[package]] |
| 662 | 683 | name = "chacha20" |
| 663 | -version = "0.10.1" | |
| 684 | +version = "0.10.2" | |
| 664 | 685 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 665 | -checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" | |
| 686 | +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" | |
| 666 | 687 | dependencies = [ |
| 667 | 688 | "cfg-if", |
| 668 | - "cpufeatures 0.3.0", | |
| 689 | + "cpufeatures 0.3.1", | |
| 669 | 690 | "rand_core 0.10.1", |
| 670 | 691 | ] |
| 671 | 692 | |
| @@ -729,6 +750,12 @@ dependencies = [ | ||
| 729 | 750 | "cc", |
| 730 | 751 | ] |
| 731 | 752 | |
| 753 | +[[package]] | |
| 754 | +name = "cmov" | |
| 755 | +version = "0.5.4" | |
| 756 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 757 | +checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a" | |
| 758 | + | |
| 732 | 759 | [[package]] |
| 733 | 760 | name = "concurrent-queue" |
| 734 | 761 | version = "2.5.0" |
| @@ -802,9 +829,9 @@ dependencies = [ | ||
| 802 | 829 | |
| 803 | 830 | [[package]] |
| 804 | 831 | name = "cpufeatures" |
| 805 | -version = "0.3.0" | |
| 832 | +version = "0.3.1" | |
| 806 | 833 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 807 | -checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" | |
| 834 | +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" | |
| 808 | 835 | dependencies = [ |
| 809 | 836 | "libc", |
| 810 | 837 | ] |
| @@ -916,6 +943,15 @@ dependencies = [ | ||
| 916 | 943 | "smallvec", |
| 917 | 944 | ] |
| 918 | 945 | |
| 946 | +[[package]] | |
| 947 | +name = "ctutils" | |
| 948 | +version = "0.4.2" | |
| 949 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 950 | +checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e" | |
| 951 | +dependencies = [ | |
| 952 | + "cmov", | |
| 953 | +] | |
| 954 | + | |
| 919 | 955 | [[package]] |
| 920 | 956 | name = "curve25519-dalek" |
| 921 | 957 | version = "4.1.3" |
| @@ -959,9 +995,9 @@ dependencies = [ | ||
| 959 | 995 | |
| 960 | 996 | [[package]] |
| 961 | 997 | name = "data-encoding" |
| 962 | -version = "2.11.0" | |
| 998 | +version = "2.11.1" | |
| 963 | 999 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 964 | -checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" | |
| 1000 | +checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06" | |
| 965 | 1001 | |
| 966 | 1002 | [[package]] |
| 967 | 1003 | name = "der" |
| @@ -1032,6 +1068,7 @@ dependencies = [ | ||
| 1032 | 1068 | "block-buffer 0.12.1", |
| 1033 | 1069 | "const-oid 0.10.2", |
| 1034 | 1070 | "crypto-common 0.2.2", |
| 1071 | + "ctutils", | |
| 1035 | 1072 | ] |
| 1036 | 1073 | |
| 1037 | 1074 | [[package]] |
| @@ -1094,13 +1131,13 @@ dependencies = [ | ||
| 1094 | 1131 | |
| 1095 | 1132 | [[package]] |
| 1096 | 1133 | name = "displaydoc" |
| 1097 | -version = "0.2.6" | |
| 1134 | +version = "0.2.7" | |
| 1098 | 1135 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1099 | -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" | |
| 1136 | +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" | |
| 1100 | 1137 | dependencies = [ |
| 1101 | 1138 | "proc-macro2", |
| 1102 | 1139 | "quote", |
| 1103 | - "syn 2.0.119", | |
| 1140 | + "syn 3.0.5", | |
| 1104 | 1141 | ] |
| 1105 | 1142 | |
| 1106 | 1143 | [[package]] |
| @@ -1318,9 +1355,9 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" | ||
| 1318 | 1355 | |
| 1319 | 1356 | [[package]] |
| 1320 | 1357 | name = "find-msvc-tools" |
| 1321 | -version = "0.1.9" | |
| 1358 | +version = "0.1.12" | |
| 1322 | 1359 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1323 | -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" | |
| 1360 | +checksum = "3e0f1c7c3a72c66fd80abe965175f7523475c0489a87d3ff9d6e8c87d87a9d2d" | |
| 1324 | 1361 | |
| 1325 | 1362 | [[package]] |
| 1326 | 1363 | name = "flatbuffers" |
| @@ -1405,9 +1442,9 @@ dependencies = [ | ||
| 1405 | 1442 | |
| 1406 | 1443 | [[package]] |
| 1407 | 1444 | name = "futures-channel" |
| 1408 | -version = "0.3.33" | |
| 1445 | +version = "0.3.34" | |
| 1409 | 1446 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1410 | -checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae" | |
| 1447 | +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" | |
| 1411 | 1448 | dependencies = [ |
| 1412 | 1449 | "futures-core", |
| 1413 | 1450 | "futures-sink", |
| @@ -1415,9 +1452,9 @@ dependencies = [ | ||
| 1415 | 1452 | |
| 1416 | 1453 | [[package]] |
| 1417 | 1454 | name = "futures-core" |
| 1418 | -version = "0.3.33" | |
| 1455 | +version = "0.3.34" | |
| 1419 | 1456 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1420 | -checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7" | |
| 1457 | +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" | |
| 1421 | 1458 | |
| 1422 | 1459 | [[package]] |
| 1423 | 1460 | name = "futures-executor" |
| @@ -1432,38 +1469,38 @@ dependencies = [ | ||
| 1432 | 1469 | |
| 1433 | 1470 | [[package]] |
| 1434 | 1471 | name = "futures-io" |
| 1435 | -version = "0.3.33" | |
| 1472 | +version = "0.3.34" | |
| 1436 | 1473 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1437 | -checksum = "4577ecaa3c4f96589d473f679a71b596316f6641bc350038b962a5daf0085d7a" | |
| 1474 | +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" | |
| 1438 | 1475 | |
| 1439 | 1476 | [[package]] |
| 1440 | 1477 | name = "futures-macro" |
| 1441 | -version = "0.3.33" | |
| 1478 | +version = "0.3.34" | |
| 1442 | 1479 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1443 | -checksum = "2d6d3cde68c518367be28956066ddfef33813991b77a55005a69dae04bf3b10b" | |
| 1480 | +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" | |
| 1444 | 1481 | dependencies = [ |
| 1445 | 1482 | "proc-macro2", |
| 1446 | 1483 | "quote", |
| 1447 | - "syn 2.0.119", | |
| 1484 | + "syn 3.0.5", | |
| 1448 | 1485 | ] |
| 1449 | 1486 | |
| 1450 | 1487 | [[package]] |
| 1451 | 1488 | name = "futures-sink" |
| 1452 | -version = "0.3.33" | |
| 1489 | +version = "0.3.34" | |
| 1453 | 1490 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1454 | -checksum = "e34418ac499d6305c2fb5ad0ed2f6ac998c5f8ca209b4510f7f94242c647e307" | |
| 1491 | +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" | |
| 1455 | 1492 | |
| 1456 | 1493 | [[package]] |
| 1457 | 1494 | name = "futures-task" |
| 1458 | -version = "0.3.33" | |
| 1495 | +version = "0.3.34" | |
| 1459 | 1496 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1460 | -checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109" | |
| 1497 | +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" | |
| 1461 | 1498 | |
| 1462 | 1499 | [[package]] |
| 1463 | 1500 | name = "futures-util" |
| 1464 | -version = "0.3.33" | |
| 1501 | +version = "0.3.34" | |
| 1465 | 1502 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1466 | -checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa" | |
| 1503 | +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" | |
| 1467 | 1504 | dependencies = [ |
| 1468 | 1505 | "futures-channel", |
| 1469 | 1506 | "futures-core", |
| @@ -1788,10 +1825,10 @@ name = "hezarfen_backend" | ||
| 1788 | 1825 | version = "0.1.0" |
| 1789 | 1826 | dependencies = [ |
| 1790 | 1827 | "anyhow", |
| 1791 | - "argon2", | |
| 1828 | + "argon2 0.6.0", | |
| 1792 | 1829 | "axum", |
| 1793 | 1830 | "axum-extra", |
| 1794 | - "base64 0.23.0", | |
| 1831 | + "base64 0.23.1", | |
| 1795 | 1832 | "chrono", |
| 1796 | 1833 | "dotenvy", |
| 1797 | 1834 | "futures-util", |
| @@ -1824,7 +1861,7 @@ dependencies = [ | ||
| 1824 | 1861 | "tracing", |
| 1825 | 1862 | "tracing-opentelemetry", |
| 1826 | 1863 | "tracing-subscriber", |
| 1827 | - "ulid", | |
| 1864 | + "ulid 3.0.0", | |
| 1828 | 1865 | "utoipa", |
| 1829 | 1866 | "utoipa-axum", |
| 1830 | 1867 | "utoipa-swagger-ui", |
| @@ -1912,9 +1949,9 @@ checksum = "15cdd26707701c53297e2fa6afb323d55fbc1d0810c3aec078ae3ef0424c3c15" | ||
| 1912 | 1949 | |
| 1913 | 1950 | [[package]] |
| 1914 | 1951 | name = "hybrid-array" |
| 1915 | -version = "0.4.13" | |
| 1952 | +version = "0.4.15" | |
| 1916 | 1953 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1917 | -checksum = "818356c5132c1fede50f837ca96afbe78ff42413047f4abb886217845e1b6c8c" | |
| 1954 | +checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17" | |
| 1918 | 1955 | dependencies = [ |
| 1919 | 1956 | "typenum", |
| 1920 | 1957 | ] |
| @@ -2242,7 +2279,7 @@ dependencies = [ | ||
| 2242 | 2279 | "js-sys", |
| 2243 | 2280 | "p256", |
| 2244 | 2281 | "p384", |
| 2245 | - "pem", | |
| 2282 | + "pem 3.0.6", | |
| 2246 | 2283 | "rand 0.8.7", |
| 2247 | 2284 | "rsa", |
| 2248 | 2285 | "serde", |
| @@ -2312,9 +2349,9 @@ dependencies = [ | ||
| 2312 | 2349 | |
| 2313 | 2350 | [[package]] |
| 2314 | 2351 | name = "log" |
| 2315 | -version = "0.4.33" | |
| 2352 | +version = "0.4.34" | |
| 2316 | 2353 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 2317 | -checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" | |
| 2354 | +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" | |
| 2318 | 2355 | |
| 2319 | 2356 | [[package]] |
| 2320 | 2357 | name = "lru-slab" |
| @@ -2575,9 +2612,9 @@ checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" | ||
| 2575 | 2612 | |
| 2576 | 2613 | [[package]] |
| 2577 | 2614 | name = "num-integer" |
| 2578 | -version = "0.1.46" | |
| 2615 | +version = "0.1.47" | |
| 2579 | 2616 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 2580 | -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" | |
| 2617 | +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" | |
| 2581 | 2618 | dependencies = [ |
| 2582 | 2619 | "num-traits", |
| 2583 | 2620 | ] |
| @@ -2841,6 +2878,16 @@ dependencies = [ | ||
| 2841 | 2878 | "subtle", |
| 2842 | 2879 | ] |
| 2843 | 2880 | |
| 2881 | +[[package]] | |
| 2882 | +name = "password-hash" | |
| 2883 | +version = "0.6.1" | |
| 2884 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2885 | +checksum = "aab41826031698d6ffcd9cff78ef56ef998e39dc7e5067cdfebe373842d4723b" | |
| 2886 | +dependencies = [ | |
| 2887 | + "getrandom 0.4.3", | |
| 2888 | + "phc", | |
| 2889 | +] | |
| 2890 | + | |
| 2844 | 2891 | [[package]] |
| 2845 | 2892 | name = "paste" |
| 2846 | 2893 | version = "1.0.15" |
| @@ -2861,7 +2908,7 @@ checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" | ||
| 2861 | 2908 | dependencies = [ |
| 2862 | 2909 | "digest 0.10.7", |
| 2863 | 2910 | "hmac", |
| 2864 | - "password-hash", | |
| 2911 | + "password-hash 0.5.0", | |
| 2865 | 2912 | "sha2 0.10.9", |
| 2866 | 2913 | ] |
| 2867 | 2914 | |
| @@ -2881,6 +2928,16 @@ dependencies = [ | ||
| 2881 | 2928 | "serde_core", |
| 2882 | 2929 | ] |
| 2883 | 2930 | |
| 2931 | +[[package]] | |
| 2932 | +name = "pem" | |
| 2933 | +version = "4.0.0" | |
| 2934 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2935 | +checksum = "d354a98a3d1251555de99e8fdd8afda05573c31b82f59063a7b0a29b5527f120" | |
| 2936 | +dependencies = [ | |
| 2937 | + "base64 0.23.1", | |
| 2938 | + "serde_core", | |
| 2939 | +] | |
| 2940 | + | |
| 2884 | 2941 | [[package]] |
| 2885 | 2942 | name = "pem-rfc7468" |
| 2886 | 2943 | version = "0.7.0" |
| @@ -2896,6 +2953,17 @@ version = "2.3.2" | ||
| 2896 | 2953 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 2897 | 2954 | checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" |
| 2898 | 2955 | |
| 2956 | +[[package]] | |
| 2957 | +name = "phc" | |
| 2958 | +version = "0.6.1" | |
| 2959 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2960 | +checksum = "44dc769b75f93afdddd8c7fa12d685292ddeff1e66f7f0f3a234cf1818afe892" | |
| 2961 | +dependencies = [ | |
| 2962 | + "base64ct", | |
| 2963 | + "ctutils", | |
| 2964 | + "getrandom 0.4.3", | |
| 2965 | +] | |
| 2966 | + | |
| 2899 | 2967 | [[package]] |
| 2900 | 2968 | name = "phf" |
| 2901 | 2969 | version = "0.13.1" |
| @@ -3402,11 +3470,11 @@ dependencies = [ | ||
| 3402 | 3470 | |
| 3403 | 3471 | [[package]] |
| 3404 | 3472 | name = "rcgen" |
| 3405 | -version = "0.14.8" | |
| 3473 | +version = "0.14.10" | |
| 3406 | 3474 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3407 | -checksum = "57f6d249aad744e274e682777a50283a225a32705394ee6d5fcc01efa25e4055" | |
| 3475 | +checksum = "8774e05a7d0de114588e6a28fe7e71694b82614ed569d86d8b389dfbc98b8ad8" | |
| 3408 | 3476 | dependencies = [ |
| 3409 | - "pem", | |
| 3477 | + "pem 4.0.0", | |
| 3410 | 3478 | "ring", |
| 3411 | 3479 | "rustls-pki-types", |
| 3412 | 3480 | "time", |
| @@ -3800,9 +3868,9 @@ dependencies = [ | ||
| 3800 | 3868 | |
| 3801 | 3869 | [[package]] |
| 3802 | 3870 | name = "rustls" |
| 3803 | -version = "0.23.42" | |
| 3871 | +version = "0.23.44" | |
| 3804 | 3872 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3805 | -checksum = "3c54fcab019b409d04215d3a17cb438fd7fbf192ee61461f20f4fe18704bc138" | |
| 3873 | +checksum = "6725596c3f2c3a0aef021139e145d4eafe314a6623e4680ca83852b2c67ab2ba" | |
| 3806 | 3874 | dependencies = [ |
| 3807 | 3875 | "log", |
| 3808 | 3876 | "once_cell", |
| @@ -3834,9 +3902,9 @@ dependencies = [ | ||
| 3834 | 3902 | |
| 3835 | 3903 | [[package]] |
| 3836 | 3904 | name = "rustls-webpki" |
| 3837 | -version = "0.103.13" | |
| 3905 | +version = "0.103.15" | |
| 3838 | 3906 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3839 | -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" | |
| 3907 | +checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2" | |
| 3840 | 3908 | dependencies = [ |
| 3841 | 3909 | "ring", |
| 3842 | 3910 | "rustls-pki-types", |
| @@ -3897,7 +3965,7 @@ version = "0.11.0" | ||
| 3897 | 3965 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3898 | 3966 | checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" |
| 3899 | 3967 | dependencies = [ |
| 3900 | - "password-hash", | |
| 3968 | + "password-hash 0.5.0", | |
| 3901 | 3969 | "pbkdf2", |
| 3902 | 3970 | "salsa20", |
| 3903 | 3971 | "sha2 0.10.9", |
| @@ -3970,7 +4038,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" | ||
| 3970 | 4038 | dependencies = [ |
| 3971 | 4039 | "proc-macro2", |
| 3972 | 4040 | "quote", |
| 3973 | - "syn 3.0.3", | |
| 4041 | + "syn 3.0.5", | |
| 3974 | 4042 | ] |
| 3975 | 4043 | |
| 3976 | 4044 | [[package]] |
| @@ -4027,7 +4095,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 4027 | 4095 | checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214" |
| 4028 | 4096 | dependencies = [ |
| 4029 | 4097 | "cfg-if", |
| 4030 | - "cpufeatures 0.3.0", | |
| 4098 | + "cpufeatures 0.3.1", | |
| 4031 | 4099 | "digest 0.11.3", |
| 4032 | 4100 | ] |
| 4033 | 4101 | |
| @@ -4049,7 +4117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 4049 | 4117 | checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" |
| 4050 | 4118 | dependencies = [ |
| 4051 | 4119 | "cfg-if", |
| 4052 | - "cpufeatures 0.3.0", | |
| 4120 | + "cpufeatures 0.3.1", | |
| 4053 | 4121 | "digest 0.11.3", |
| 4054 | 4122 | ] |
| 4055 | 4123 | |
| @@ -4301,7 +4369,7 @@ dependencies = [ | ||
| 4301 | 4369 | "ahash 0.8.12", |
| 4302 | 4370 | "ammonia", |
| 4303 | 4371 | "anyhow", |
| 4304 | - "argon2", | |
| 4372 | + "argon2 0.5.3", | |
| 4305 | 4373 | "async-channel", |
| 4306 | 4374 | "async-stream", |
| 4307 | 4375 | "base64 0.22.1", |
| @@ -4376,7 +4444,7 @@ dependencies = [ | ||
| 4376 | 4444 | "tokio", |
| 4377 | 4445 | "tokio-util", |
| 4378 | 4446 | "tracing", |
| 4379 | - "ulid", | |
| 4447 | + "ulid 1.2.1", | |
| 4380 | 4448 | "unicase", |
| 4381 | 4449 | "url", |
| 4382 | 4450 | "uuid", |
| @@ -4446,7 +4514,7 @@ dependencies = [ | ||
| 4446 | 4514 | "surrealdb-protocol", |
| 4447 | 4515 | "surrealdb-types-derive", |
| 4448 | 4516 | "tracing", |
| 4449 | - "ulid", | |
| 4517 | + "ulid 1.2.1", | |
| 4450 | 4518 | "url", |
| 4451 | 4519 | "uuid", |
| 4452 | 4520 | ] |
| @@ -4509,9 +4577,9 @@ dependencies = [ | ||
| 4509 | 4577 | |
| 4510 | 4578 | [[package]] |
| 4511 | 4579 | name = "syn" |
| 4512 | -version = "3.0.3" | |
| 4580 | +version = "3.0.5" | |
| 4513 | 4581 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 4514 | -checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" | |
| 4582 | +checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9" | |
| 4515 | 4583 | dependencies = [ |
| 4516 | 4584 | "proc-macro2", |
| 4517 | 4585 | "quote", |
| @@ -4582,22 +4650,22 @@ dependencies = [ | ||
| 4582 | 4650 | |
| 4583 | 4651 | [[package]] |
| 4584 | 4652 | name = "thiserror" |
| 4585 | -version = "2.0.19" | |
| 4653 | +version = "2.0.20" | |
| 4586 | 4654 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 4587 | -checksum = "09a43598840e33d5b0331f38c5e30d13bb11c11210a4b58f0d9b18a5a5eefcd9" | |
| 4655 | +checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" | |
| 4588 | 4656 | dependencies = [ |
| 4589 | 4657 | "thiserror-impl", |
| 4590 | 4658 | ] |
| 4591 | 4659 | |
| 4592 | 4660 | [[package]] |
| 4593 | 4661 | name = "thiserror-impl" |
| 4594 | -version = "2.0.19" | |
| 4662 | +version = "2.0.20" | |
| 4595 | 4663 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 4596 | -checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" | |
| 4664 | +checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" | |
| 4597 | 4665 | dependencies = [ |
| 4598 | 4666 | "proc-macro2", |
| 4599 | 4667 | "quote", |
| 4600 | - "syn 3.0.3", | |
| 4668 | + "syn 3.0.5", | |
| 4601 | 4669 | ] |
| 4602 | 4670 | |
| 4603 | 4671 | [[package]] |
| @@ -4611,9 +4679,9 @@ dependencies = [ | ||
| 4611 | 4679 | |
| 4612 | 4680 | [[package]] |
| 4613 | 4681 | name = "time" |
| 4614 | -version = "0.3.54" | |
| 4682 | +version = "0.3.55" | |
| 4615 | 4683 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 4616 | -checksum = "3e1d5e639ff6bab73cb6885cc7e7b1de96c3f32c68ec55f3952614bec1092244" | |
| 4684 | +checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134" | |
| 4617 | 4685 | dependencies = [ |
| 4618 | 4686 | "deranged", |
| 4619 | 4687 | "num-conv", |
| @@ -5099,6 +5167,16 @@ dependencies = [ | ||
| 5099 | 5167 | "web-time", |
| 5100 | 5168 | ] |
| 5101 | 5169 | |
| 5170 | +[[package]] | |
| 5171 | +name = "ulid" | |
| 5172 | +version = "3.0.0" | |
| 5173 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 5174 | +checksum = "947dde63b6d514cc5e044edad4e0ca7261afd1099d16c83d942cb2b2f348689c" | |
| 5175 | +dependencies = [ | |
| 5176 | + "rand 0.10.2", | |
| 5177 | + "web-time", | |
| 5178 | +] | |
| 5179 | + | |
| 5102 | 5180 | [[package]] |
| 5103 | 5181 | name = "unarray" |
| 5104 | 5182 | version = "0.1.4" |
| @@ -5222,9 +5300,9 @@ dependencies = [ | ||
| 5222 | 5300 | |
| 5223 | 5301 | [[package]] |
| 5224 | 5302 | name = "uuid" |
| 5225 | -version = "1.26.0" | |
| 5303 | +version = "1.26.1" | |
| 5226 | 5304 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 5227 | -checksum = "b5772d71c9be8a8a6ac2117d949c5b224c1b72241bb611d9a3012edcf8af7812" | |
| 5305 | +checksum = "2ef6dac1e96601b4fb3acccccff2139741fcb757cb9a36089bf5be91cfb285ce" | |
| 5228 | 5306 | dependencies = [ |
| 5229 | 5307 | "getrandom 0.4.3", |
| 5230 | 5308 | "js-sys", |
| @@ -5744,18 +5822,18 @@ dependencies = [ | ||
| 5744 | 5822 | |
| 5745 | 5823 | [[package]] |
| 5746 | 5824 | name = "zerocopy" |
| 5747 | -version = "0.8.55" | |
| 5825 | +version = "0.8.57" | |
| 5748 | 5826 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 5749 | -checksum = "b5a105cd7b140f6eeec8acff2ea38135d3cab283ada58540f629fe51e46696eb" | |
| 5827 | +checksum = "d35102a9f36d089ccae9e4c6802bc118be4487b80aaffc0ab4e0cf5ce92d2873" | |
| 5750 | 5828 | dependencies = [ |
| 5751 | 5829 | "zerocopy-derive", |
| 5752 | 5830 | ] |
| 5753 | 5831 | |
| 5754 | 5832 | [[package]] |
| 5755 | 5833 | name = "zerocopy-derive" |
| 5756 | -version = "0.8.55" | |
| 5834 | +version = "0.8.57" | |
| 5757 | 5835 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 5758 | -checksum = "0fe976fb70c78cd64cccfe3a6fc142244e8a77b70959b30faf9d0ac37ee228eb" | |
| 5836 | +checksum = "146c01f5ab44258da43cf276c74a2763db2ff3969c9c652c3f2de07041d0b2bc" | |
| 5759 | 5837 | dependencies = [ |
| 5760 | 5838 | "proc-macro2", |
| 5761 | 5839 | "quote", |
Cargo.tomlmodified+6 -6
| @@ -23,10 +23,10 @@ surrealdb = { version = "3.2", default-features = false, features = ["protocol-w | ||
| 23 | 23 | serde = { version = "1", features = ["derive"] } |
| 24 | 24 | serde_json = "1" |
| 25 | 25 | chrono = "0.4" |
| 26 | -argon2 = "0.5" | |
| 26 | +argon2 = "0.6" | |
| 27 | 27 | getrandom = "0.4" |
| 28 | 28 | hex = "0.4" |
| 29 | -ulid = "1" | |
| 29 | +ulid = "3" | |
| 30 | 30 | thiserror = "2" |
| 31 | 31 | anyhow = "1" |
| 32 | 32 | tracing = "0.1" |
| @@ -37,9 +37,9 @@ utoipa = { version = "5.5.0", features = ["axum_extras"] } | ||
| 37 | 37 | utoipa-axum = "0.2.0" |
| 38 | 38 | utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] } |
| 39 | 39 | quinn = { version = "0.11.11", default-features = false, features = ["runtime-tokio", "rustls-ring", "log"] } |
| 40 | -rcgen = { version = "0.14.8", default-features = false, features = ["pem", "ring"] } | |
| 40 | +rcgen = { version = "0.14.10", default-features = false, features = ["pem", "ring"] } | |
| 41 | 41 | rustls-pemfile = "2.2.0" |
| 42 | -rustls = { version = "0.23.42", default-features = false, features = ["logging", "ring", "std", "tls12"] } | |
| 42 | +rustls = { version = "0.23.44", default-features = false, features = ["logging", "ring", "std", "tls12"] } | |
| 43 | 43 | sha2 = "0.11.0" |
| 44 | 44 | base64 = "0.23" |
| 45 | 45 | # `ServiceExt::oneshot`, which is how the AI bridge dispatches a service's api |
| @@ -49,7 +49,7 @@ tower = { version = "0.5", features = ["util"] } | ||
| 49 | 49 | opentelemetry = "0.32.0" |
| 50 | 50 | tracing-opentelemetry = "0.33.0" |
| 51 | 51 | opentelemetry-semantic-conventions = "0.32.1" |
| 52 | -uuid = { version = "1.26.0", features = ["v4"] } | |
| 52 | +uuid = { version = "1.26.1", features = ["v4"] } | |
| 53 | 53 | opentelemetry_sdk = { version = "0.32.1", features = ["rt-tokio"] } |
| 54 | 54 | opentelemetry-otlp = { version = "0.32.0", default-features = false, features = ["trace", "metrics", "logs", "grpc-tonic", "http-proto", "reqwest-blocking-client", "internal-logs"] } |
| 55 | 55 | opentelemetry-appender-tracing = "0.32.0" |
| @@ -60,7 +60,7 @@ tokio = { version = "1", features = ["full", "test-util"] } | ||
| 60 | 60 | reqwest = { version = "0.13", default-features = false, features = ["json", "cookies"] } |
| 61 | 61 | tempfile = "3" |
| 62 | 62 | tokio-tungstenite = "0.30.0" |
| 63 | -futures-util = "0.3.32" | |
| 63 | +futures-util = "0.3.34" | |
| 64 | 64 | proptest = "1.11.0" |
| 65 | 65 | # Compiles the pattern `GET /limits` publishes and runs it over the same inputs |
| 66 | 66 | # the validator sees, so the published promise cannot drift from the accept set. |
src/ai/server.rsmodified+2 -2
| @@ -260,7 +260,7 @@ impl AiBridge { | ||
| 260 | 260 | // function returns by any path, so an abandoned request frees the |
| 261 | 261 | // worker's slot rather than leaking it. |
| 262 | 262 | let lease = self.inner.registry.pick(capability)?; |
| 263 | - let id = Ulid::new().to_string(); | |
| 263 | + let id = Ulid::generate().to_string(); | |
| 264 | 264 | let deadline_ms = timeout.as_millis().min(u64::MAX as u128) as u64; |
| 265 | 265 | let request = Request { |
| 266 | 266 | id: id.clone(), |
| @@ -995,7 +995,7 @@ async fn register( | ||
| 995 | 995 | return Err(()); |
| 996 | 996 | } |
| 997 | 997 | |
| 998 | - let worker_id = Ulid::new().to_string(); | |
| 998 | + let worker_id = Ulid::generate().to_string(); | |
| 999 | 999 | let max_concurrent = clamp_concurrency(hello.max_concurrent); |
| 1000 | 1000 | let greeting = Greeting::Welcome { |
| 1001 | 1001 | worker_id: worker_id.clone(), |
src/db/badge.rsmodified+1 -1
| @@ -184,7 +184,7 @@ mod tests { | ||
| 184 | 184 | |
| 185 | 185 | /// A user row carrying `counters`, by column name. |
| 186 | 186 | async fn a_user(counters: &[(&str, i64)], db: &Database) -> UserId { |
| 187 | - let user = UserId::from_key(&ulid::Ulid::new().to_string()); | |
| 187 | + let user = UserId::from_key(&ulid::Ulid::generate().to_string()); | |
| 188 | 188 | let sets: Vec<String> = counters |
| 189 | 189 | .iter() |
| 190 | 190 | .map(|(field, value)| format!("{field} = {value}")) |
src/db/builder.rsmodified+1 -1
| @@ -41,7 +41,7 @@ pub async fn create_session( | ||
| 41 | 41 | db: &Database, |
| 42 | 42 | builder: &BuilderId, |
| 43 | 43 | ) -> Result<BuilderSession, AppError> { |
| 44 | - let key = RecordId::new(BUILDER_SESSION_TABLE, Ulid::new().to_string()); | |
| 44 | + let key = RecordId::new(BUILDER_SESSION_TABLE, Ulid::generate().to_string()); | |
| 45 | 45 | let session = BuilderSession { |
| 46 | 46 | id: key.clone(), |
| 47 | 47 | builder: builder.clone(), |
src/db/page.rsmodified+1 -1
| @@ -206,7 +206,7 @@ mod tests { | ||
| 206 | 206 | #[tokio::test] |
| 207 | 207 | async fn the_window_walks_the_rows_and_total_stays_the_whole_list() { |
| 208 | 208 | let db = database::init_mem().await.unwrap(); |
| 209 | - let user = UserId::from_key(&Ulid::new().to_string()); | |
| 209 | + let user = UserId::from_key(&Ulid::generate().to_string()); | |
| 210 | 210 | for i in 0..5 { |
| 211 | 211 | note::create( |
| 212 | 212 | &db, |
src/db/pomodoro.rsmodified+3 -3
| @@ -282,7 +282,7 @@ mod tests { | ||
| 282 | 282 | /// touches a record that exists, so a fabricated id would silently store |
| 283 | 283 | /// nothing. The tests above need no row — they read only the stint log. |
| 284 | 284 | async fn a_user(db: &Database) -> UserId { |
| 285 | - let user = UserId::from_key(&Ulid::new().to_string()); | |
| 285 | + let user = UserId::from_key(&Ulid::generate().to_string()); | |
| 286 | 286 | db.query("CREATE $usr SET username = $name, password_hash = 'x'") |
| 287 | 287 | .bind(("usr", user.record())) |
| 288 | 288 | .bind(("name", user.key().to_string())) |
| @@ -699,7 +699,7 @@ mod tests { | ||
| 699 | 699 | let db = database::init_mem().await.unwrap(); |
| 700 | 700 | // A `record<user>` column checks the table of the id, not row |
| 701 | 701 | // existence — a fabricated id keeps this test free of user ceremony. |
| 702 | - let user = UserId::from_key(&Ulid::new().to_string()); | |
| 702 | + let user = UserId::from_key(&Ulid::generate().to_string()); | |
| 703 | 703 | |
| 704 | 704 | // Nothing running yet — finishing conflicts. |
| 705 | 705 | assert!(matches!( |
| @@ -733,7 +733,7 @@ mod tests { | ||
| 733 | 733 | #[tokio::test] |
| 734 | 734 | async fn a_backwards_clock_records_a_zero_stint_not_a_negative_one() { |
| 735 | 735 | let db = database::init_mem().await.unwrap(); |
| 736 | - let user = UserId::from_key(&Ulid::new().to_string()); | |
| 736 | + let user = UserId::from_key(&Ulid::generate().to_string()); | |
| 737 | 737 | |
| 738 | 738 | start(&db, &user, None).await.unwrap(); |
| 739 | 739 | // Stand in for the NTP step: push the running stint's start an hour |
src/db/pool_question.rsmodified+12 -12
| @@ -288,7 +288,7 @@ mod tests { | ||
| 288 | 288 | /// The two counter columns plus a row to carry them: the `user` table is |
| 289 | 289 | /// SCHEMAFULL in production, and the counters are `option<int>` there. |
| 290 | 290 | async fn a_user(db: &Database) -> UserId { |
| 291 | - let user = UserId::from_key(&Ulid::new().to_string()); | |
| 291 | + let user = UserId::from_key(&Ulid::generate().to_string()); | |
| 292 | 292 | db.query(format!( |
| 293 | 293 | "DEFINE FIELD IF NOT EXISTS {POOL_APPROVED_TOTAL_FIELD} ON user TYPE option<int>; |
| 294 | 294 | DEFINE FIELD IF NOT EXISTS {POOL_PUBLISHED_TOTAL_FIELD} ON user TYPE option<int>; |
| @@ -336,8 +336,8 @@ mod tests { | ||
| 336 | 336 | #[tokio::test] |
| 337 | 337 | async fn approval_is_a_one_way_race_safe_transition() { |
| 338 | 338 | let db = database::init_mem().await.unwrap(); |
| 339 | - let asker = UserId::from_key(&Ulid::new().to_string()); | |
| 340 | - let teacher = UserId::from_key(&Ulid::new().to_string()); | |
| 339 | + let asker = UserId::from_key(&Ulid::generate().to_string()); | |
| 340 | + let teacher = UserId::from_key(&Ulid::generate().to_string()); | |
| 341 | 341 | |
| 342 | 342 | let q = insert(&db, question(&asker)).await.unwrap(); |
| 343 | 343 | assert_eq!(q.get_status(), STATUS_PENDING); |
| @@ -420,9 +420,9 @@ mod tests { | ||
| 420 | 420 | #[tokio::test] |
| 421 | 421 | async fn visibility_hides_others_pending_questions() { |
| 422 | 422 | let db = database::init_mem().await.unwrap(); |
| 423 | - let asker = UserId::from_key(&Ulid::new().to_string()); | |
| 424 | - let other = UserId::from_key(&Ulid::new().to_string()); | |
| 425 | - let teacher = UserId::from_key(&Ulid::new().to_string()); | |
| 423 | + let asker = UserId::from_key(&Ulid::generate().to_string()); | |
| 424 | + let other = UserId::from_key(&Ulid::generate().to_string()); | |
| 425 | + let teacher = UserId::from_key(&Ulid::generate().to_string()); | |
| 426 | 426 | |
| 427 | 427 | let pending = insert(&db, question(&asker)).await.unwrap(); |
| 428 | 428 | let published = insert(&db, question(&other)).await.unwrap(); |
| @@ -444,8 +444,8 @@ mod tests { | ||
| 444 | 444 | #[tokio::test] |
| 445 | 445 | async fn image_attaches_only_while_pending_and_reports_the_replaced_blob() { |
| 446 | 446 | let db = database::init_mem().await.unwrap(); |
| 447 | - let asker = UserId::from_key(&Ulid::new().to_string()); | |
| 448 | - let teacher = UserId::from_key(&Ulid::new().to_string()); | |
| 447 | + let asker = UserId::from_key(&Ulid::generate().to_string()); | |
| 448 | + let teacher = UserId::from_key(&Ulid::generate().to_string()); | |
| 449 | 449 | let png = FileContentType::try_new("image/png").unwrap(); |
| 450 | 450 | |
| 451 | 451 | let q = insert(&db, question(&asker)).await.unwrap(); |
| @@ -491,8 +491,8 @@ mod tests { | ||
| 491 | 491 | #[tokio::test] |
| 492 | 492 | async fn delete_cascades_solutions_and_returns_the_row() { |
| 493 | 493 | let db = database::init_mem().await.unwrap(); |
| 494 | - let asker = UserId::from_key(&Ulid::new().to_string()); | |
| 495 | - let helper = UserId::from_key(&Ulid::new().to_string()); | |
| 494 | + let asker = UserId::from_key(&Ulid::generate().to_string()); | |
| 495 | + let helper = UserId::from_key(&Ulid::generate().to_string()); | |
| 496 | 496 | |
| 497 | 497 | let q = insert(&db, question(&asker)).await.unwrap(); |
| 498 | 498 | let offered = crate::db::solution::insert( |
| @@ -564,8 +564,8 @@ mod tests { | ||
| 564 | 564 | |
| 565 | 565 | let (mut solutions, mut swept, mut delete_500) = (0, 0, 0); |
| 566 | 566 | for round in 0..4 { |
| 567 | - let asker = UserId::from_key(&Ulid::new().to_string()); | |
| 568 | - let helper = UserId::from_key(&Ulid::new().to_string()); | |
| 567 | + let asker = UserId::from_key(&Ulid::generate().to_string()); | |
| 568 | + let helper = UserId::from_key(&Ulid::generate().to_string()); | |
| 569 | 569 | let q = insert(&db, question(&asker)).await.unwrap(); |
| 570 | 570 | let id = q.get_id().clone(); |
| 571 | 571 |
src/db/profile.rsmodified+5 -5
| @@ -102,7 +102,7 @@ mod tests { | ||
| 102 | 102 | #[tokio::test] |
| 103 | 103 | async fn stats_are_zero_without_pomodoro_rows() { |
| 104 | 104 | let db = crate::database::init_mem().await.unwrap(); |
| 105 | - let user = UserId::from_key(&ulid::Ulid::new().to_string()); | |
| 105 | + let user = UserId::from_key(&ulid::Ulid::generate().to_string()); | |
| 106 | 106 | |
| 107 | 107 | let stats = load(&db, &user, 3, 1).await.unwrap(); |
| 108 | 108 | // Derived counters: no rows is a true zero, never a null. |
| @@ -121,7 +121,7 @@ mod tests { | ||
| 121 | 121 | #[tokio::test] |
| 122 | 122 | async fn lifetime_totals_ride_the_same_query() { |
| 123 | 123 | let db = crate::database::init_mem().await.unwrap(); |
| 124 | - let user = UserId::from_key(&ulid::Ulid::new().to_string()); | |
| 124 | + let user = UserId::from_key(&ulid::Ulid::generate().to_string()); | |
| 125 | 125 | db.query(format!( |
| 126 | 126 | "CREATE $usr SET username = $name, password_hash = 'x', |
| 127 | 127 | {} = 4, {} = 3", |
| @@ -148,8 +148,8 @@ mod tests { | ||
| 148 | 148 | #[tokio::test] |
| 149 | 149 | async fn stats_count_finished_stints_only() { |
| 150 | 150 | let db = crate::database::init_mem().await.unwrap(); |
| 151 | - let user = UserId::from_key(&ulid::Ulid::new().to_string()); | |
| 152 | - let other = UserId::from_key(&ulid::Ulid::new().to_string()); | |
| 151 | + let user = UserId::from_key(&ulid::Ulid::generate().to_string()); | |
| 152 | + let other = UserId::from_key(&ulid::Ulid::generate().to_string()); | |
| 153 | 153 | |
| 154 | 154 | // Two finished stints (1000 ms + 2500 ms), one still running, and one |
| 155 | 155 | // finished stint belonging to somebody else. |
| @@ -174,7 +174,7 @@ mod tests { | ||
| 174 | 174 | #[tokio::test] |
| 175 | 175 | async fn focus_time_never_reads_negative() { |
| 176 | 176 | let db = crate::database::init_mem().await.unwrap(); |
| 177 | - let user = UserId::from_key(&ulid::Ulid::new().to_string()); | |
| 177 | + let user = UserId::from_key(&ulid::Ulid::generate().to_string()); | |
| 178 | 178 | |
| 179 | 179 | // One honest 1000 ms stint and one inverted row — what a backwards |
| 180 | 180 | // clock step left behind before `finish` grew its floor. The raw sum is |
src/db/solution.rsmodified+6 -6
| @@ -183,7 +183,7 @@ mod tests { | ||
| 183 | 183 | crate::db::pool_question::insert( |
| 184 | 184 | db, |
| 185 | 185 | PoolQuestion::new( |
| 186 | - &UserId::from_key(&Ulid::new().to_string()), | |
| 186 | + &UserId::from_key(&Ulid::generate().to_string()), | |
| 187 | 187 | PoolQuestionTitle::try_new("soru").unwrap(), |
| 188 | 188 | PoolQuestionBody::try_new("neden").unwrap(), |
| 189 | 189 | ), |
| @@ -199,7 +199,7 @@ mod tests { | ||
| 199 | 199 | let db = database::init_mem().await.unwrap(); |
| 200 | 200 | let question_a = question_row(&db).await; |
| 201 | 201 | let question_b = question_row(&db).await; |
| 202 | - let author = UserId::from_key(&Ulid::new().to_string()); | |
| 202 | + let author = UserId::from_key(&Ulid::generate().to_string()); | |
| 203 | 203 | |
| 204 | 204 | // Distinct offer times so the assertion pins the real contract — |
| 205 | 205 | // older `offered_at` sorts first — not the same-millisecond `id` |
| @@ -257,7 +257,7 @@ mod tests { | ||
| 257 | 257 | async fn image_set_replace_clear_report_the_replaced_blob() { |
| 258 | 258 | let db = database::init_mem().await.unwrap(); |
| 259 | 259 | let question = question_row(&db).await; |
| 260 | - let author = UserId::from_key(&Ulid::new().to_string()); | |
| 260 | + let author = UserId::from_key(&Ulid::generate().to_string()); | |
| 261 | 261 | let png = FileContentType::try_new("image/png").unwrap(); |
| 262 | 262 | |
| 263 | 263 | let solution = insert( |
| @@ -318,7 +318,7 @@ mod tests { | ||
| 318 | 318 | async fn set_body_edits_in_place() { |
| 319 | 319 | let db = database::init_mem().await.unwrap(); |
| 320 | 320 | let question = question_row(&db).await; |
| 321 | - let author = UserId::from_key(&Ulid::new().to_string()); | |
| 321 | + let author = UserId::from_key(&Ulid::generate().to_string()); | |
| 322 | 322 | |
| 323 | 323 | let solution = insert( |
| 324 | 324 | &db, |
| @@ -346,7 +346,7 @@ mod tests { | ||
| 346 | 346 | assert!( |
| 347 | 347 | set_body( |
| 348 | 348 | &db, |
| 349 | - &SolutionId::from_key(&Ulid::new().to_string()), | |
| 349 | + &SolutionId::from_key(&Ulid::generate().to_string()), | |
| 350 | 350 | &SolutionBody::try_new("boş").unwrap(), |
| 351 | 351 | ) |
| 352 | 352 | .await |
| @@ -361,7 +361,7 @@ mod tests { | ||
| 361 | 361 | let two = question_row(&db).await; |
| 362 | 362 | let one = question_row(&db).await; |
| 363 | 363 | let none = question_row(&db).await; |
| 364 | - let author = UserId::from_key(&Ulid::new().to_string()); | |
| 364 | + let author = UserId::from_key(&Ulid::generate().to_string()); | |
| 365 | 365 | |
| 366 | 366 | for (question, bodies) in [(&two, vec!["a", "b"]), (&one, vec!["c"])] { |
| 367 | 367 | for body in bodies { |
src/db/work_entry.rsmodified+1 -1
| @@ -154,7 +154,7 @@ mod tests { | ||
| 154 | 154 | let db = database::init_mem().await.unwrap(); |
| 155 | 155 | // A `record<user>` column checks the table of the id, not row |
| 156 | 156 | // existence — a fabricated id keeps this test free of user ceremony. |
| 157 | - let user = UserId::from_key(&Ulid::new().to_string()); | |
| 157 | + let user = UserId::from_key(&Ulid::generate().to_string()); | |
| 158 | 158 | |
| 159 | 159 | let open = check_in(&db, &user).await.unwrap(); |
| 160 | 160 | assert!(open.is_open()); |
src/domain/answer_image.rsmodified+1 -1
| @@ -85,7 +85,7 @@ impl AnswerImage { | ||
| 85 | 85 | question: question.clone(), |
| 86 | 86 | user: user.clone(), |
| 87 | 87 | seq, |
| 88 | - file: Ulid::new().to_string(), | |
| 88 | + file: Ulid::generate().to_string(), | |
| 89 | 89 | content_type, |
| 90 | 90 | size, |
| 91 | 91 | } |
src/domain/appointment.rsmodified+1 -1
| @@ -50,7 +50,7 @@ use crate::domain::user::UserId; | ||
| 50 | 50 | use crate::error::ValidationError; |
| 51 | 51 | use crate::validate::validate_required; |
| 52 | 52 | |
| 53 | -/// Mints booking ids in write order — `Ulid::new()`'s random low bits sort | |
| 53 | +/// Mints booking ids in write order — `Ulid::generate()`'s random low bits sort | |
| 54 | 54 | /// arbitrarily within one millisecond, which would scramble the `id` tie-break |
| 55 | 55 | /// of the newest-first listings ([`crate::db::appointment::list_for_requester`]). |
| 56 | 56 | static IDS: LazyLock<std::sync::Mutex<Generator>> = |
src/domain/bank_question_image.rsmodified+1 -1
| @@ -73,7 +73,7 @@ impl BankQuestionImage { | ||
| 73 | 73 | id: BankQuestionImageId::for_slot(question, slot), |
| 74 | 74 | bank_question: question.clone(), |
| 75 | 75 | slot: slot.cloned(), |
| 76 | - file: Ulid::new().to_string(), | |
| 76 | + file: Ulid::generate().to_string(), | |
| 77 | 77 | content_type, |
| 78 | 78 | size, |
| 79 | 79 | } |
src/domain/board.rsmodified+1 -1
| @@ -25,7 +25,7 @@ use crate::validate::validate_required; | ||
| 25 | 25 | pub struct BoardId(RecordId); |
| 26 | 26 | |
| 27 | 27 | impl BoardId { |
| 28 | - /// Monotonic, not `Ulid::new()`: boards list newest-first by id, and a | |
| 28 | + /// Monotonic, not `Ulid::generate()`: boards list newest-first by id, and a | |
| 29 | 29 | /// random low half scrambles rows minted in the same millisecond. |
| 30 | 30 | pub fn generate() -> Self { |
| 31 | 31 | Self(RecordId::new(BOARD_TABLE, next_ulid().to_string())) |
src/domain/board_stroke.rsmodified+1 -1
| @@ -62,7 +62,7 @@ pub const REFUSALS: [&str; 5] = [ | ||
| 62 | 62 | pub struct BoardStrokeId(RecordId); |
| 63 | 63 | |
| 64 | 64 | impl BoardStrokeId { |
| 65 | - /// Monotonic, not `Ulid::new()`: this id *is* the board's total order, and | |
| 65 | + /// Monotonic, not `Ulid::generate()`: this id *is* the board's total order, and | |
| 66 | 66 | /// a random low half scrambles every stroke drawn in the same millisecond — |
| 67 | 67 | /// which is what a burst of drawing looks like. |
| 68 | 68 | pub fn generate() -> Self { |
src/domain/builder.rsmodified+1 -1
| @@ -24,7 +24,7 @@ pub struct BuilderId(RecordId); | ||
| 24 | 24 | |
| 25 | 25 | impl BuilderId { |
| 26 | 26 | pub fn generate() -> Self { |
| 27 | - Self(RecordId::new(BUILDER_TABLE, Ulid::new().to_string())) | |
| 27 | + Self(RecordId::new(BUILDER_TABLE, Ulid::generate().to_string())) | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | pub fn from_key(key: &str) -> Self { |
src/domain/chatbot_message.rsmodified+1 -1
| @@ -23,7 +23,7 @@ use crate::domain::user::UserId; | ||
| 23 | 23 | use crate::error::ValidationError; |
| 24 | 24 | use crate::validate::validate_required; |
| 25 | 25 | |
| 26 | -/// Mints message ids in write order. Unlike `Ulid::new()`, whose 80 random | |
| 26 | +/// Mints message ids in write order. Unlike `Ulid::generate()`, whose 80 random | |
| 27 | 27 | /// low bits sort arbitrarily among ids minted in the same millisecond, this |
| 28 | 28 | /// increments the previous id — so the `id` tie-break in the `ORDER BY` of |
| 29 | 29 | /// [`list_for_thread`](crate::db::chatbot_message::list_for_thread) / |
src/domain/chatbot_thread.rsmodified+1 -1
| @@ -17,7 +17,7 @@ use crate::validate::validate_required; | ||
| 17 | 17 | pub struct ChatbotThreadId(RecordId); |
| 18 | 18 | |
| 19 | 19 | impl ChatbotThreadId { |
| 20 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 20 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 21 | 21 | /// threads sort `updated_at DESC, id DESC` and the id breaks the tie |
| 22 | 22 | /// between two threads last touched in the same millisecond, |
| 23 | 23 | /// and a random low half sorts arbitrarily inside one millisecond. |
src/domain/course.rsmodified+1 -1
| @@ -11,7 +11,7 @@ use crate::validate::{validate_course_kind, validate_optional, validate_required | ||
| 11 | 11 | pub struct CourseId(RecordId); |
| 12 | 12 | |
| 13 | 13 | impl CourseId { |
| 14 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 14 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 15 | 15 | /// courses list `id DESC` (newest first, [`crate::db::course::list_all`]), |
| 16 | 16 | /// and a random low half scrambles rows minted in the same millisecond. |
| 17 | 17 | pub fn generate() -> Self { |
src/domain/course_note.rsmodified+1 -1
| @@ -11,7 +11,7 @@ use crate::validate::{validate_optional, validate_required}; | ||
| 11 | 11 | pub struct CourseNoteId(RecordId); |
| 12 | 12 | |
| 13 | 13 | impl CourseNoteId { |
| 14 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 14 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 15 | 15 | /// a course's notes list `id DESC` (newest first, |
| 16 | 16 | /// [`crate::db::course_note::list_for_course`]), and a random low half |
| 17 | 17 | /// scrambles rows minted in the same millisecond. |
src/domain/course_note_file.rsmodified+1 -1
| @@ -20,7 +20,7 @@ use crate::domain::monotonic_id::next_ulid; | ||
| 20 | 20 | pub struct CourseNoteFileId(RecordId); |
| 21 | 21 | |
| 22 | 22 | impl CourseNoteFileId { |
| 23 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 23 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 24 | 24 | /// a note's files list `id DESC` (newest first, |
| 25 | 25 | /// [`crate::db::course_note_file::list_for`]), and a random low half |
| 26 | 26 | /// scrambles rows minted in the same millisecond. |
src/domain/course_session.rsmodified+1 -1
| @@ -12,7 +12,7 @@ use crate::validate::validate_optional; | ||
| 12 | 12 | pub struct CourseSessionId(RecordId); |
| 13 | 13 | |
| 14 | 14 | impl CourseSessionId { |
| 15 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 15 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 16 | 16 | /// a course's sessions sort `starts_at DESC, id DESC` and the id breaks |
| 17 | 17 | /// the tie between two sessions starting at the same instant, |
| 18 | 18 | /// and a random low half sorts arbitrarily inside one millisecond. |
src/domain/event.rsmodified+1 -1
| @@ -16,7 +16,7 @@ use crate::validate::{validate_optional, validate_required}; | ||
| 16 | 16 | pub struct EventId(RecordId); |
| 17 | 17 | |
| 18 | 18 | impl EventId { |
| 19 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 19 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 20 | 20 | /// events list `id DESC` (newest first, [`crate::db::event::list_all`]), |
| 21 | 21 | /// and a random low half scrambles rows minted in the same millisecond. |
| 22 | 22 | pub fn generate() -> Self { |
src/domain/exam.rsmodified+1 -1
| @@ -28,7 +28,7 @@ use crate::validate::{ | ||
| 28 | 28 | pub struct ExamId(RecordId); |
| 29 | 29 | |
| 30 | 30 | impl ExamId { |
| 31 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 31 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 32 | 32 | /// exams list `id DESC` (newest first, [`crate::db::exam::list_all`]), |
| 33 | 33 | /// and a random low half scrambles rows minted in the same millisecond. |
| 34 | 34 | pub fn generate() -> Self { |
src/domain/exam_question.rsmodified+4 -4
| @@ -16,7 +16,7 @@ use crate::validate::{validate_question_kind, validate_question_points, validate | ||
| 16 | 16 | pub struct ExamQuestionId(RecordId); |
| 17 | 17 | |
| 18 | 18 | impl ExamQuestionId { |
| 19 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: the | |
| 19 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: the | |
| 20 | 20 | /// id *is* the question's presentation order |
| 21 | 21 | /// ([`crate::db::exam_question::list_for_exam`] |
| 22 | 22 | /// sorts `id ASC`), and a random low half scrambles a burst of saves that |
| @@ -115,11 +115,11 @@ impl ChoiceText { | ||
| 115 | 115 | pub struct ChoiceId(String); |
| 116 | 116 | |
| 117 | 117 | impl ChoiceId { |
| 118 | - /// Plain `Ulid::new()` deliberately: options are ordered by their position | |
| 118 | + /// Plain `Ulid::generate()` deliberately: options are ordered by their position | |
| 119 | 119 | /// in the stored `Vec`, never by id, so nothing here reads the id as a |
| 120 | 120 | /// clock — it only has to be unique. |
| 121 | 121 | fn generate() -> Self { |
| 122 | - Self(Ulid::new().to_string()) | |
| 122 | + Self(Ulid::generate().to_string()) | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | pub fn as_str(&self) -> &str { |
| @@ -408,7 +408,7 @@ mod tests { | ||
| 408 | 408 | /// A teacher saving several questions back to back gets them back in that |
| 409 | 409 | /// order: `list_for_exam` sorts `id ASC`, so the ids minted inside one |
| 410 | 410 | /// millisecond have to sort in mint order. Revert `generate` to |
| 411 | - /// `Ulid::new()` and this fails — the low 80 bits are redrawn per id, so a | |
| 411 | + /// `Ulid::generate()` and this fails — the low 80 bits are redrawn per id, so a | |
| 412 | 412 | /// same-tick burst comes out shuffled. |
| 413 | 413 | #[tokio::test] |
| 414 | 414 | async fn ids_sort_in_creation_order() { |
src/domain/homework.rsmodified+1 -1
| @@ -27,7 +27,7 @@ use crate::validate::{validate_optional, validate_required}; | ||
| 27 | 27 | pub struct HomeworkId(RecordId); |
| 28 | 28 | |
| 29 | 29 | impl HomeworkId { |
| 30 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 30 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 31 | 31 | /// homework lists `id DESC` (newest first, [`Homework::list_all`]), |
| 32 | 32 | /// and a random low half scrambles rows minted in the same millisecond. |
| 33 | 33 | pub fn generate() -> Self { |
src/domain/homework_file.rsmodified+2 -2
| @@ -23,7 +23,7 @@ use crate::domain::timestamp::Timestamp; | ||
| 23 | 23 | pub struct HomeworkFileId(RecordId); |
| 24 | 24 | |
| 25 | 25 | impl HomeworkFileId { |
| 26 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 26 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 27 | 27 | /// a submission's files list `id DESC` (newest first, [`HomeworkFile::list_for_submission`]), |
| 28 | 28 | /// and a random low half scrambles rows minted in the same millisecond. |
| 29 | 29 | pub fn generate() -> Self { |
| @@ -75,7 +75,7 @@ impl HomeworkFile { | ||
| 75 | 75 | name, |
| 76 | 76 | content_type, |
| 77 | 77 | size, |
| 78 | - file: Ulid::new().to_string(), | |
| 78 | + file: Ulid::generate().to_string(), | |
| 79 | 79 | created_at: Timestamp::now(), |
| 80 | 80 | } |
| 81 | 81 | } |
src/domain/meal_ledger.rsmodified+1 -1
| @@ -70,7 +70,7 @@ use crate::domain::user::UserId; | ||
| 70 | 70 | use crate::error::ValidationError; |
| 71 | 71 | use crate::validate::validate_optional; |
| 72 | 72 | |
| 73 | -/// Mints ledger ids in write order — `Ulid::new()`'s random low bits sort | |
| 73 | +/// Mints ledger ids in write order — `Ulid::generate()`'s random low bits sort | |
| 74 | 74 | /// arbitrarily within one millisecond, which would scramble the `id` tie-break |
| 75 | 75 | /// of the newest-first statement below. |
| 76 | 76 | static IDS: LazyLock<std::sync::Mutex<Generator>> = |
src/domain/message.rsmodified+1 -1
| @@ -100,7 +100,7 @@ impl Folder { | ||
| 100 | 100 | pub struct MessageId(RecordId); |
| 101 | 101 | |
| 102 | 102 | impl MessageId { |
| 103 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 103 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 104 | 104 | /// the folder listings sort `id DESC` (newest first, |
| 105 | 105 | /// [`crate::db::message::list_folder`]), |
| 106 | 106 | /// and a random low half scrambles rows minted in the same millisecond. |
src/domain/monotonic_id.rsmodified+1 -1
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | //! Ids that sort in write order, for tables whose listings lean on `id` to |
| 2 | 2 | //! break ties (or to mean "newest first" outright). |
| 3 | 3 | //! |
| 4 | -//! `Ulid::new()` fills the low 80 bits at random, so two ids minted in the | |
| 4 | +//! `Ulid::generate()` fills the low 80 bits at random, so two ids minted in the | |
| 5 | 5 | //! *same millisecond* sort arbitrarily against each other — millisecond- |
| 6 | 6 | //! accurate ordering only. That is not enough when a burst of writes lands |
| 7 | 7 | //! inside one tick (a recurring appointment publish expanding a series, a |
src/domain/note.rsmodified+1 -1
| @@ -10,7 +10,7 @@ use crate::validate::{validate_optional, validate_required}; | ||
| 10 | 10 | pub struct NoteId(RecordId); |
| 11 | 11 | |
| 12 | 12 | impl NoteId { |
| 13 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 13 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 14 | 14 | /// notes list `id DESC` (newest first, [`crate::db::note::list_for`]), |
| 15 | 15 | /// and a random low half scrambles rows minted in the same millisecond. |
| 16 | 16 | pub fn generate() -> Self { |
src/domain/note_file.rsmodified+1 -1
| @@ -16,7 +16,7 @@ use crate::error::ValidationError; | ||
| 16 | 16 | pub struct NoteFileId(RecordId); |
| 17 | 17 | |
| 18 | 18 | impl NoteFileId { |
| 19 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 19 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 20 | 20 | /// a note's files list `id DESC` (newest first, |
| 21 | 21 | /// [`crate::db::note_file::list_for`]), and a random low half scrambles |
| 22 | 22 | /// rows minted in the same millisecond. |
src/domain/payment_ledger.rsmodified+1 -1
| @@ -59,7 +59,7 @@ use crate::error::ValidationError; | ||
| 59 | 59 | pub struct PaymentLedgerId(RecordId); |
| 60 | 60 | |
| 61 | 61 | impl PaymentLedgerId { |
| 62 | - /// A fresh id in write order — `Ulid::new()`'s random low bits sort | |
| 62 | + /// A fresh id in write order — `Ulid::generate()`'s random low bits sort | |
| 63 | 63 | /// arbitrarily within one millisecond, which would scramble the `id` |
| 64 | 64 | /// tie-break of the newest-first statement below. |
| 65 | 65 | pub fn generate() -> Self { |
src/domain/pomodoro.rsmodified+1 -1
| @@ -9,7 +9,7 @@ use crate::domain::user::UserId; | ||
| 9 | 9 | pub struct PomodoroSessionId(RecordId); |
| 10 | 10 | |
| 11 | 11 | impl PomodoroSessionId { |
| 12 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 12 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 13 | 13 | /// the log sorts `started_at DESC, id DESC` and the id breaks the tie between |
| 14 | 14 | /// two sessions started at the same instant. The `open_` key below never ties |
| 15 | 15 | /// with itself (one running session per user), so it needs no ordering. |
src/domain/pool_question.rsmodified+1 -1
| @@ -28,7 +28,7 @@ use crate::validate::validate_required; | ||
| 28 | 28 | pub struct PoolQuestionId(RecordId); |
| 29 | 29 | |
| 30 | 30 | impl PoolQuestionId { |
| 31 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 31 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 32 | 32 | /// the pool sorts `asked_at DESC, id DESC` and the id *is* the tie-break |
| 33 | 33 | /// ([`crate::db::pool_question::list_all`]), |
| 34 | 34 | /// and a random low half scrambles rows minted in the same millisecond. |
src/domain/question_image.rsmodified+1 -1
| @@ -75,7 +75,7 @@ impl QuestionImage { | ||
| 75 | 75 | exam: exam.clone(), |
| 76 | 76 | question: question.clone(), |
| 77 | 77 | slot: slot.cloned(), |
| 78 | - file: Ulid::new().to_string(), | |
| 78 | + file: Ulid::generate().to_string(), | |
| 79 | 79 | content_type, |
| 80 | 80 | size, |
| 81 | 81 | } |
src/domain/rag_output.rsmodified+1 -1
| @@ -27,7 +27,7 @@ use crate::domain::timestamp::Timestamp; | ||
| 27 | 27 | pub struct RagOutputId(RecordId); |
| 28 | 28 | |
| 29 | 29 | impl RagOutputId { |
| 30 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 30 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 31 | 31 | /// a note's outputs list `id DESC` (newest first, |
| 32 | 32 | /// [`list_for`](crate::db::rag_output::list_for)). |
| 33 | 33 | pub fn generate() -> Self { |
src/domain/session.rsmodified+1 -1
| @@ -11,7 +11,7 @@ pub struct SessionId(RecordId); | ||
| 11 | 11 | |
| 12 | 12 | impl SessionId { |
| 13 | 13 | pub fn generate() -> Self { |
| 14 | - Self(RecordId::new(SESSION_TABLE, Ulid::new().to_string())) | |
| 14 | + Self(RecordId::new(SESSION_TABLE, Ulid::generate().to_string())) | |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | pub fn record(&self) -> RecordId { |
src/domain/solution.rsmodified+1 -1
| @@ -23,7 +23,7 @@ use crate::validate::validate_required; | ||
| 23 | 23 | pub struct SolutionId(RecordId); |
| 24 | 24 | |
| 25 | 25 | impl SolutionId { |
| 26 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 26 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 27 | 27 | /// solutions sort `offered_at ASC, id ASC` and the id *is* the tie-break |
| 28 | 28 | /// ([`crate::db::solution::list_for`]), |
| 29 | 29 | /// and a random low half scrambles rows minted in the same millisecond. |
src/domain/subject.rsmodified+2 -2
| @@ -10,7 +10,7 @@ use crate::validate::{validate_optional, validate_required}; | ||
| 10 | 10 | pub struct SubjectId(RecordId); |
| 11 | 11 | |
| 12 | 12 | impl SubjectId { |
| 13 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: the | |
| 13 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: the | |
| 14 | 14 | /// id *is* the curriculum's order ([`crate::db::subject::list_for_course`] |
| 15 | 15 | /// sorts `id ASC`), and a random low half scrambles a burst of saves that |
| 16 | 16 | /// lands inside one millisecond. |
| @@ -99,7 +99,7 @@ mod tests { | ||
| 99 | 99 | /// A teacher entering a curriculum gets it back in the order they typed it: |
| 100 | 100 | /// `list_for_course` sorts `id ASC`, so the ids minted inside one |
| 101 | 101 | /// millisecond have to sort in mint order. Revert `generate` to |
| 102 | - /// `Ulid::new()` and this fails — the low 80 bits are redrawn per id, so a | |
| 102 | + /// `Ulid::generate()` and this fails — the low 80 bits are redrawn per id, so a | |
| 103 | 103 | /// same-tick burst comes out shuffled. |
| 104 | 104 | #[tokio::test] |
| 105 | 105 | async fn ids_sort_in_creation_order() { |
src/domain/term.rsmodified+1 -1
| @@ -18,7 +18,7 @@ use crate::validate::validate_required; | ||
| 18 | 18 | pub struct TermId(RecordId); |
| 19 | 19 | |
| 20 | 20 | impl TermId { |
| 21 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 21 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 22 | 22 | /// terms sort `starts_at DESC, id DESC` and the id breaks the tie between |
| 23 | 23 | /// two terms starting at the same instant, |
| 24 | 24 | /// and a random low half sorts arbitrarily inside one millisecond. |
src/domain/user.rsmodified+6 -10
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | |
| 6 | 6 | use std::sync::OnceLock; |
| 7 | 7 | |
| 8 | -use argon2::password_hash::SaltString; | |
| 8 | +use argon2::password_hash::phc::PasswordHash as PhcHash; | |
| 9 | 9 | use argon2::{Argon2, PasswordHasher, PasswordVerifier}; |
| 10 | 10 | use surrealdb::types::{RecordId, RecordIdKey, SurrealValue}; |
| 11 | 11 | |
| @@ -23,7 +23,7 @@ use crate::validate::{validate_password, validate_username}; | ||
| 23 | 23 | pub struct UserId(RecordId); |
| 24 | 24 | |
| 25 | 25 | impl UserId { |
| 26 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 26 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 27 | 27 | /// users list `id DESC` (newest first, [`crate::db::user::list_all`]) and page by |
| 28 | 28 | /// offset over that order, and a random low half scrambles rows minted in |
| 29 | 29 | /// the same millisecond. Not a secret: the session token is separate |
| @@ -93,13 +93,9 @@ impl Password { | ||
| 93 | 93 | /// Private on purpose: argon2 must never run on an async worker. Callers |
| 94 | 94 | /// outside this module go through [`Password::hash_async`]. |
| 95 | 95 | fn hash(&self) -> Result<PasswordHash, AppError> { |
| 96 | - let mut salt_bytes = [0u8; 16]; | |
| 97 | - getrandom::fill(&mut salt_bytes).map_err(|e| AppError::Internal(format!("rng: {e}")))?; | |
| 98 | - let salt = SaltString::encode_b64(&salt_bytes) | |
| 99 | - .map_err(|e| AppError::Internal(format!("salt: {e}")))?; | |
| 100 | - let hash = Argon2::default() | |
| 101 | - .hash_password(self.0.as_bytes(), &salt)? | |
| 102 | - .to_string(); | |
| 96 | + // password-hash 0.6 generates the salt internally (its own CSPRNG); | |
| 97 | + // the explicit SaltString step is gone. | |
| 98 | + let hash = Argon2::default().hash_password(self.0.as_bytes())?.to_string(); | |
| 103 | 99 | Ok(PasswordHash(hash)) |
| 104 | 100 | } |
| 105 | 101 | |
| @@ -142,7 +138,7 @@ impl PasswordHash { | ||
| 142 | 138 | |
| 143 | 139 | /// Private on purpose — see [`Password::hash`]. Use [`PasswordHash::verify_async`]. |
| 144 | 140 | fn verify(&self, password: &Password) -> bool { |
| 145 | - match argon2::password_hash::PasswordHash::new(&self.0) { | |
| 141 | + match PhcHash::new(&self.0) { | |
| 146 | 142 | Ok(parsed) => Argon2::default() |
| 147 | 143 | .verify_password(password.0.as_bytes(), &parsed) |
| 148 | 144 | .is_ok(), |
src/domain/work_entry.rsmodified+1 -1
| @@ -20,7 +20,7 @@ pub(crate) fn out_before_in_error() -> AppError { | ||
| 20 | 20 | pub struct WorkEntryId(RecordId); |
| 21 | 21 | |
| 22 | 22 | impl WorkEntryId { |
| 23 | - /// Minted from the process-wide monotonic generator, not `Ulid::new()`: | |
| 23 | + /// Minted from the process-wide monotonic generator, not `Ulid::generate()`: | |
| 24 | 24 | /// the log sorts `check_in DESC, id DESC` and the id breaks the tie between |
| 25 | 25 | /// two stints checked in at the same instant. The `open_` key below never |
| 26 | 26 | /// ties with itself (one open stint per user), so it needs no ordering. |
src/web/questions.rsmodified+2 -2
| @@ -482,7 +482,7 @@ async fn upload_image( | ||
| 482 | 482 | let upload = read_image_upload(&st, &mut multipart).await?; |
| 483 | 483 | let size = upload.size(); |
| 484 | 484 | |
| 485 | - let file = ulid::Ulid::new().to_string(); | |
| 485 | + let file = ulid::Ulid::generate().to_string(); | |
| 486 | 486 | store_blob(&st, &file, &upload.data, || async { |
| 487 | 487 | match pool_question::set_image(&st.db, question.get_id(), &file, &upload.content_type, size) |
| 488 | 488 | .await? |
| @@ -808,7 +808,7 @@ async fn upload_solution_image( | ||
| 808 | 808 | let upload = read_image_upload(&st, &mut multipart).await?; |
| 809 | 809 | let size = upload.size(); |
| 810 | 810 | |
| 811 | - let file = ulid::Ulid::new().to_string(); | |
| 811 | + let file = ulid::Ulid::generate().to_string(); | |
| 812 | 812 | store_blob(&st, &file, &upload.data, || async { |
| 813 | 813 | match solution::set_image(&st.db, solution.get_id(), &file, &upload.content_type, size) |
| 814 | 814 | .await? |
src/web/users.rsmodified+1 -1
| @@ -1151,7 +1151,7 @@ async fn upload_my_avatar( | ||
| 1151 | 1151 | let upload = read_image_upload(&st, &mut multipart).await?; |
| 1152 | 1152 | let size = upload.size(); |
| 1153 | 1153 | |
| 1154 | - let file = ulid::Ulid::new().to_string(); | |
| 1154 | + let file = ulid::Ulid::generate().to_string(); | |
| 1155 | 1155 | store_blob(&st, &file, &upload.data, || async { |
| 1156 | 1156 | match crate::service::user::set_avatar( |
| 1157 | 1157 | &st.db, |