diff --git a/.gitignore b/.gitignore index ea8c4bf..79aaa2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,7 @@ /target + +# Base SQLite locale (+ fichiers WAL/SHM) et variables d'environnement +*.db +*.db-shm +*.db-wal +.env diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..9f00d51 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3581 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "any_spawner" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1384d3fe1eecb464229fcf6eebb72306591c56bf27b373561489458a7c73027d" +dependencies = [ + "futures", + "thiserror 2.0.20", + "tokio", + "wasm-bindgen-futures", +] + +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + +[[package]] +name = "argon2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072" +dependencies = [ + "base64ct", + "blake2", + "cpufeatures", + "password-hash", +] + +[[package]] +name = "async-lock" +version = "3.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-once-cell" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a" + +[[package]] +name = "async-trait" +version = "0.1.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "attribute-derive" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05832cdddc8f2650cc2cc187cc2e952b8c133a48eb055f35211f61ee81502d77" +dependencies = [ + "attribute-derive-macro", + "derive-where", + "manyhow", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "attribute-derive-macro" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a7cdbbd4bd005c5d3e2e9c885e6fa575db4f4a3572335b974d8db853b6beb61" +dependencies = [ + "collection_literals", + "interpolator", + "manyhow", + "proc-macro-utils", + "proc-macro2", + "quote", + "quote-use", + "syn 2.0.119", +] + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "axum" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" +dependencies = [ + "axum-core", + "base64", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "multer", + "percent-encoding", + "pin-project-lite", + "serde_core", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sha1", + "sync_wrapper", + "tokio", + "tokio-tungstenite", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "base16" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27c3610c36aee21ce8ac510e6224498de4228ad772a171ed65643a24693a5a8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "birthday_calendar" +version = "0.1.0" +dependencies = [ + "argon2", + "axum", + "console_error_panic_hook", + "leptos", + "leptos_axum", + "leptos_meta", + "leptos_router", + "serde", + "sqlx", + "time", + "tokio", + "tower-sessions", + "tower-sessions-sqlx-store", + "wasm-bindgen", +] + +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" +dependencies = [ + "serde_core", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "camino" +version = "1.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbad30e4b4c14a39e3cc8aed085a12a327257c316619c93581e017bc52be591" + +[[package]] +name = "cc" +version = "1.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54413ede23c2daf518f35156dfde027feb2374004d63bd497f983c8db9c0e313" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" + +[[package]] +name = "codee" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9dbbdc4b4d349732bc6690de10a9de952bd39ba6a065c586e26600b6b0b91f5" +dependencies = [ + "serde", + "serde_json", + "thiserror 2.0.20", +] + +[[package]] +name = "collection_literals" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2550f75b8cfac212855f6b1885455df8eaee8fe8e246b647d69146142e016084" + +[[package]] +name = "config" +version = "0.15.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85f248a4de22d204ceabc6299d89d2c70fbd7f09fea53c06c852369652d8139" +dependencies = [ + "convert_case 0.6.0", + "pathdiff", + "serde_core", + "toml", + "winnow", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const-str" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18f12cc9948ed9604230cdddc7c86e270f9401ccbe3c2e98a4378c5e7632212f" + +[[package]] +name = "const_format" +version = "0.2.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4481a617ad9a412be3b97c5d403fef8ed023103368908b9c50af598ff467cc1e" +dependencies = [ + "const_format_proc_macros", + "konst", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "const_str_slice_concat" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67855af358fcb20fac58f9d714c94e2b228fe5694c1c9b4ead4a366343eda1b" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "convert_case" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "affbf0190ed2caf063e3def54ff444b449371d55c58e513a95ab98eca50adb49" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "convert_case_extras" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589c70f0faf8aa9d17787557d5eae854d7755cac50f5c3d12c81d3d57661cebb" +dependencies = [ + "convert_case 0.11.0", +] + +[[package]] +name = "cookie" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a373e3602691c3cdea496d2f0ee5935151e6168fe87739483c463db1b2f2f87" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853" + +[[package]] +name = "crossbeam-queue" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03e8bd762f7479489c70ed6c768ddca99d7296857de437a68dcb2a94365b3fae" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "data-encoding" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06" + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "serde_core", +] + +[[package]] +name = "derive-where" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e2b94854e8576378ccda7c8de8a66ed8b4e8acbd2c50ec3418ea6c8aaf4b567" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "drain_filter_polyfill" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "669a445ee724c5c69b1b06fe0b63e70a1c84bc9bb7d9696cd4f4e3ec45050408" + +[[package]] +name = "either" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" +dependencies = [ + "serde", +] + +[[package]] +name = "either_of" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5060e0a4cbf26a87550792688ade88e6b8aec9208613631a7a363bda7bc2d4cd" +dependencies = [ + "paste", + "pin-project-lite", +] + +[[package]] +name = "encoding_rs" +version = "0.8.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5ef0006ac9ab233c38522f5ae99cae3625151de8f706cacee1cba4b8e2832a" +dependencies = [ + "cfg-if", + "core_detect", + "multiversion", + "multiversion_no_op", + "rustversion", + "scopeguard", + "simdutf8", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1731451909bde27714eacba19c2566362a7f35224f52b153d3f42cf60f72472" + +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + +[[package]] +name = "event-listener" +version = "5.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2" +dependencies = [ + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25905e51abafe4dcea6c15fec58c57b601cdbd0ee53d22ea1d3016c587d39b" + +[[package]] +name = "flume" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" +dependencies = [ + "futures-core", + "futures-sink", + "spin", +] + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-executor" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot", +] + +[[package]] +name = "futures-io" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" + +[[package]] +name = "futures-macro" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + +[[package]] +name = "futures-sink" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 6.0.0", + "wasm-bindgen", +] + +[[package]] +name = "gloo-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06f627b1a58ca3d42b45d6104bf1e1a03799df472df00988b6ba21accc10580" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils", + "http", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror 1.0.69", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-utils" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "guardian" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17e2ac29387b1aa07a1e448f7bb4f35b500787971e965b02842b900afa5c8f6f" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "hashlink" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +dependencies = [ + "hashbrown 0.15.5", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "html-escape" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9356095b4b41197bba32173600e1582792cda618f65d12f68e2e77d273413c5" + +[[package]] +name = "http" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "http-range-header" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hydration_context" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bbbeb23ee808258cef2c5585ff0dc8e41da21a8dde943f6b290da153a042a96" +dependencies = [ + "futures", + "js-sys", + "or_poisoned", + "pin-project-lite", + "serde", + "throw_error", + "wasm-bindgen", +] + +[[package]] +name = "hyper" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b501faa50e7a26c3d3560ca625132f4078a17771f4810baf70475ae48cbe43" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "bytes", + "http", + "http-body", + "hyper", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "icu_collections" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0" + +[[package]] +name = "icu_properties" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa" + +[[package]] +name = "icu_provider" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", +] + +[[package]] +name = "interpolator" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71dd52191aae121e8611f1e8dc3e324dd0dd1dee1e6dd91d10ee07a3cfb4d9d8" + +[[package]] +name = "inventory" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b" +dependencies = [ + "rustversion", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce57d20d1ea864ce2ac172ab472d409214f4fd359f0b2a2775abdf522e2af99e" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "konst" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128133ed7824fcd73d6e7b17957c5eb7bacb885649bd8c69708b2331a10bcefb" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "leptos" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "705e2951f3688e0c4f66bbb7a2702282782dcee716971dbd6209c2619d272479" +dependencies = [ + "any_spawner", + "base64", + "cfg-if", + "either_of", + "futures", + "getrandom 0.4.3", + "hydration_context", + "leptos_config", + "leptos_dom", + "leptos_hot_reload", + "leptos_macro", + "leptos_server", + "oco_ref", + "or_poisoned", + "paste", + "rand 0.9.5", + "reactive_graph", + "rustc-hash", + "rustc_version", + "send_wrapper", + "serde", + "serde_json", + "serde_qs", + "server_fn", + "slotmap", + "tachys", + "thiserror 2.0.20", + "throw_error", + "typed-builder", + "typed-builder-macro", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm_split_helpers", + "web-sys", +] + +[[package]] +name = "leptos_axum" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513e2dd5fe81512b53304429b9ca77cceb954d23af88921c0c33119380f07cbe" +dependencies = [ + "any_spawner", + "axum", + "futures", + "hydration_context", + "leptos", + "leptos_integration_utils", + "leptos_macro", + "leptos_meta", + "leptos_router", + "or_poisoned", + "server_fn", + "tachys", + "tokio", + "tower", + "tower-http", +] + +[[package]] +name = "leptos_config" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c06f751315bccc0d193fab302ac01d25bcfcd97474d4676440e7e3250dc3fc3" +dependencies = [ + "config", + "regex", + "serde", + "thiserror 2.0.20", + "typed-builder", +] + +[[package]] +name = "leptos_dom" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35742e9ed8f8aaf9e549b454c68a7ac0992536e06856365639b111f72ab07884" +dependencies = [ + "js-sys", + "or_poisoned", + "reactive_graph", + "send_wrapper", + "tachys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "leptos_hot_reload" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d2a0f220c8a5ef3c51199dfb9cdd702bc0eb80d52fbe70c7890adfaaae8a4b1" +dependencies = [ + "anyhow", + "camino", + "indexmap", + "or_poisoned", + "proc-macro2", + "quote", + "rstml", + "serde", + "syn 2.0.119", + "walkdir", +] + +[[package]] +name = "leptos_integration_utils" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c097f89cd9aa606297672f56fa5bdda09f01609a9f4eefaccdbb5ab5afea4279" +dependencies = [ + "futures", + "hydration_context", + "leptos", + "leptos_config", + "leptos_meta", + "leptos_router", + "reactive_graph", +] + +[[package]] +name = "leptos_macro" +version = "0.8.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de6e8da9d4f1a7b74b447b317d590ebabb38709f588f7ee20564b773ccbcce" +dependencies = [ + "attribute-derive", + "cfg-if", + "convert_case 0.11.0", + "convert_case_extras", + "html-escape", + "itertools", + "leptos_hot_reload", + "prettyplease", + "proc-macro-error2", + "proc-macro2", + "quote", + "rstml", + "rustc_version", + "server_fn_macro", + "syn 2.0.119", + "uuid", +] + +[[package]] +name = "leptos_meta" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c3efe657b4c55ed2e078922786ffe20acfb71767c3dd913767b09a35c75c890" +dependencies = [ + "futures", + "indexmap", + "leptos", + "or_poisoned", + "send_wrapper", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "leptos_router" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "318c035b5995324c2f60900978ac67da3b21e6062a6e904f8b93b38eddc4e3a2" +dependencies = [ + "any_spawner", + "either_of", + "futures", + "gloo-net", + "js-sys", + "leptos", + "leptos_router_macro", + "or_poisoned", + "percent-encoding", + "reactive_graph", + "rustc_version", + "send_wrapper", + "tachys", + "thiserror 2.0.20", + "url", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "leptos_router_macro" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "409c0bd99f986c3cfa1a4db2443c835bc602ded1a12784e22ecb28c3ed5a2ae2" +dependencies = [ + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "leptos_server" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da974775c5ccbb6bd64be7f53f75e8321542e28f21563a416574dbe4d5447eae" +dependencies = [ + "any_spawner", + "base64", + "codee", + "futures", + "hydration_context", + "or_poisoned", + "reactive_graph", + "send_wrapper", + "serde", + "serde_json", + "server_fn", + "tachys", +] + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "libredox" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6480ccc157a1389bb2e4891b24751b0f798ba640d22386f23143fbcc89da195a" +dependencies = [ + "bitflags", + "libc", + "plain", + "redox_syscall 0.9.4", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", + "serde", +] + +[[package]] +name = "log" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" + +[[package]] +name = "manyhow" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b33efb3ca6d3b07393750d4030418d594ab1139cee518f0dc88db70fec873587" +dependencies = [ + "manyhow-macros", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "manyhow-macros" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fce34d199b78b6e6073abf984c9cf5fd3e9330145a93ee0738a7443e371495" +dependencies = [ + "proc-macro-utils", + "proc-macro2", + "quote", +] + +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "mio" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b18443e9c262bfe8fa82f51666e2642c53393f7e5c27b3e1aeab922cff5b9d8" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "multer" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" +dependencies = [ + "bytes", + "encoding_rs", + "futures-util", + "http", + "httparse", + "memchr", + "mime", + "spin", + "version_check", +] + +[[package]] +name = "multiversion" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ca4bea16ffc3f443cf7d866912118196bfef4c6a1556ca00f9f9b00bb43f7c" +dependencies = [ + "multiversion-macros", +] + +[[package]] +name = "multiversion-macros" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d416831a7317ef4b08bee00b69cbbb9c8763da7959a7026244d6266869f9c83" +dependencies = [ + "proc-macro2", + "quote", + "rustversion", + "syn 3.0.6", +] + +[[package]] +name = "multiversion_no_op" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" + +[[package]] +name = "next_tuple" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60993920e071b0c9b66f14e2b32740a4e27ffc82854dcd72035887f336a09a28" + +[[package]] +name = "num-bigint-dig" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" +dependencies = [ + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.8", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-conv" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" + +[[package]] +name = "num-integer" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "oco_ref" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed0423ff9973dea4d6bd075934fdda86ebb8c05bdf9d6b0507067d4a1226371d" +dependencies = [ + "serde", + "thiserror 2.0.20", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "or_poisoned" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c04f5d74368e4d0dfe06c45c8627c81bd7c317d52762d118fb9b3076f6420fd" + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.5.18", + "smallvec", + "windows-link", +] + +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.119", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "proc-macro-utils" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeaf08a13de400bc215877b5bdc088f241b12eb42f0a548d3390dc1c56bb7071" +dependencies = [ + "proc-macro2", + "quote", + "smallvec", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proc-macro2-diagnostics" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "version_check", + "yansi", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "quote-use" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9619db1197b497a36178cfc736dc96b271fe918875fbf1344c436a7e93d0321e" +dependencies = [ + "quote", + "quote-use-macros", +] + +[[package]] +name = "quote-use-macros" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82ebfb7faafadc06a7ab141a6f67bcfb24cb8beb158c6fe933f2f035afa99f35" +dependencies = [ + "proc-macro-utils", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "reactive_graph" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00c5a025366836190c7030e883cc2bcd9e384ff555336e3c7954741ca411b177" +dependencies = [ + "any_spawner", + "async-lock", + "futures", + "guardian", + "hydration_context", + "indexmap", + "or_poisoned", + "paste", + "pin-project-lite", + "rustc-hash", + "rustc_version", + "send_wrapper", + "serde", + "slotmap", + "thiserror 2.0.20", + "web-sys", +] + +[[package]] +name = "reactive_stores" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c30fd35b7d299c591293bb69fed47a703eb2703b1cff0493e78b16ed007e5382" +dependencies = [ + "guardian", + "indexmap", + "itertools", + "or_poisoned", + "paste", + "reactive_graph", + "reactive_stores_macro", + "rustc-hash", + "send_wrapper", +] + +[[package]] +name = "reactive_stores_macro" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68072edd607edd30b9ebf57d984ba45d8ab8809e598d0f6046278373fb76a5a0" +dependencies = [ + "convert_case 0.11.0", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_syscall" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "737970939a87c6fa31e7acad13307bccbb017a073b695b6089a2c484f929e20e" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "rmp" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ba8be72d372b2c9b35542551678538b562e7cf86c3315773cae48dfbfe7790c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "rmp-serde" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f81bee8c8ef9b577d1681a70ebbc962c232461e397b22c208c43c04b67a155" +dependencies = [ + "rmp", + "serde", +] + +[[package]] +name = "rsa" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core 0.6.4", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rstml" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61cf4616de7499fc5164570d40ca4e1b24d231c6833a88bff0fe00725080fd56" +dependencies = [ + "derive-where", + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn 2.0.119", + "syn_derive", + "thiserror 2.0.20", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" +dependencies = [ + "futures-core", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + +[[package]] +name = "serde_json" +version = "1.0.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_qs" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3faaf9e727533a19351a43cc5a8de957372163c7d35cc48c90b75cdda13c352" +dependencies = [ + "percent-encoding", + "serde", + "thiserror 2.0.20", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "server_fn" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8559dd05af1b5b7e363a150616589d5a88af5187273f7f331ba0dae8922812" +dependencies = [ + "axum", + "base64", + "bytes", + "const-str", + "const_format", + "futures", + "gloo-net", + "http", + "http-body-util", + "hyper", + "inventory", + "js-sys", + "or_poisoned", + "pin-project-lite", + "rustc_version", + "rustversion", + "send_wrapper", + "serde", + "serde_json", + "serde_qs", + "server_fn_macro_default", + "thiserror 2.0.20", + "throw_error", + "tokio", + "tower", + "tower-layer", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "xxhash-rust", +] + +[[package]] +name = "server_fn_macro" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1295b54815397d30d986b63f93cfd515fa86d5e528e0bb589ce9d530502f9e0f" +dependencies = [ + "const_format", + "convert_case 0.11.0", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.119", + "xxhash-rust", +] + +[[package]] +name = "server_fn_macro_default" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63eb08f80db903d3c42f64e60ebb3875e0305be502bdc064ec0a0eab42207f00" +dependencies = [ + "server_fn_macro", + "syn 2.0.119", +] + +[[package]] +name = "sha1" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core 0.6.4", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "slotmap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba467056f1b547ed52077911161fc86985becbc60e8e1857c8a144dab0def891" +dependencies = [ + "serde", +] + +[[package]] +name = "socket2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "spin" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sqlx" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6" +dependencies = [ + "base64", + "bytes", + "crc", + "crossbeam-queue", + "either", + "event-listener", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashbrown 0.15.5", + "hashlink", + "indexmap", + "log", + "memchr", + "once_cell", + "percent-encoding", + "serde", + "serde_json", + "sha2", + "smallvec", + "thiserror 2.0.20", + "time", + "tokio", + "tokio-stream", + "tracing", + "url", +] + +[[package]] +name = "sqlx-macros" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 2.0.119", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b" +dependencies = [ + "dotenvy", + "either", + "heck", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2", + "sqlx-core", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn 2.0.119", + "tokio", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" +dependencies = [ + "atoi", + "base64", + "bitflags", + "byteorder", + "bytes", + "crc", + "digest", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "percent-encoding", + "rand 0.8.8", + "rsa", + "serde", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror 2.0.20", + "time", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" +dependencies = [ + "atoi", + "base64", + "bitflags", + "byteorder", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand 0.8.8", + "serde", + "serde_json", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror 2.0.20", + "time", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea" +dependencies = [ + "atoi", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "serde_urlencoded", + "sqlx-core", + "thiserror 2.0.20", + "time", + "tracing", + "url", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb066a04799e45f5d582e8fc6ec8e6d6896040d00898eb4e6a835196815b219" +dependencies = [ + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + +[[package]] +name = "synstructure" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + +[[package]] +name = "tachys" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92ba81187437cc5df4281f2326a2e13cc81e8f96448292d1112388e2025ca66" +dependencies = [ + "any_spawner", + "async-trait", + "const_str_slice_concat", + "drain_filter_polyfill", + "either_of", + "erased", + "futures", + "html-escape", + "indexmap", + "itertools", + "js-sys", + "next_tuple", + "oco_ref", + "or_poisoned", + "paste", + "reactive_graph", + "reactive_stores", + "rustc-hash", + "rustc_version", + "send_wrapper", + "slotmap", + "throw_error", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" +dependencies = [ + "thiserror-impl 2.0.20", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + +[[package]] +name = "throw_error" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc0ed6038fcbc0795aca7c92963ddda636573b956679204e044492d2b13c8f64" +dependencies = [ + "pin-project-lite", +] + +[[package]] +name = "time" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" + +[[package]] +name = "time-macros" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" + +[[package]] +name = "tokio" +version = "1.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + +[[package]] +name = "tokio-stream" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d06f0b082ba57c26b79407372e57cf2a1e28124f78e9479fe80322cf53420b" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f72a05e828585856dacd553fba484c242c46e391fb0e58917c942ee9202915c" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + +[[package]] +name = "tokio-util" +version = "0.7.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "1.1.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "920602543f0911ab71da12c50d59701da54c196d1a2bf5cb4b75667f137a406a" +dependencies = [ + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_parser" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" +dependencies = [ + "winnow", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-cookies" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151b5a3e3c45df17466454bb74e9ecedecc955269bdedbf4d150dfa393b55a36" +dependencies = [ + "axum-core", + "cookie", + "futures-util", + "http", + "parking_lot", + "pin-project-lite", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "http-range-header", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tower-sessions" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a05911f23e8fae446005fe9b7b97e66d95b6db589dc1c4d59f6a2d4d4927d3" +dependencies = [ + "async-trait", + "http", + "time", + "tokio", + "tower-cookies", + "tower-layer", + "tower-service", + "tower-sessions-core", + "tower-sessions-memory-store", + "tracing", +] + +[[package]] +name = "tower-sessions-core" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8cce604865576b7751b7a6bc3058f754569a60d689328bb74c52b1d87e355b" +dependencies = [ + "async-trait", + "axum-core", + "base64", + "futures", + "http", + "parking_lot", + "rand 0.8.8", + "serde", + "serde_json", + "thiserror 2.0.20", + "time", + "tokio", + "tracing", +] + +[[package]] +name = "tower-sessions-memory-store" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb05909f2e1420135a831dd5df9f5596d69196d0a64c3499ca474c4bd3d33242" +dependencies = [ + "async-trait", + "time", + "tokio", + "tower-sessions-core", +] + +[[package]] +name = "tower-sessions-sqlx-store" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e054622079f57fc1a7d6a6089c9334f963d62028fe21dc9eddd58af9a78480b3" +dependencies = [ + "async-trait", + "rmp-serde", + "sqlx", + "thiserror 1.0.69", + "time", + "tower-sessions-core", +] + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tungstenite" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c01152af293afb9c7c2a57e4b559c5620b421f6d133261c60dd2d0cdb38e6b8" +dependencies = [ + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "rand 0.9.5", + "sha1", + "thiserror 2.0.20", +] + +[[package]] +name = "typed-builder" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31aa81521b70f94402501d848ccc0ecaa8f93c8eb6999eb9747e72287757ffda" +dependencies = [ + "typed-builder-macro", +] + +[[package]] +name = "typed-builder-macro" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076a02dc54dd46795c2e9c8282ed40bcfb1e22747e955de9389a1de28190fb26" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954" + +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ef6dac1e96601b4fb3acccccff2139741fcb757cb9a36089bf5be91cfb285ce" +dependencies = [ + "getrandom 0.4.3", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aecb87a33d3b0c5e3b7aa46336eaf486cffafbd281b195e4c8b80d50df2351bf" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ef4c5d3d2cdf5c54f4231181768f5510842e350db025faf1f7163b1030ed928" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a690d511e3c1a8b3a55e33511e3c2c00c78415cd23650f32b808627f5696b9ed" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "411e4887f0071ef2d2164a9d5fdf2d20efbef78fccd3a78b0c10a1dc5295e48a" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 3.0.6", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81941cd78d0c92026c33e5e01312845a4cb1e9af3407f9134b100dd03144103e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasm_split_helpers" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab578aae2fe2916edaea06843187d50f87b0965622da0ceef648edca27b385ba" +dependencies = [ + "async-once-cell", + "wasm_split_macros", +] + +[[package]] +name = "wasm_split_macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e653af7ee4a9ef0fce481a9ec6f43cb78de20d0cdb4f4f5862e1dc6e407e6c8" +dependencies = [ + "base16", + "quote", + "sha2", + "syn 2.0.119", +] + +[[package]] +name = "web-sys" +version = "0.3.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbddc4a036f00ec4f18c83445bd3115cb306a91da554919a099d9222fe4a7f8" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "whoami" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d" +dependencies = [ + "libredox", + "wasite", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "xxhash-rust" +version = "0.8.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aee1b19627c7c60102ab80d3a9cbe18de90bfe03bfa6c3715447681f0e8c8af6" + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33811428bee40dbceb6d545e95754741d17a6aef9a4849f0fd62e2ba4f412a78" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d35102a9f36d089ccae9e4c6802bc118be4487b80aaffc0ab4e0cf5ce92d2873" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c01f5ab44258da43cf276c74a2763db2ff3969c9c652c3f2de07041d0b2bc" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/Cargo.toml b/Cargo.toml index da2317e..152bc67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,4 +3,71 @@ name = "birthday_calendar" version = "0.1.0" edition = "2024" +[lib] +crate-type = ["cdylib", "rlib"] + [dependencies] +leptos = "0.8" +leptos_meta = "0.8" +leptos_router = "0.8" +serde = { version = "1", features = ["derive"] } + +# Client (WASM) +console_error_panic_hook = { version = "0.1", optional = true } +wasm-bindgen = { version = "0.2.106", optional = true } + +# Serveur uniquement +axum = { version = "0.8", optional = true } +leptos_axum = { version = "0.8", optional = true } +tokio = { version = "1", features = ["rt-multi-thread", "macros"], optional = true } +sqlx = { version = "0.8", default-features = false, features = ["runtime-tokio", "sqlite", "migrate", "macros"], optional = true } +tower-sessions = { version = "0.14", optional = true } +tower-sessions-sqlx-store = { version = "0.15", features = ["sqlite"], optional = true } +argon2 = { version = "0.5", optional = true } +time = { version = "0.3", optional = true } + +[features] +hydrate = [ + "leptos/hydrate", + "dep:console_error_panic_hook", + "dep:wasm-bindgen", +] +ssr = [ + "dep:axum", + "dep:tokio", + "dep:leptos_axum", + "dep:sqlx", + "dep:tower-sessions", + "dep:tower-sessions-sqlx-store", + "dep:argon2", + "dep:time", + "leptos/ssr", + "leptos_meta/ssr", + "leptos_router/ssr", +] + +# Profil optimisé en taille pour le bundle WASM en release +[profile.wasm-release] +inherits = "release" +opt-level = 'z' +lto = true +codegen-units = 1 +panic = "abort" + +[package.metadata.leptos] +output-name = "birthday_calendar" +site-root = "target/site" +site-pkg-dir = "pkg" +tailwind-input-file = "style/tailwind.css" +# Fichiers copiés tels quels à la racine du site (favicon, images…) +assets-dir = "public" +site-addr = "127.0.0.1:3000" +reload-port = 3001 +browserquery = "defaults" +# Passer à "PROD" en production : active notamment le cookie de session `Secure` +env = "DEV" +bin-features = ["ssr"] +bin-default-features = false +lib-features = ["hydrate"] +lib-default-features = false +lib-profile-release = "wasm-release" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..b1c6784 --- /dev/null +++ b/build.rs @@ -0,0 +1,5 @@ +fn main() { + // `sqlx::migrate!()` embarque les migrations à la compilation : sans cette ligne, + // ajouter un nouveau fichier dans `migrations/` ne déclenche pas de recompilation. + println!("cargo:rerun-if-changed=migrations"); +} diff --git a/migrations/0001_create_users.sql b/migrations/0001_create_users.sql new file mode 100644 index 0000000..6cec4b0 --- /dev/null +++ b/migrations/0001_create_users.sql @@ -0,0 +1,7 @@ +CREATE TABLE users ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + -- COLLATE NOCASE : "Alice" et "alice" sont le même identifiant + username TEXT NOT NULL UNIQUE COLLATE NOCASE, + password_hash TEXT NOT NULL, + created_at TEXT NOT NULL DEFAULT (datetime('now')) +); diff --git a/migrations/0002_users_email.sql b/migrations/0002_users_email.sql new file mode 100644 index 0000000..ed2a20b --- /dev/null +++ b/migrations/0002_users_email.sql @@ -0,0 +1,6 @@ +-- L'identifiant de connexion devient l'adresse e-mail (stockée en minuscules par +-- l'application). Le renommage conserve les contraintes UNIQUE et COLLATE NOCASE. +-- +-- Les lignes existantes ne sont pas modifiées : un ancien « nom d'utilisateur » qui +-- n'est pas une adresse e-mail valide ne permet plus de se connecter. +ALTER TABLE users RENAME COLUMN username TO email; diff --git a/migrations/0003_create_birthdays.sql b/migrations/0003_create_birthdays.sql new file mode 100644 index 0000000..af3e3fb --- /dev/null +++ b/migrations/0003_create_birthdays.sql @@ -0,0 +1,15 @@ +CREATE TABLE birthdays ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + -- Supprimer un utilisateur supprime ses anniversaires + user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, + first_name TEXT NOT NULL, + last_name TEXT, + -- Jour, mois et année sont séparés : l'année est facultative, ce qu'une vraie + -- colonne de date ne peut pas représenter (« 12 mars » sans année). + day INTEGER NOT NULL CHECK (day BETWEEN 1 AND 31), + month INTEGER NOT NULL CHECK (month BETWEEN 1 AND 12), + year INTEGER, + created_at TEXT NOT NULL DEFAULT (datetime('now')) +); + +CREATE INDEX birthdays_user_id ON birthdays (user_id); diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..b397f7e --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1 @@ +🎂 diff --git a/src/app.rs b/src/app.rs new file mode 100644 index 0000000..a6a3fec --- /dev/null +++ b/src/app.rs @@ -0,0 +1,110 @@ +use crate::{ + auth::{self, Login, Logout, Register}, + pages::{HomePage, LoginPage, RegisterPage}, + ui::LINK, +}; +use leptos::prelude::*; +use leptos_meta::{MetaTags, Stylesheet, Title, provide_meta_context}; +use leptos_router::{ + SsrMode, StaticSegment, + components::{A, Route, Router, Routes}, +}; + +pub fn shell(options: LeptosOptions) -> impl IntoView { + view! { + + + + + + + + + + + + + + + } +} + +#[component] +pub fn App() -> impl IntoView { + provide_meta_context(); + + let login = ServerAction::::new(); + let register = ServerAction::::new(); + let logout = ServerAction::::new(); + + // Recharge l'utilisateur courant après chaque connexion / inscription / déconnexion. + // Ne sert qu'à l'en-tête. Les pages protégées chargent leur propre ressource : elles ne + // doivent jamais décider d'une redirection à partir de cette valeur, encore périmée + // juste après une connexion, le temps que le rechargement se termine. + let user = Resource::new( + move || { + ( + login.version().get(), + register.version().get(), + logout.version().get(), + ) + }, + |_| auth::get_user(), + ); + + view! { + + + + <Router> + <header class="flex items-center justify-between border-b border-zinc-200 bg-white px-4 py-3 dark:border-zinc-800 dark:bg-zinc-900"> + <A href="/" attr:class="text-lg font-bold"> + "🎂 Anniversaires" + </A> + <nav class="flex items-center gap-4 text-sm"> + <Suspense> + {move || { + user.get() + .map(|user| match user { + Ok(Some(user)) => { + view! { + <span class="hidden font-semibold sm:inline">{user.email}</span> + <ActionForm action=logout> + <button type="submit" class=LINK> + "Se déconnecter" + </button> + </ActionForm> + } + .into_any() + } + _ => { + view! { + <A href="/login" attr:class=LINK> + "Connexion" + </A> + <A href="/register" attr:class=LINK> + "Inscription" + </A> + } + .into_any() + } + }) + }} + </Suspense> + </nav> + </header> + <main class="mx-auto max-w-3xl px-4 py-8"> + <Routes fallback=|| "Page introuvable.".into_view()> + // `Async` : le serveur attend `get_user` avant d'envoyer la réponse, ce qui permet + // un vrai « 302 vers /login » (et pas de flash de contenu) pour les visiteurs anonymes. + <Route path=StaticSegment("") view=HomePage ssr=SsrMode::Async /> + <Route path=StaticSegment("login") view=move || view! { <LoginPage login /> } /> + <Route + path=StaticSegment("register") + view=move || view! { <RegisterPage register /> } + /> + </Routes> + </main> + </Router> + } +} diff --git a/src/auth.rs b/src/auth.rs new file mode 100644 index 0000000..a9a6808 --- /dev/null +++ b/src/auth.rs @@ -0,0 +1,258 @@ +//! Authentification : types partagés, règles de validation et server functions. +//! +//! Les corps des `#[server]` ne sont compilés que côté serveur ; le client +//! n'en garde que la signature (un appel HTTP généré par la macro). + +use leptos::prelude::*; +use serde::{Deserialize, Serialize}; + +#[cfg(feature = "ssr")] +use crate::server::{self, USER_ID_KEY}; + +/// Utilisateur connecté, tel qu'exposé au front (jamais de hash de mot de passe ici). +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct User { + pub id: i64, + pub email: String, +} + +#[cfg(feature = "ssr")] +#[derive(sqlx::FromRow)] +struct UserRow { + id: i64, + password_hash: String, +} + +pub const PASSWORD_MIN: usize = 8; +/// Borne haute : Argon2 est coûteux, on refuse les mots de passe démesurés. +pub const PASSWORD_MAX: usize = 128; +/// Longueur maximale d'une adresse e-mail (RFC 5321). +pub const EMAIL_MAX: usize = 254; + +/// Met l'adresse en forme canonique : sans espaces autour, en minuscules. +/// Toujours à appliquer avant de valider, chercher ou stocker une adresse. +pub fn normalize_email(email: &str) -> String { + email.trim().to_lowercase() +} + +/// Validation volontairement pragmatique (pas la RFC complète) : la seule vraie +/// preuve qu'une adresse existe est d'y envoyer un message. +/// +/// Attend une adresse déjà passée par [`normalize_email`]. +pub fn validate_email(email: &str) -> Result<(), &'static str> { + const INVALID: &str = "Adresse e-mail invalide."; + + if email.len() > EMAIL_MAX { + return Err(INVALID); + } + let Some((local, domain)) = email.split_once('@') else { + return Err(INVALID); + }; + let local_ok = !local.is_empty() + && local.len() <= 64 + && local.chars().all(|c| { + !c.is_whitespace() && !c.is_control() && !"@<>()[],;:\\\"".contains(c) + }); + let domain_ok = domain.contains('.') + && domain.split('.').all(|label| { + !label.is_empty() + && !label.starts_with('-') + && !label.ends_with('-') + && label.chars().all(|c| c.is_ascii_alphanumeric() || c == '-') + }); + if local_ok && domain_ok { + Ok(()) + } else { + Err(INVALID) + } +} + +/// Le mot de passe doit faire 8 à 128 caractères. +pub fn validate_password(password: &str) -> Result<(), &'static str> { + let len = password.chars().count(); + if len < PASSWORD_MIN { + return Err("Le mot de passe doit faire au moins 8 caractères."); + } + if len > PASSWORD_MAX { + return Err("Le mot de passe doit faire au plus 128 caractères."); + } + Ok(()) +} + +/// Extrait le message lisible d'une erreur de server function +/// (sans le préfixe technique « error running server function: »). +pub fn error_message(error: &ServerFnError) -> String { + match error { + ServerFnError::ServerError(message) => message.clone(), + _ => "Impossible de joindre le serveur. Réessayez.".to_string(), + } +} + +/// Renvoie l'utilisateur connecté, ou `None` s'il n'y a pas de session valide. +#[server] +pub async fn get_user() -> Result<Option<User>, ServerFnError> { + let session = server::session().await?; + let user_id = session + .get::<i64>(USER_ID_KEY) + .await + .map_err(server::internal_error)?; + let Some(user_id) = user_id else { + return Ok(None); + }; + + let row = sqlx::query_as::<_, (i64, String)>("SELECT id, email FROM users WHERE id = ?1") + .bind(user_id) + .fetch_optional(&server::pool()?) + .await + .map_err(server::internal_error)?; + + match row { + Some((id, email)) => Ok(Some(User { id, email })), + None => { + // L'utilisateur a été supprimé : on invalide la session orpheline. + session.flush().await.map_err(server::internal_error)?; + Ok(None) + } + } +} + +/// Crée un compte, puis connecte directement l'utilisateur. +#[server] +pub async fn register( + email: String, + password: String, + password_confirmation: String, +) -> Result<(), ServerFnError> { + let email = normalize_email(&email); + validate_email(&email).map_err(ServerFnError::new)?; + validate_password(&password).map_err(ServerFnError::new)?; + if password != password_confirmation { + return Err(ServerFnError::new("Les mots de passe ne correspondent pas.")); + } + + let password_hash = server::hash_password(password).await?; + let result = sqlx::query("INSERT INTO users (email, password_hash) VALUES (?1, ?2)") + .bind(&email) + .bind(&password_hash) + .execute(&server::pool()?) + .await; + + let user_id = match result { + Ok(done) => done.last_insert_rowid(), + Err(sqlx::Error::Database(e)) if e.is_unique_violation() => { + return Err(ServerFnError::new("Un compte existe déjà avec cette adresse e-mail.")); + } + Err(e) => return Err(server::internal_error(e)), + }; + + start_session(user_id).await?; + leptos_axum::redirect("/"); + Ok(()) +} + +/// Connecte l'utilisateur si les identifiants sont corrects. +#[server] +pub async fn login(email: String, password: String) -> Result<(), ServerFnError> { + // Message volontairement identique pour « compte inconnu » et « mauvais + // mot de passe » : on ne révèle pas quels comptes existent. + const INVALID: &str = "Adresse e-mail ou mot de passe incorrect."; + + if password.chars().count() > PASSWORD_MAX { + return Err(ServerFnError::new(INVALID)); + } + + let row = sqlx::query_as::<_, UserRow>( + "SELECT id, password_hash FROM users WHERE email = ?1", + ) + .bind(normalize_email(&email)) + .fetch_optional(&server::pool()?) + .await + .map_err(server::internal_error)?; + + let user_id = row.as_ref().map(|r| r.id); + let stored_hash = row.map(|r| r.password_hash); + if !server::verify_password(password, stored_hash).await { + return Err(ServerFnError::new(INVALID)); + } + + // `verify_password` ne renvoie `true` que si l'utilisateur existe. + start_session(user_id.expect("utilisateur existant")).await?; + leptos_axum::redirect("/"); + Ok(()) +} + +/// Déconnecte l'utilisateur et détruit sa session. +#[server] +pub async fn logout() -> Result<(), ServerFnError> { + server::session() + .await? + .flush() + .await + .map_err(server::internal_error)?; + leptos_axum::redirect("/login"); + Ok(()) +} + +/// Ouvre une session pour `user_id`. +/// +/// L'identifiant de session est renouvelé (`cycle_id`) pour empêcher les attaques +/// par fixation de session : un cookie posé avant la connexion devient inutilisable. +#[cfg(feature = "ssr")] +async fn start_session(user_id: i64) -> Result<(), ServerFnError> { + let session = server::session().await?; + session.cycle_id().await.map_err(server::internal_error)?; + session + .insert(USER_ID_KEY, user_id) + .await + .map_err(server::internal_error)?; + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn email_normalization() { + assert_eq!(normalize_email(" Alice@Example.COM "), "alice@example.com"); + } + + #[test] + fn valid_emails() { + for email in ["alice@example.com", "a.b+tag@sub.example.co", "a_b-c@ex-ample.fr"] { + assert!(validate_email(email).is_ok(), "{email} devrait être valide"); + } + } + + #[test] + fn invalid_emails() { + let too_long = format!("{}@example.com", "a".repeat(250)); + for email in [ + "", + "alice", + "alice@", + "@example.com", + "alice@example", + "a b@example.com", + "a@@example.com", + "a@b@example.com", + "alice@example..com", + "alice@.example.com", + "alice@example.com.", + "alice@-example.com", + "<x>@example.com", + "alice@exa mple.com", + too_long.as_str(), + ] { + assert!(validate_email(email).is_err(), "{email} devrait être invalide"); + } + } + + #[test] + fn password_rules() { + assert!(validate_password("12345678").is_ok()); + assert!(validate_password("1234567").is_err()); + assert!(validate_password(&"a".repeat(128)).is_ok()); + assert!(validate_password(&"a".repeat(129)).is_err()); + } +} diff --git a/src/birthdays.rs b/src/birthdays.rs new file mode 100644 index 0000000..d30bd3e --- /dev/null +++ b/src/birthdays.rs @@ -0,0 +1,557 @@ +//! Anniversaires : modèle, validation, affichage et server functions. +//! +//! Le nom de famille et l'année sont facultatifs. Tout ce qui est pur (validation, +//! formatage) est compilé des deux côtés et testé sans base de données ; seules les +//! server functions et le calcul de la prochaine occurrence sont propres au serveur. + +use leptos::prelude::*; +use serde::{Deserialize, Serialize}; + +#[cfg(feature = "ssr")] +use crate::server; + +pub const NAME_MAX: usize = 100; +/// Année de naissance minimale acceptée. +pub const YEAR_MIN: i32 = 1900; + +pub const MONTHS: [&str; 12] = [ + "janvier", + "février", + "mars", + "avril", + "mai", + "juin", + "juillet", + "août", + "septembre", + "octobre", + "novembre", + "décembre", +]; + +/// Un anniversaire, tel qu'affiché : `days_until` et `age` sont calculés par le +/// serveur au moment du chargement de la liste. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Birthday { + pub id: i64, + pub first_name: String, + pub last_name: Option<String>, + pub day: u8, + pub month: u8, + pub year: Option<i32>, + /// Nombre de jours avant le prochain anniversaire (0 = aujourd'hui). + pub days_until: u32, + /// Âge réel aujourd'hui, si l'année de naissance est connue. + pub age: Option<u32>, +} + +impl Birthday { + pub fn full_name(&self) -> String { + match &self.last_name { + Some(last_name) => format!("{} {last_name}", self.first_name), + None => self.first_name.clone(), + } + } +} + +/// Date du jour, réduite à ce dont la validation a besoin. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct Today { + pub year: i32, + pub month: u8, + pub day: u8, +} + +/// Saisie validée et normalisée, prête à être enregistrée. +#[derive(Debug, PartialEq, Eq)] +pub struct NewBirthday { + pub first_name: String, + pub last_name: Option<String>, + pub day: u8, + pub month: u8, + pub year: Option<i32>, +} + +pub fn is_leap_year(year: i32) -> bool { + (year % 4 == 0 && year % 100 != 0) || year % 400 == 0 +} + +/// Nombre de jours du mois. Sans année, février compte 29 jours : on accepte +/// « 29 février » puisqu'on ne sait pas si l'année de naissance est bissextile. +pub fn days_in_month(month: u8, year: Option<i32>) -> u8 { + match month { + 2 if year.is_none_or(is_leap_year) => 29, + 2 => 28, + 4 | 6 | 9 | 11 => 30, + _ => 31, + } +} + +enum NameProblem { + TooLong, + Invalid, +} + +fn name_problem(name: &str) -> Option<NameProblem> { + if name.chars().count() > NAME_MAX { + Some(NameProblem::TooLong) + } else if name.chars().any(char::is_control) { + Some(NameProblem::Invalid) + } else { + None + } +} + +/// Valide et normalise la saisie du formulaire (les valeurs arrivent en texte brut). +/// +/// - le prénom est obligatoire, le nom est facultatif (vide = absent) ; +/// - la date doit exister ; l'année est facultative, comprise entre 1900 et +/// aujourd'hui, et la date complète ne peut pas être dans le futur. +pub fn parse_new_birthday( + first_name: &str, + last_name: &str, + day: &str, + month: &str, + year: &str, + today: Today, +) -> Result<NewBirthday, String> { + let first_name = first_name.trim(); + if first_name.is_empty() { + return Err("Le prénom est obligatoire.".into()); + } + match name_problem(first_name) { + Some(NameProblem::TooLong) => { + return Err(format!("Le prénom est trop long ({NAME_MAX} caractères maximum).")); + } + Some(NameProblem::Invalid) => return Err("Le prénom contient des caractères non autorisés.".into()), + None => {} + } + + let last_name = last_name.trim(); + match name_problem(last_name) { + Some(NameProblem::TooLong) => { + return Err(format!("Le nom est trop long ({NAME_MAX} caractères maximum).")); + } + Some(NameProblem::Invalid) => return Err("Le nom contient des caractères non autorisés.".into()), + None => {} + } + let last_name = (!last_name.is_empty()).then(|| last_name.to_string()); + + let month: u8 = month + .trim() + .parse() + .ok() + .filter(|m| (1..=12).contains(m)) + .ok_or("Le mois est invalide.")?; + let day: u8 = day + .trim() + .parse() + .ok() + .filter(|d| (1..=31).contains(d)) + .ok_or("Le jour doit être un nombre entre 1 et 31.")?; + + let year = match year.trim() { + "" => None, + text => { + let year: i32 = text.parse().map_err(|_| "L'année doit être un nombre.")?; + if !(YEAR_MIN..=today.year).contains(&year) { + return Err(format!("L'année doit être comprise entre {YEAR_MIN} et {}.", today.year)); + } + Some(year) + } + }; + + if day > days_in_month(month, year) { + return Err("Cette date n'existe pas.".into()); + } + if year == Some(today.year) && (month, day) > (today.month, today.day) { + return Err("La date de naissance ne peut pas être dans le futur.".into()); + } + + Ok(NewBirthday { + first_name: first_name.to_string(), + last_name, + day, + month, + year, + }) +} + +/// « 1er mars », « 12 mars 1990 ». +pub fn format_date(day: u8, month: u8, year: Option<i32>) -> String { + let day = if day == 1 { "1er".to_string() } else { day.to_string() }; + let month = MONTHS + .get(usize::from(month).wrapping_sub(1)) + .copied() + .unwrap_or("?"); + match year { + Some(year) => format!("{day} {month} {year}"), + None => format!("{day} {month}"), + } +} + +/// « Aujourd'hui », « Demain », « Dans 12 jours ». +pub fn format_countdown(days_until: u32) -> String { + match days_until { + 0 => "Aujourd'hui".to_string(), + 1 => "Demain".to_string(), + n => format!("Dans {n} jours"), + } +} + +/// « 0 an », « 1 an », « 34 ans » (le singulier vaut pour 0 et 1 en français). +pub fn format_age(age: u32) -> String { + format!("{age} an{}", if age > 1 { "s" } else { "" }) +} + +#[cfg(feature = "ssr")] +mod schedule { + use super::is_leap_year; + use time::{Date, Month}; + + /// Prochaine occurrence (aujourd'hui inclus) du jour et mois donnés. + /// + /// Les 29 février sont fêtés le 28 les années non bissextiles. + /// `None` si la date n'existe pas (ligne corrompue en base). + pub fn next_occurrence(today: Date, month: u8, day: u8) -> Option<Date> { + let month = Month::try_from(month).ok()?; + let on = |year: i32| { + let day = if month == Month::February && day == 29 && !is_leap_year(year) { + 28 + } else { + day + }; + Date::from_calendar_date(year, month, day).ok() + }; + let this_year = on(today.year())?; + if this_year >= today { + Some(this_year) + } else { + on(today.year() + 1) + } + } + + /// Âge réel aujourd'hui d'une personne née en `birth_year`, d'après sa prochaine + /// occurrence d'anniversaire : c'est l'âge à venir, moins un tant que + /// l'anniversaire n'est pas arrivé (`days_until > 0`). + pub fn current_age(next: Date, days_until: u32, birth_year: i32) -> Option<u32> { + u32::try_from(next.year() - birth_year - i32::from(days_until > 0)).ok() + } + + #[cfg(test)] + mod tests { + use super::*; + + fn d(y: i32, m: u8, day: u8) -> Date { + Date::from_calendar_date(y, Month::try_from(m).unwrap(), day).unwrap() + } + + #[test] + fn birthday_later_this_year() { + assert_eq!(next_occurrence(d(2026, 3, 1), 3, 12), Some(d(2026, 3, 12))); + } + + #[test] + fn birthday_today_counts_as_today() { + assert_eq!(next_occurrence(d(2026, 3, 12), 3, 12), Some(d(2026, 3, 12))); + } + + #[test] + fn birthday_already_passed_rolls_to_next_year() { + assert_eq!(next_occurrence(d(2026, 3, 13), 3, 12), Some(d(2027, 3, 12))); + } + + #[test] + fn feb_29_is_celebrated_on_feb_28_in_common_years() { + assert_eq!(next_occurrence(d(2026, 1, 1), 2, 29), Some(d(2026, 2, 28))); + assert_eq!(next_occurrence(d(2027, 3, 1), 2, 29), Some(d(2028, 2, 29))); + } + + #[test] + fn age_is_the_age_reached_at_the_last_birthday() { + let today = d(2026, 9, 19); + // Né le 12 mars 1990 : 36 ans depuis mars dernier, 37 ans en mars prochain. + let next = next_occurrence(today, 3, 12).unwrap(); + assert_eq!(current_age(next, 174, 1990), Some(36)); + // Né le 19 septembre 2000 : anniversaire aujourd'hui, donc 26 ans. + let next = next_occurrence(today, 9, 19).unwrap(); + assert_eq!(current_age(next, 0, 2000), Some(26)); + // Né le 20 septembre 2000 : demain ses 26 ans, il en a encore 25. + let next = next_occurrence(today, 9, 20).unwrap(); + assert_eq!(current_age(next, 1, 2000), Some(25)); + // Né le 19 septembre 2026 : nouveau-né du jour. + let next = next_occurrence(today, 9, 19).unwrap(); + assert_eq!(current_age(next, 0, 2026), Some(0)); + } + + #[test] + fn feb_29_baby_ages_on_feb_28_in_common_years() { + // Né le 29/02/2000, le 1er mars 2026 : déjà 26 ans (fêtés le 28/02/2026). + let today = d(2026, 3, 1); + let next = next_occurrence(today, 2, 29).unwrap(); + assert_eq!(current_age(next, 364, 2000), Some(26)); + } + + #[test] + fn corrupted_dates_do_not_panic() { + assert_eq!(next_occurrence(d(2026, 1, 1), 13, 1), None); + assert_eq!(next_occurrence(d(2026, 1, 1), 4, 31), None); + } + } +} + +#[cfg(feature = "ssr")] +#[derive(sqlx::FromRow)] +struct BirthdayRow { + id: i64, + first_name: String, + last_name: Option<String>, + day: i64, + month: i64, + year: Option<i64>, +} + +#[cfg(feature = "ssr")] +fn today() -> time::Date { + time::OffsetDateTime::now_utc().date() +} + +/// Liste les anniversaires de l'utilisateur connecté, du plus proche au plus lointain. +#[server] +pub async fn list_birthdays() -> Result<Vec<Birthday>, ServerFnError> { + let user_id = server::require_user_id().await?; + let rows = sqlx::query_as::<_, BirthdayRow>( + "SELECT id, first_name, last_name, day, month, year FROM birthdays WHERE user_id = ?1", + ) + .bind(user_id) + .fetch_all(&server::pool()?) + .await + .map_err(server::internal_error)?; + + let today = today(); + let mut birthdays: Vec<Birthday> = rows + .into_iter() + .filter_map(|row| { + let (day, month) = (u8::try_from(row.day).ok()?, u8::try_from(row.month).ok()?); + let year = row.year.and_then(|y| i32::try_from(y).ok()); + let Some(next) = schedule::next_occurrence(today, month, day) else { + leptos::logging::error!("anniversaire {} ignoré : date invalide", row.id); + return None; + }; + let days_until = u32::try_from((next - today).whole_days()).ok()?; + Some(Birthday { + id: row.id, + first_name: row.first_name, + last_name: row.last_name, + day, + month, + year, + days_until, + age: year.and_then(|y| schedule::current_age(next, days_until, y)), + }) + }) + .collect(); + + birthdays.sort_by_cached_key(|b| (b.days_until, b.first_name.to_lowercase())); + Ok(birthdays) +} + +/// Ajoute un anniversaire pour l'utilisateur connecté. +#[server] +pub async fn add_birthday( + first_name: String, + last_name: String, + day: String, + month: String, + year: String, +) -> Result<(), ServerFnError> { + let user_id = server::require_user_id().await?; + let now = today(); + let today = Today { + year: now.year(), + month: u8::from(now.month()), + day: now.day(), + }; + let new = parse_new_birthday(&first_name, &last_name, &day, &month, &year, today) + .map_err(ServerFnError::new)?; + + sqlx::query( + "INSERT INTO birthdays (user_id, first_name, last_name, day, month, year) \ + VALUES (?1, ?2, ?3, ?4, ?5, ?6)", + ) + .bind(user_id) + .bind(&new.first_name) + .bind(&new.last_name) + .bind(i64::from(new.day)) + .bind(i64::from(new.month)) + .bind(new.year) + .execute(&server::pool()?) + .await + .map_err(server::internal_error)?; + Ok(()) +} + +/// Supprime un anniversaire de l'utilisateur connecté. +/// +/// Le `user_id` dans le `WHERE` est essentiel : sans lui, n'importe quel utilisateur +/// pourrait supprimer l'anniversaire d'un autre en devinant son identifiant. +#[server] +pub async fn delete_birthday(id: i64) -> Result<(), ServerFnError> { + let user_id = server::require_user_id().await?; + let done = sqlx::query("DELETE FROM birthdays WHERE id = ?1 AND user_id = ?2") + .bind(id) + .bind(user_id) + .execute(&server::pool()?) + .await + .map_err(server::internal_error)?; + if done.rows_affected() == 0 { + return Err(ServerFnError::new("Anniversaire introuvable.")); + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + const TODAY: Today = Today { + year: 2026, + month: 9, + day: 19, + }; + + fn parse(first: &str, last: &str, day: &str, month: &str, year: &str) -> Result<NewBirthday, String> { + parse_new_birthday(first, last, day, month, year, TODAY) + } + + #[test] + fn full_birthday() { + assert_eq!( + parse(" Camille ", " Dupont ", "12", "3", "1990"), + Ok(NewBirthday { + first_name: "Camille".into(), + last_name: Some("Dupont".into()), + day: 12, + month: 3, + year: Some(1990), + }) + ); + } + + #[test] + fn last_name_and_year_are_optional() { + let b = parse("Camille", " ", "12", "3", "").unwrap(); + assert_eq!(b.last_name, None); + assert_eq!(b.year, None); + } + + #[test] + fn first_name_is_required() { + assert!(parse("", "Dupont", "12", "3", "").is_err()); + assert!(parse(" ", "", "12", "3", "").is_err()); + } + + #[test] + fn names_are_bounded_and_clean() { + let long = "a".repeat(NAME_MAX + 1); + assert!(parse(&long, "", "1", "1", "").is_err()); + assert!(parse("Camille", &long, "1", "1", "").is_err()); + assert!(parse(&"a".repeat(NAME_MAX), "", "1", "1", "").is_ok()); + assert!(parse("Ca\nmille", "", "1", "1", "").is_err()); + // Apostrophes, traits d'union, accents : légitimes. + assert!(parse("Anne-Sophie", "D'Aubigné", "1", "1", "").is_ok()); + } + + #[test] + fn day_and_month_must_be_valid_numbers() { + assert!(parse("A", "", "0", "3", "").is_err()); + assert!(parse("A", "", "32", "3", "").is_err()); + assert!(parse("A", "", "abc", "3", "").is_err()); + assert!(parse("A", "", "", "3", "").is_err()); + assert!(parse("A", "", "12", "0", "").is_err()); + assert!(parse("A", "", "12", "13", "").is_err()); + assert!(parse("A", "", "12", "", "").is_err()); + assert!(parse("A", "", "-1", "3", "").is_err()); + } + + #[test] + fn impossible_dates_are_rejected() { + assert!(parse("A", "", "31", "4", "").is_err()); + assert!(parse("A", "", "30", "2", "").is_err()); + assert!(parse("A", "", "29", "2", "2023").is_err()); + } + + #[test] + fn feb_29_depends_on_the_year() { + assert!(parse("A", "", "29", "2", "").is_ok(), "sans année : accepté"); + assert!(parse("A", "", "29", "2", "2024").is_ok(), "2024 est bissextile"); + assert!(parse("A", "", "29", "2", "1900").is_err(), "1900 ne l'est pas"); + assert!(parse("A", "", "29", "2", "2000").is_ok(), "2000 l'est"); + } + + #[test] + fn year_bounds() { + assert!(parse("A", "", "1", "1", "1899").is_err()); + assert!(parse("A", "", "1", "1", "1900").is_ok()); + assert!(parse("A", "", "1", "1", "2026").is_ok()); + assert!(parse("A", "", "1", "1", "2027").is_err()); + assert!(parse("A", "", "1", "1", "abc").is_err()); + } + + #[test] + fn birth_date_cannot_be_in_the_future() { + assert!(parse("A", "", "19", "9", "2026").is_ok(), "aujourd'hui"); + assert!(parse("A", "", "20", "9", "2026").is_err(), "demain"); + assert!(parse("A", "", "1", "10", "2026").is_err()); + assert!(parse("A", "", "20", "9", "").is_ok(), "sans année, pas de futur possible"); + } + + #[test] + fn date_formatting() { + assert_eq!(format_date(1, 3, None), "1er mars"); + assert_eq!(format_date(12, 3, Some(1990)), "12 mars 1990"); + assert_eq!(format_date(29, 2, None), "29 février"); + assert_eq!(format_date(5, 8, None), "5 août"); + } + + #[test] + fn countdown_formatting() { + assert_eq!(format_countdown(0), "Aujourd'hui"); + assert_eq!(format_countdown(1), "Demain"); + assert_eq!(format_countdown(12), "Dans 12 jours"); + } + + #[test] + fn age_formatting() { + assert_eq!(format_age(0), "0 an"); + assert_eq!(format_age(1), "1 an"); + assert_eq!(format_age(2), "2 ans"); + assert_eq!(format_age(36), "36 ans"); + } + + #[test] + fn month_lengths() { + assert_eq!(days_in_month(1, Some(2026)), 31); + assert_eq!(days_in_month(4, None), 30); + assert_eq!(days_in_month(2, Some(2026)), 28); + assert_eq!(days_in_month(2, Some(2024)), 29); + assert_eq!(days_in_month(2, None), 29); + } + + #[test] + fn full_name() { + let mut b = Birthday { + id: 1, + first_name: "Camille".into(), + last_name: Some("Dupont".into()), + day: 1, + month: 1, + year: None, + days_until: 0, + age: None, + }; + assert_eq!(b.full_name(), "Camille Dupont"); + b.last_name = None; + assert_eq!(b.full_name(), "Camille"); + } +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..5cc13ca --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,15 @@ +pub mod app; +pub mod auth; +pub mod birthdays; +pub mod pages; +pub mod ui; +#[cfg(feature = "ssr")] +pub mod server; + +#[cfg(feature = "hydrate")] +#[wasm_bindgen::prelude::wasm_bindgen] +pub fn hydrate() { + use crate::app::*; + console_error_panic_hook::set_once(); + leptos::mount::hydrate_body(App); +} diff --git a/src/main.rs b/src/main.rs index e7a11a9..b46797a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,76 @@ -fn main() { - println!("Hello, world!"); +#[cfg(feature = "ssr")] +#[tokio::main] +async fn main() { + use axum::Router; + use birthday_calendar::{ + app::{App, shell}, + server, + }; + use leptos::{logging::log, prelude::*}; + use leptos_axum::{LeptosRoutes, generate_route_list}; + use tower_sessions::{ + Expiry, SessionManagerLayer, + cookie::{SameSite, time::Duration}, + session_store::ExpiredDeletion, + }; + use tower_sessions_sqlx_store::SqliteStore; + + let database_url = + std::env::var("DATABASE_URL").unwrap_or_else(|_| "sqlite:birthday_calendar.db".into()); + let pool = server::connect_db(&database_url) + .await + .expect("impossible d'ouvrir la base de données"); + + // Les sessions sont stockées en base : elles survivent à un redémarrage du serveur. + let session_store = SqliteStore::new(pool.clone()); + session_store + .migrate() + .await + .expect("impossible de créer la table des sessions"); + tokio::spawn( + session_store + .clone() + .continuously_delete_expired(tokio::time::Duration::from_secs(60)), + ); + + let conf = get_configuration(None).unwrap(); + let addr = conf.leptos_options.site_addr; + let leptos_options = conf.leptos_options; + let is_prod = matches!(leptos_options.env, Env::PROD); + + let session_layer = SessionManagerLayer::new(session_store) + // Cookie `Secure` (HTTPS uniquement) en production. `HttpOnly` est activé par défaut. + .with_secure(is_prod) + // `Lax` : le cookie n'est pas envoyé sur les requêtes POST venant d'un autre site (CSRF). + .with_same_site(SameSite::Lax) + .with_expiry(Expiry::OnInactivity(Duration::days(7))); + + let routes = generate_route_list(App); + let app = Router::new() + .leptos_routes_with_context( + &leptos_options, + routes, + { + let pool = pool.clone(); + move || provide_context(pool.clone()) + }, + { + let leptos_options = leptos_options.clone(); + move || shell(leptos_options.clone()) + }, + ) + .fallback(leptos_axum::file_and_error_handler(shell)) + .layer(session_layer) + .with_state(leptos_options); + + log!("listening on http://{}", &addr); + let listener = tokio::net::TcpListener::bind(&addr).await.unwrap(); + axum::serve(listener, app.into_make_service()) + .await + .unwrap(); +} + +#[cfg(not(feature = "ssr"))] +pub fn main() { + // Pas de `main` côté client : voir `hydrate()` dans lib.rs. } diff --git a/src/pages.rs b/src/pages.rs new file mode 100644 index 0000000..1d18610 --- /dev/null +++ b/src/pages.rs @@ -0,0 +1,334 @@ +use crate::{ + auth::{self, EMAIL_MAX, Login, PASSWORD_MAX, PASSWORD_MIN, Register}, + birthdays::{ + self, AddBirthday, Birthday, DeleteBirthday, MONTHS, NAME_MAX, YEAR_MIN, format_age, + format_countdown, format_date, + }, + ui::{Card, Field, FormError, LINK, Panel, Select, SubmitButton}, +}; +use leptos::{html, prelude::*}; +use leptos_router::components::{A, Redirect}; + +/// Message d'erreur d'une action de formulaire (`login.value()`, `register.value()`), s'il y en a un. +fn error_of( + value: impl Get<Value = Option<Result<(), ServerFnError>>> + Send + Sync + 'static, +) -> impl Fn() -> Option<String> + Send + Sync + 'static { + move || { + value + .get() + .and_then(Result::err) + .map(|e| auth::error_message(&e)) + } +} + +/// Page d'accueil : les anniversaires de l'utilisateur, réservée aux utilisateurs connectés. +#[component] +pub fn HomePage() -> impl IntoView { + // Ressource propre à la page, rechargée à chaque visite : après une connexion, la + // navigation vers `/` a lieu avant que l'état global de l'en-tête soit à jour, et + // s'appuyer dessus renverrait à tort vers /login. + let user = Resource::new(|| (), |_| auth::get_user()); + + view! { + <Suspense fallback=|| view! { <p>"Chargement…"</p> }> + {move || { + user.get() + .map(|user| match user { + Ok(Some(_)) => view! { <BirthdaysPage /> }.into_any(), + _ => view! { <Redirect path="/login" /> }.into_any(), + }) + }} + </Suspense> + } +} + +#[component] +fn BirthdaysPage() -> impl IntoView { + let add = ServerAction::<AddBirthday>::new(); + let delete = ServerAction::<DeleteBirthday>::new(); + // Recharge la liste après chaque ajout ou suppression. + let list = Resource::new( + move || (add.version().get(), delete.version().get()), + |_| birthdays::list_birthdays(), + ); + + // Le formulaire est replié derrière le bouton « + »... sauf tant qu'il n'y a aucun + // anniversaire : le montrer d'emblée invite alors à ajouter le premier. + let open = RwSignal::new(false); + let has_entries = move || list.with(|list| matches!(list, Some(Ok(items)) if !items.is_empty())); + let is_empty = move || list.with(|list| matches!(list, Some(Ok(items)) if items.is_empty())); + let form_visible = move || open.get() || is_empty(); + + // Un ajout réussi garde le formulaire ouvert, pour enchaîner les saisies. Sans cela, il se + // refermerait dès que le premier anniversaire apparaît dans la liste. + Effect::new(move |_| { + if matches!(add.value().get(), Some(Ok(()))) { + open.set(true); + } + }); + + let first_field = NodeRef::<html::Input>::new(); + // Ouvrir le formulaire à la main place le curseur dans le premier champ. Le focus est + // différé d'une frame : au moment où cet effet s'exécute, le champ est encore masqué. + Effect::new(move |_| { + if open.get() { + if let Some(input) = first_field.get() { + request_animation_frame(move || { + let _ = input.focus(); + }); + } + } + }); + + // Tout le bloc est sous un `Transition` : le serveur attend la liste avant de rendre la page, + // donc le HTML qu'il envoie (bouton « + » visible ou non, formulaire replié ou non) est + // exactement celui que le navigateur reconstruit à l'hydratation. Les enfants ne lisent + // `list` que dans des closures imbriquées : ils ne sont rendus qu'une fois, ce qui + // préserve ce qui est saisi dans le formulaire pendant les rechargements de la liste. + view! { + <Transition fallback=|| view! { <p>"Chargement…"</p> }> + <div class="flex flex-col gap-6"> + <div class="flex items-center justify-between gap-4"> + <h1 class="text-3xl font-bold">"Anniversaires"</h1> + // Toujours présent dans le DOM (seule sa visibilité change), pour que la + // structure soit identique côté serveur et côté client. + <div class=("hidden", move || !has_entries())> + <button + type="button" + class="flex size-10 shrink-0 items-center justify-center rounded-full bg-accent text-white shadow-sm transition hover:bg-accent-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent" + aria-controls="add-birthday" + aria-expanded=move || open.get().to_string() + aria-label=move || { + if open.get() { + "Fermer le formulaire d'ajout" + } else { + "Ajouter un anniversaire" + } + } + on:click=move |_| open.update(|open| *open = !*open) + > + // Le « + » pivote de 45° et devient un « × » quand le formulaire est ouvert. + <svg + class="size-5 transition-transform" + class=("rotate-45", move || open.get()) + viewBox="0 0 24 24" + fill="none" + stroke="currentColor" + stroke-width="2.5" + stroke-linecap="round" + aria-hidden="true" + > + <path d="M12 5v14M5 12h14" /> + </svg> + </button> + </div> + </div> + // Masqué par CSS plutôt que retiré du DOM : ce qui a été saisi est conservé si on + // referme puis rouvre le formulaire. + <div id="add-birthday" class=("hidden", move || !form_visible())> + <AddBirthdayForm add first_field /> + </div> + {move || { + list.get() + .map(|result| match result { + Ok(items) if items.is_empty() => ().into_any(), + Ok(items) => { + view! { + <ul class="flex flex-col gap-3"> + {items + .into_iter() + .map(|birthday| view! { <BirthdayItem birthday delete /> }) + .collect_view()} + </ul> + } + .into_any() + } + Err(e) => { + view! { <FormError message=Some(auth::error_message(&e)) /> } + .into_any() + } + }) + }} + <FormError message=error_of(delete.value()) /> + </div> + </Transition> + } +} + +#[component] +fn AddBirthdayForm( + add: ServerAction<AddBirthday>, + /// Premier champ du formulaire : reçoit le focus après un ajout, pour enchaîner. + first_field: NodeRef<html::Input>, +) -> impl IntoView { + let form = NodeRef::<html::Form>::new(); + + // Vide le formulaire quand l'ajout a réussi (`ActionForm` ne le fait pas). + Effect::new(move |_| { + if matches!(add.value().get(), Some(Ok(()))) { + if let Some(form) = form.get() { + form.reset(); + } + if let Some(input) = first_field.get() { + let _ = input.focus(); + } + } + }); + + let months = MONTHS + .iter() + .enumerate() + .map(|(i, name)| ((i + 1).to_string(), *name)) + .collect::<Vec<_>>(); + + view! { + <Panel title="Ajouter un anniversaire"> + <ActionForm action=add node_ref=form attr:class="flex flex-col gap-4"> + <div class="grid grid-cols-1 gap-4 sm:grid-cols-2"> + <Field + label="Prénom" + name="first_name" + autocomplete="off" + maxlength=NAME_MAX + node_ref=first_field + /> + <Field + label="Nom (facultatif)" + name="last_name" + autocomplete="off" + required=false + maxlength=NAME_MAX + /> + </div> + <div class="grid grid-cols-3 items-end gap-4"> + <Field label="Jour" name="day" kind="number" min=1 max=31 /> + <Select label="Mois" name="month" placeholder="Mois" options=months /> + <Field + label="Année (facultatif)" + name="year" + kind="number" + required=false + min=YEAR_MIN + /> + </div> + <FormError message=error_of(add.value()) /> + <div> + <SubmitButton pending=add.pending()>"Ajouter"</SubmitButton> + </div> + </ActionForm> + </Panel> + } +} + +#[component] +fn BirthdayItem(birthday: Birthday, delete: ServerAction<DeleteBirthday>) -> impl IntoView { + let name = birthday.full_name(); + // « 12 mars 1990 · 36 ans » : l'âge réel aujourd'hui, pas celui de la prochaine bougie. + let date = match birthday.age { + Some(age) => format!( + "{} · {}", + format_date(birthday.day, birthday.month, birthday.year), + format_age(age) + ), + None => format_date(birthday.day, birthday.month, birthday.year), + }; + let countdown = format_countdown(birthday.days_until); + let today = birthday.days_until == 0; + let aria_label = format!("Supprimer {name}"); + + view! { + <li class="flex items-center justify-between gap-4 rounded-lg border border-zinc-200 bg-white p-4 dark:border-zinc-800 dark:bg-zinc-900"> + <div class="min-w-0"> + <p class="truncate font-semibold">{name}</p> + <p class="text-sm text-zinc-500 dark:text-zinc-400">{date}</p> + </div> + <div class="flex shrink-0 flex-col items-end gap-1"> + <p class=if today { + "text-sm font-bold text-accent" + } else { + "text-sm font-semibold" + }>{if today { format!("🎉 {countdown}") } else { countdown }}</p> + <ActionForm action=delete> + <input type="hidden" name="id" value=birthday.id /> + <button + type="submit" + aria-label=aria_label + class="text-xs text-red-600 hover:underline dark:text-red-400" + > + "Supprimer" + </button> + </ActionForm> + </div> + </li> + } +} + +#[component] +pub fn LoginPage(login: ServerAction<Login>) -> impl IntoView { + view! { + <Card title="Connexion"> + <ActionForm action=login attr:class="flex flex-col gap-4"> + <Field + label="Adresse e-mail" + name="email" + kind="email" + autocomplete="email" + maxlength=EMAIL_MAX + autofocus=true + /> + <Field + label="Mot de passe" + name="password" + kind="password" + autocomplete="current-password" + /> + <FormError message=error_of(login.value()) /> + <SubmitButton pending=login.pending()>"Se connecter"</SubmitButton> + </ActionForm> + <p class="text-sm"> + "Pas encore de compte ? " <A href="/register" attr:class=LINK> + "Inscription" + </A> + </p> + </Card> + } +} + +#[component] +pub fn RegisterPage(register: ServerAction<Register>) -> impl IntoView { + view! { + <Card title="Inscription"> + <ActionForm action=register attr:class="flex flex-col gap-4"> + <Field + label="Adresse e-mail" + name="email" + kind="email" + autocomplete="email" + maxlength=EMAIL_MAX + autofocus=true + /> + <Field + label="Mot de passe" + name="password" + kind="password" + autocomplete="new-password" + minlength=PASSWORD_MIN + maxlength=PASSWORD_MAX + /> + <Field + label="Confirmer le mot de passe" + name="password_confirmation" + kind="password" + autocomplete="new-password" + minlength=PASSWORD_MIN + maxlength=PASSWORD_MAX + /> + <FormError message=error_of(register.value()) /> + <SubmitButton pending=register.pending()>"Créer mon compte"</SubmitButton> + </ActionForm> + <p class="text-sm"> + "Déjà inscrit ? " <A href="/login" attr:class=LINK>"Connexion"</A> + </p> + </Card> + } +} diff --git a/src/server.rs b/src/server.rs new file mode 100644 index 0000000..e1cd87d --- /dev/null +++ b/src/server.rs @@ -0,0 +1,136 @@ +//! Code exécuté uniquement côté serveur : base de données, mots de passe, session. + +use argon2::{ + Argon2, + password_hash::{PasswordHash, PasswordHasher, PasswordVerifier, SaltString, rand_core::OsRng}, +}; +use leptos::prelude::*; +use sqlx::{ + SqlitePool, + sqlite::{SqliteConnectOptions, SqlitePoolOptions}, +}; +use std::{error::Error, fmt::Display, str::FromStr, sync::LazyLock}; +use tower_sessions::Session; + +/// Clé sous laquelle l'identifiant de l'utilisateur est stocké dans la session. +pub const USER_ID_KEY: &str = "user_id"; + +/// Ouvre le pool SQLite (en créant le fichier au besoin) et applique les migrations. +pub async fn connect_db(url: &str) -> Result<SqlitePool, Box<dyn Error>> { + let options = SqliteConnectOptions::from_str(url)? + .create_if_missing(true) + .foreign_keys(true); + let pool = SqlitePoolOptions::new() + .max_connections(5) + .connect_with(options) + .await?; + sqlx::migrate!().run(&pool).await?; + Ok(pool) +} + +/// Récupère le pool fourni en contexte par `main`. +pub fn pool() -> Result<SqlitePool, ServerFnError> { + use_context::<SqlitePool>().ok_or_else(|| internal_error("SqlitePool absent du contexte")) +} + +/// Récupère la session de la requête en cours. +pub async fn session() -> Result<Session, ServerFnError> { + leptos_axum::extract::<Session>().await.map_err(internal_error) +} + +/// Identifiant de l'utilisateur connecté, ou une erreur s'il n'y a pas de session. +/// +/// À appeler en tête de toute server function qui touche à des données personnelles, +/// puis à utiliser dans un `WHERE user_id = ?` : c'est ce qui empêche un utilisateur +/// de lire ou modifier les données d'un autre. +pub async fn require_user_id() -> Result<i64, ServerFnError> { + session() + .await? + .get::<i64>(USER_ID_KEY) + .await + .map_err(internal_error)? + .ok_or_else(|| ServerFnError::new("Vous devez être connecté.")) +} + +/// Journalise l'erreur réelle et renvoie au client un message générique, +/// pour ne jamais exposer de détails internes (SQL, chemins, etc.). +pub fn internal_error(error: impl Display) -> ServerFnError { + leptos::logging::error!("erreur interne : {error}"); + ServerFnError::new("Une erreur interne est survenue.") +} + +/// Hache un mot de passe avec Argon2id (sel aléatoire, paramètres par défaut). +/// +/// Le calcul est volontairement coûteux : il est déporté sur un thread bloquant +/// pour ne pas geler le runtime async. +pub async fn hash_password(password: String) -> Result<String, ServerFnError> { + tokio::task::spawn_blocking(move || { + let salt = SaltString::generate(&mut OsRng); + Argon2::default() + .hash_password(password.as_bytes(), &salt) + .map(|hash| hash.to_string()) + .map_err(|e| e.to_string()) + }) + .await + .map_err(internal_error)? + .map_err(internal_error) +} + +/// Hash factice, vérifié quand l'utilisateur n'existe pas : le temps de réponse +/// est ainsi le même que pour un mauvais mot de passe, ce qui empêche de deviner +/// quels noms d'utilisateur existent en mesurant la latence. +static DUMMY_HASH: LazyLock<String> = LazyLock::new(|| { + let salt = SaltString::generate(&mut OsRng); + Argon2::default() + .hash_password(b"mot-de-passe-factice", &salt) + .expect("le hachage du hash factice ne peut pas échouer") + .to_string() +}); + +/// Vérifie un mot de passe. `stored_hash` vaut `None` si l'utilisateur n'existe pas : +/// le calcul est alors fait contre un hash factice et le résultat est toujours `false`. +pub async fn verify_password(password: String, stored_hash: Option<String>) -> bool { + tokio::task::spawn_blocking(move || { + let user_exists = stored_hash.is_some(); + let hash = stored_hash.as_deref().unwrap_or(DUMMY_HASH.as_str()); + let Ok(parsed) = PasswordHash::new(hash) else { + return false; + }; + let valid = Argon2::default() + .verify_password(password.as_bytes(), &parsed) + .is_ok(); + valid && user_exists + }) + .await + .unwrap_or(false) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[tokio::test] + async fn correct_password_is_accepted() { + let hash = hash_password("correct horse battery".into()).await.unwrap(); + assert!(hash.starts_with("$argon2id$")); + assert!(verify_password("correct horse battery".into(), Some(hash)).await); + } + + #[tokio::test] + async fn wrong_password_is_rejected() { + let hash = hash_password("correct horse battery".into()).await.unwrap(); + assert!(!verify_password("wrong".into(), Some(hash)).await); + } + + #[tokio::test] + async fn unknown_user_is_always_rejected() { + assert!(!verify_password("mot-de-passe-factice".into(), None).await); + } + + #[tokio::test] + async fn same_password_gives_different_hashes() { + let a = hash_password("secret-12345".into()).await.unwrap(); + let b = hash_password("secret-12345".into()).await.unwrap(); + assert_ne!(a, b); + } +} diff --git a/src/ui.rs b/src/ui.rs new file mode 100644 index 0000000..4514f5d --- /dev/null +++ b/src/ui.rs @@ -0,0 +1,125 @@ +//! Petits composants d'interface réutilisables (Tailwind CSS). + +use leptos::{html, prelude::*}; + +/// Lien discret aux couleurs de l'application. +pub const LINK: &str = "text-accent underline-offset-2 hover:underline"; + +pub const INPUT: &str = "rounded-md border border-zinc-300 bg-white px-3 py-2 text-base shadow-sm \ + focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/40 \ + dark:border-zinc-700 dark:bg-zinc-900"; + +const BUTTON: &str = "rounded-md bg-accent px-4 py-2 font-semibold text-white transition \ + hover:bg-accent-hover focus-visible:outline-2 focus-visible:outline-offset-2 \ + focus-visible:outline-accent disabled:cursor-wait disabled:opacity-60"; + +/// Carte centrée, avec un titre : conteneur des pages de connexion / inscription. +#[component] +pub fn Card(title: &'static str, children: Children) -> impl IntoView { + view! { + <div class="mx-auto flex max-w-sm flex-col gap-4 rounded-xl border border-zinc-200 bg-white p-6 shadow-sm dark:border-zinc-800 dark:bg-zinc-900"> + <h1 class="text-2xl font-bold">{title}</h1> + {children()} + </div> + } +} + +/// Panneau pleine largeur avec un titre de section (`<h2>`). +#[component] +pub fn Panel(title: &'static str, children: Children) -> impl IntoView { + view! { + <section class="flex flex-col gap-4 rounded-xl border border-zinc-200 bg-white p-6 shadow-sm dark:border-zinc-800 dark:bg-zinc-900"> + <h2 class="text-lg font-bold">{title}</h2> + {children()} + </section> + } +} + +/// Champ de formulaire : libellé + `<input>` (obligatoire par défaut). +#[component] +pub fn Field( + label: &'static str, + name: &'static str, + #[prop(default = "text")] kind: &'static str, + #[prop(optional, into)] autocomplete: Option<&'static str>, + #[prop(default = true)] required: bool, + #[prop(optional)] minlength: Option<usize>, + #[prop(optional)] maxlength: Option<usize>, + /// Bornes d'un champ `type="number"`. + #[prop(optional)] min: Option<i32>, + #[prop(optional)] max: Option<i32>, + #[prop(optional)] autofocus: bool, + /// Référence vers l'`<input>`, pour lui donner le focus depuis l'extérieur. + #[prop(optional)] node_ref: NodeRef<html::Input>, +) -> impl IntoView { + view! { + <label class="flex flex-col gap-1 text-sm font-semibold"> + {label} + <input + node_ref=node_ref + class=INPUT + type=kind + name=name + autocomplete=autocomplete + minlength=minlength + maxlength=maxlength + min=min + max=max + autofocus=autofocus + required=required + /> + </label> + } +} + +/// Liste déroulante obligatoire, avec une entrée vide désactivée comme invite. +#[component] +pub fn Select( + label: &'static str, + name: &'static str, + placeholder: &'static str, + /// Couples (valeur envoyée, texte affiché). + options: Vec<(String, &'static str)>, +) -> impl IntoView { + view! { + <label class="flex flex-col gap-1 text-sm font-semibold"> + {label} + <select class=INPUT name=name required> + <option value="" disabled selected> + {placeholder} + </option> + {options + .into_iter() + .map(|(value, text)| view! { <option value=value>{text}</option> }) + .collect_view()} + </select> + </label> + } +} + +/// Bouton de validation, désactivé pendant l'envoi. +#[component] +pub fn SubmitButton( + #[prop(into)] pending: Signal<bool>, + children: Children, +) -> impl IntoView { + view! { + <button type="submit" class=BUTTON disabled=move || pending.get()> + {children()} + </button> + } +} + +/// Message d'erreur (accessible : annoncé par les lecteurs d'écran). +#[component] +pub fn FormError(#[prop(into)] message: Signal<Option<String>>) -> impl IntoView { + move || { + message.get().map(|message| { + view! { + <p class="text-sm text-red-600 dark:text-red-400" role="alert"> + {message} + </p> + } + }) + } +} diff --git a/style/tailwind.css b/style/tailwind.css new file mode 100644 index 0000000..a9a3791 --- /dev/null +++ b/style/tailwind.css @@ -0,0 +1,17 @@ +@import "tailwindcss"; + +/* Tailwind v4 détecte automatiquement les classes dans le code, mais on déclare + la source explicitement : les vues Leptos vivent dans le dossier `src`. */ +@source "../src"; + +@theme { + --color-accent: #d6336c; + --color-accent-hover: #b82a5c; +} + +@layer base { + /* Contrôles de formulaire, barres de défilement, etc. suivent le thème du système. */ + :root { + color-scheme: light dark; + } +}