diff --git a/Cargo.lock b/Cargo.lock index 43106e7..9caffb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -62,7 +62,7 @@ dependencies = [ "flate2", "foldhash", "futures-core", - "h2", + "h2 0.3.26", "http 0.2.12", "httparse", "httpdate", @@ -434,6 +434,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "askama_escape" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df27b8d5ddb458c5fb1bbc1ce172d4a38c614a97d550b0ac89003897fb01de4" + [[package]] name = "async-lock" version = "3.4.0" @@ -487,6 +493,12 @@ 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.3" @@ -596,6 +608,12 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "base16" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27c3610c36aee21ce8ac510e6224498de4228ad772a171ed65643a24693a5a8" + [[package]] name = "base16ct" version = "0.2.0" @@ -697,25 +715,26 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.7" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" +checksum = "26d4d6dafc1a3bb54687538972158f07b2c948bc57d5890df22c0739098b3028" dependencies = [ "borsh-derive", - "cfg_aliases", + "cfg_aliases 0.1.1", ] [[package]] name = "borsh-derive" -version = "1.5.7" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" +checksum = "bf4918709cc4dd777ad2b6303ed03cb37f3ca0ccede8c1b0d28ac6db8f4710e0" dependencies = [ "once_cell", "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.102", + "syn_derive 0.1.8", ] [[package]] @@ -811,6 +830,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "cfg_aliases" version = "0.2.1" @@ -832,6 +857,33 @@ dependencies = [ "windows-link", ] +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + [[package]] name = "cipher" version = "0.4.4" @@ -924,7 +976,7 @@ dependencies = [ "pathdiff", "serde", "toml", - "winnow", + "winnow 0.7.11", ] [[package]] @@ -943,6 +995,27 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-serialize" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d3440e5f452d690e69c0b6a91befd7540829e7b65eba4de8a87bfb7d4a59a4" +dependencies = [ + "const-serialize-macro", + "serde", +] + +[[package]] +name = "const-serialize-macro" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4783a3ac6b34a3159bd292d3162e71ccae2843e560cba97a3b48be4367a2f7e5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.102", +] + [[package]] name = "const-str" version = "0.6.2" @@ -1092,6 +1165,12 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -1316,6 +1395,526 @@ dependencies = [ "subtle", ] +[[package]] +name = "dioxus" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de533de14b2a596449837e99444eec71ffef7ebbf610fd01fbc1ea6d6994c181" +dependencies = [ + "dioxus-cli-config", + "dioxus-config-macro", + "dioxus-config-macros", + "dioxus-core", + "dioxus-core-macro", + "dioxus-devtools", + "dioxus-document", + "dioxus-fullstack", + "dioxus-history", + "dioxus-hooks", + "dioxus-html", + "dioxus-liveview", + "dioxus-logger", + "dioxus-router", + "dioxus-server", + "dioxus-signals", + "dioxus-ssr", + "dioxus-web", + "dioxus_server_macro", + "manganis", + "serde", + "subsecond", + "warnings", +] + +[[package]] +name = "dioxus-cli-config" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd0ba83fe297b4509423853acb11bf0ef0dffa8c603b0857d8fd07d0da5107c" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "dioxus-config-macro" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae2a00b035ae2ae642e6478c88b409b67380decafa65a8dca02532727e7a0df1" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "dioxus-config-macros" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a6eb3a96b6c47a8d545fe4ee5834b1d6e9a487c63820f03764e032a5d84168d" + +[[package]] +name = "dioxus-core" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0a6891a06145a8c7e27892f7532efafd3e0e5e0fe3dd156ce87067bb0040aab" +dependencies = [ + "const_format", + "dioxus-core-types", + "futures-channel", + "futures-util", + "generational-box", + "longest-increasing-subsequence", + "rustc-hash 2.1.1", + "rustversion", + "serde", + "slab", + "slotmap", + "subsecond", + "tracing", + "warnings", +] + +[[package]] +name = "dioxus-core-macro" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290380a40d10f1307127d29ba4108ab2225994cbc65fd7b8a744612a4c89ca4d" +dependencies = [ + "convert_case 0.8.0", + "dioxus-rsx", + "proc-macro2", + "quote", + "syn 2.0.102", +] + +[[package]] +name = "dioxus-core-types" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aaf7456e7733e3fc014f0f860680f5b0b8f4a7a70ae31143f99b1ef74b6c9ba2" + +[[package]] +name = "dioxus-devtools" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "694419010472aa7a9787cb3a299aecc0a6c08eb5c277e9f51a4520a669b2ba46" +dependencies = [ + "dioxus-cli-config", + "dioxus-core", + "dioxus-devtools-types", + "dioxus-signals", + "serde", + "serde_json", + "subsecond", + "thiserror 2.0.12", + "tracing", + "tungstenite", + "warnings", +] + +[[package]] +name = "dioxus-devtools-types" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7da8e3e136b6714ce769d4cf3e1c27d29fc0da3818042fad85a21aef2f3268d" +dependencies = [ + "dioxus-core", + "serde", + "subsecond-types", +] + +[[package]] +name = "dioxus-document" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65ec8f0bcefd8f32137926d374ce69186f7d16738755c953bfb4f65ac89cd626" +dependencies = [ + "dioxus-core", + "dioxus-core-macro", + "dioxus-core-types", + "dioxus-html", + "futures-channel", + "futures-util", + "generational-box", + "lazy-js-bundle", + "serde", + "serde_json", + "tracing", +] + +[[package]] +name = "dioxus-fullstack" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "842227bfc32181a12de004391132edf4fb61001b51f687d0ff7341a9e419dfd3" +dependencies = [ + "base64 0.22.1", + "bytes", + "ciborium", + "dioxus-devtools", + "dioxus-fullstack-hooks", + "dioxus-fullstack-protocol", + "dioxus-history", + "dioxus-interpreter-js", + "dioxus-lib", + "dioxus-server", + "dioxus-web", + "dioxus_server_macro", + "futures-channel", + "futures-util", + "generational-box", + "serde", + "server_fn", + "tracing", + "web-sys", +] + +[[package]] +name = "dioxus-fullstack-hooks" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d1694fa48012fdab114009deb441afb5512b0b65b698885dbbfd70da803aa28" +dependencies = [ + "dioxus-core", + "dioxus-fullstack-protocol", + "dioxus-hooks", + "dioxus-signals", + "futures-channel", + "serde", +] + +[[package]] +name = "dioxus-fullstack-protocol" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f1d8c702ea8db6f32c63807b2e459e842994d5b05c309a985a9f7b75475d402" +dependencies = [ + "base64 0.22.1", + "ciborium", + "dioxus-core", + "serde", + "tracing", +] + +[[package]] +name = "dioxus-history" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4240c58bba920939ae00d7fc294574e35745ff83d4d1fd61d8880bfe855a3453" +dependencies = [ + "dioxus-core", + "tracing", +] + +[[package]] +name = "dioxus-hooks" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a86b02026d420f915ceb914594845fe81b8f7b4a267713799cc06b3932e83b77" +dependencies = [ + "dioxus-core", + "dioxus-signals", + "futures-channel", + "futures-util", + "generational-box", + "rustversion", + "slab", + "tracing", + "warnings", +] + +[[package]] +name = "dioxus-html" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49e4ab5a2b5e6729324cb77032ff48a17e7840ef4a6d5e5108e16cac165056c9" +dependencies = [ + "async-trait", + "dioxus-core", + "dioxus-core-macro", + "dioxus-core-types", + "dioxus-hooks", + "dioxus-html-internal-macro", + "enumset", + "euclid", + "futures-channel", + "generational-box", + "keyboard-types", + "lazy-js-bundle", + "rustversion", + "serde", + "serde_json", + "serde_repr", + "tracing", +] + +[[package]] +name = "dioxus-html-internal-macro" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f09ed5fc11ab17e92a81bae6c1dd82e298c99a5dd102f724f81db032e6be88a" +dependencies = [ + "convert_case 0.8.0", + "proc-macro2", + "quote", + "syn 2.0.102", +] + +[[package]] +name = "dioxus-interpreter-js" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eacd9c9dee088b853f2f59328c2f2df3e355c97fe4ce09f2c81098f1cd8227aa" +dependencies = [ + "dioxus-core", + "dioxus-core-types", + "dioxus-html", + "js-sys", + "lazy-js-bundle", + "rustc-hash 2.1.1", + "sledgehammer_bindgen", + "sledgehammer_utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "dioxus-isrg" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c48797d750ea11d8cbf98866d83c33b168c4a011825472804d701d8191267c" +dependencies = [ + "chrono", + "http 1.3.1", + "lru", + "rustc-hash 2.1.1", + "thiserror 2.0.12", + "tracing", + "walkdir", +] + +[[package]] +name = "dioxus-lib" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdacc1741667f204d89739c074147bad582f18bb96603bed126808ec33b7035b" +dependencies = [ + "dioxus-config-macro", + "dioxus-core", + "dioxus-core-macro", + "dioxus-document", + "dioxus-history", + "dioxus-hooks", + "dioxus-html", + "dioxus-rsx", + "dioxus-signals", + "warnings", +] + +[[package]] +name = "dioxus-liveview" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d12add6855f20325d040d3e473de5ef65599567e7a83dd73d11ca924caea05ab" +dependencies = [ + "axum", + "dioxus-cli-config", + "dioxus-core", + "dioxus-devtools", + "dioxus-document", + "dioxus-history", + "dioxus-html", + "dioxus-interpreter-js", + "futures-channel", + "futures-util", + "generational-box", + "rustc-hash 2.1.1", + "serde", + "serde_json", + "slab", + "thiserror 2.0.12", + "tokio", + "tokio-stream", + "tokio-util", + "tracing", +] + +[[package]] +name = "dioxus-logger" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b82355cfe2cbb81c291dc359a147f83ff8111029ee1d358ecb83a57879a682" +dependencies = [ + "console_error_panic_hook", + "dioxus-cli-config", + "tracing", + "tracing-subscriber", + "tracing-wasm", +] + +[[package]] +name = "dioxus-router" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94a82adaca52f999b2ec47136ed6fe5553296bc303dd11cf34317279f9bfe96d" +dependencies = [ + "dioxus-cli-config", + "dioxus-fullstack-hooks", + "dioxus-history", + "dioxus-lib", + "dioxus-router-macro", + "rustversion", + "tracing", + "url", + "urlencoding", +] + +[[package]] +name = "dioxus-router-macro" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc83471625df158a33951ba40151cde293ccf809647176f117cda919b19dc63" +dependencies = [ + "base16", + "digest", + "proc-macro2", + "quote", + "sha2", + "slab", + "syn 2.0.102", +] + +[[package]] +name = "dioxus-rsx" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa484933775a33aaf1a7772a3f2ee18699cb84856bf8147ee4e2100e264a8de" +dependencies = [ + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn 2.0.102", +] + +[[package]] +name = "dioxus-server" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71a758597f789e1d7e50d75b333703d553c25d52bbdd0e4adb8ed93de68072e4" +dependencies = [ + "async-trait", + "axum", + "base64 0.22.1", + "bytes", + "ciborium", + "dashmap", + "dioxus-cli-config", + "dioxus-devtools", + "dioxus-fullstack-hooks", + "dioxus-fullstack-protocol", + "dioxus-history", + "dioxus-interpreter-js", + "dioxus-isrg", + "dioxus-lib", + "dioxus-router", + "dioxus-ssr", + "enumset", + "futures-channel", + "futures-util", + "generational-box", + "http 1.3.1", + "hyper", + "hyper-util", + "inventory", + "parking_lot", + "pin-project", + "serde", + "server_fn", + "subsecond", + "thiserror 2.0.12", + "tokio", + "tokio-util", + "tower", + "tower-http", + "tower-layer", + "tracing", + "tracing-futures", + "web-sys", +] + +[[package]] +name = "dioxus-signals" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87aac5473b2a6a78fa0d386276f42e313df10ef5c297b33bdb2d962404161750" +dependencies = [ + "dioxus-core", + "futures-channel", + "futures-util", + "generational-box", + "parking_lot", + "rustc-hash 2.1.1", + "tracing", + "warnings", +] + +[[package]] +name = "dioxus-ssr" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000b0dfd46f7968411bbb0c756baac9bcebdc16a10a48176f8013874fd7e4b1c" +dependencies = [ + "askama_escape", + "dioxus-core", + "dioxus-core-types", + "rustc-hash 2.1.1", +] + +[[package]] +name = "dioxus-web" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0ca9db9abf6460c3d7eb3a658a87522d1ebcb6b76517dea46c1ecda26073df1" +dependencies = [ + "async-trait", + "dioxus-cli-config", + "dioxus-core", + "dioxus-core-types", + "dioxus-devtools", + "dioxus-document", + "dioxus-fullstack-protocol", + "dioxus-history", + "dioxus-html", + "dioxus-interpreter-js", + "dioxus-signals", + "futures-channel", + "futures-util", + "generational-box", + "gloo-timers", + "js-sys", + "lazy-js-bundle", + "rustc-hash 2.1.1", + "serde", + "serde-wasm-bindgen", + "serde_json", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "dioxus_server_macro" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bec2a53a829cc521eb13be250cf509e1fd9bdcc77e73621631fc1df7d4320ee" +dependencies = [ + "proc-macro2", + "quote", + "server_fn_macro", + "syn 2.0.102", +] + [[package]] name = "displaydoc" version = "0.2.5" @@ -1339,6 +1938,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "669a445ee724c5c69b1b06fe0b63e70a1c84bc9bb7d9696cd4f4e3ec45050408" +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "dyn-clone" version = "1.0.19" @@ -1432,6 +2037,27 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enumset" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11a6b7c3d347de0a9f7bfd2f853be43fe32fa6fac30c70f6d6d67a1e936b87ee" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6da3ea9e1d1a3b1593e15781f930120e72aa7501610b2f82e5b6739c72e8eac5" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.102", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -1465,6 +2091,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "euclid" +version = "0.22.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9cdb4b747e485a12abb0e6566612956c7a1bafa3bdb8d682c5b6d403589e48" +dependencies = [ + "num-traits", + "serde", +] + [[package]] name = "event-listener" version = "5.4.0" @@ -1673,6 +2309,16 @@ dependencies = [ "slab", ] +[[package]] +name = "generational-box" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b653b09dec5836ba2dcbfafcc9cdf4afedec51e89beccb908a588cb8fbb4863" +dependencies = [ + "parking_lot", + "tracing", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1754,6 +2400,18 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-timers" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "gloo-utils" version = "0.2.0" @@ -1803,6 +2461,35 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9421a676d1b147b16b82c9225157dc629087ef8ec4d5e2960f9437a90dac0a5" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.3.1", + "indexmap 2.9.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "half" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" +dependencies = [ + "cfg-if", + "crunchy", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -1992,6 +2679,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", + "h2 0.4.10", "http 1.3.1", "http-body", "httparse", @@ -2326,12 +3014,28 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "keyboard-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" +dependencies = [ + "bitflags", + "serde", +] + [[package]] name = "language-tags" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" +[[package]] +name = "lazy-js-bundle" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8850861face330a936e9641c991b5342dcbafd1a04a963c3373470c649280683" + [[package]] name = "lazy_static" version = "1.5.0" @@ -2364,7 +3068,7 @@ dependencies = [ "paste", "rand 0.8.5", "reactive_graph", - "rustc-hash", + "rustc-hash 2.1.1", "rustc_version", "send_wrapper", "serde", @@ -2596,6 +3300,16 @@ version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.52.6", +] + [[package]] name = "libm" version = "0.2.15" @@ -2628,6 +3342,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfae20f6b19ad527b550c223fddc3077a547fc70cda94b9b566575423fd303ee" +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + [[package]] name = "linux-raw-sys" version = "0.9.4" @@ -2674,12 +3394,75 @@ version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +[[package]] +name = "longest-increasing-subsequence" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3bd0dd2cd90571056fdb71f6275fada10131182f84899f4b2a916e565d81d86" + +[[package]] +name = "lru" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "227748d55f2f0ab4735d87fd623798cb6b664512fe979705f829c9f81c934465" +dependencies = [ + "hashbrown 0.15.4", +] + [[package]] name = "lru-slab" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" +[[package]] +name = "macro-string" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.102", +] + +[[package]] +name = "manganis" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afbe7fddc1d241b2a57faeb8c05d1d990271fda611c73aa6fcfd14980b25b236" +dependencies = [ + "const-serialize", + "manganis-core", + "manganis-macro", +] + +[[package]] +name = "manganis-core" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd68739c52db6f6746daa916e3f36191e77094ac6c1846d4685ace518f983556" +dependencies = [ + "const-serialize", + "dioxus-cli-config", + "dioxus-core-types", + "serde", +] + +[[package]] +name = "manganis-macro" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99518ce3c69ba9665b600579bd4ba33d67451df8bf8008652c8421100d87fa88" +dependencies = [ + "dunce", + "macro-string", + "manganis-core", + "proc-macro2", + "quote", + "syn 2.0.102", +] + [[package]] name = "manyhow" version = "0.11.4" @@ -2734,6 +3517,24 @@ version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix 0.38.44", +] + +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + [[package]] name = "mime" version = "0.3.17" @@ -3285,13 +4086,37 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.3.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" dependencies = [ + "toml_datetime", "toml_edit", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -3374,11 +4199,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "626214629cda6781b6dc1d316ba307189c85ba657213ce642d9c77670f8202c8" dependencies = [ "bytes", - "cfg_aliases", + "cfg_aliases 0.2.1", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash", + "rustc-hash 2.1.1", "rustls", "socket2", "thiserror 2.0.12", @@ -3398,7 +4223,7 @@ dependencies = [ "lru-slab", "rand 0.9.1", "ring", - "rustc-hash", + "rustc-hash 2.1.1", "rustls", "rustls-pki-types", "slab", @@ -3414,7 +4239,7 @@ version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcebb1209ee276352ef14ff8732e24cc2b02bbac986cd74a4c81bcb2f9881970" dependencies = [ - "cfg_aliases", + "cfg_aliases 0.2.1", "libc", "once_cell", "socket2", @@ -3537,7 +4362,7 @@ dependencies = [ "hydration_context", "or_poisoned", "pin-project-lite", - "rustc-hash", + "rustc-hash 2.1.1", "rustc_version", "send_wrapper", "serde", @@ -3559,7 +4384,7 @@ dependencies = [ "paste", "reactive_graph", "reactive_stores_macro", - "rustc-hash", + "rustc-hash 2.1.1", "send_wrapper", ] @@ -3673,6 +4498,7 @@ dependencies = [ "base64 0.22.1", "bytes", "futures-core", + "futures-util", "http 1.3.1", "http-body", "http-body-util", @@ -3682,6 +4508,7 @@ dependencies = [ "hyper-util", "js-sys", "log", + "mime_guess", "native-tls", "percent-encoding", "pin-project-lite", @@ -3695,12 +4522,14 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls", + "tokio-util", "tower", "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", "webpki-roots", ] @@ -3789,7 +4618,7 @@ dependencies = [ "proc-macro2-diagnostics", "quote", "syn 2.0.102", - "syn_derive", + "syn_derive 0.2.0", "thiserror 2.0.12", ] @@ -3849,6 +4678,12 @@ version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hash" version = "2.1.1" @@ -3864,6 +4699,19 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + [[package]] name = "rustix" version = "1.0.7" @@ -3873,7 +4721,7 @@ dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.9.4", "windows-sys 0.59.0", ] @@ -4208,6 +5056,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_derive" version = "1.0.219" @@ -4261,6 +5120,17 @@ dependencies = [ "thiserror 2.0.12", ] +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.102", +] + [[package]] name = "serde_spanned" version = "0.6.9" @@ -4336,6 +5206,7 @@ dependencies = [ "js-sys", "once_cell", "pin-project-lite", + "reqwest", "rustc_version", "rustversion", "send_wrapper", @@ -4346,6 +5217,7 @@ dependencies = [ "thiserror 2.0.12", "throw_error", "tokio", + "tokio-tungstenite", "tower", "tower-layer", "url", @@ -4462,6 +5334,17 @@ dependencies = [ name = "shield-diesel" version = "0.0.4" +[[package]] +name = "shield-dioxus" +version = "0.0.4" + +[[package]] +name = "shield-dioxus-axum" +version = "0.0.4" +dependencies = [ + "shield-axum", +] + [[package]] name = "shield-email" version = "0.0.4" @@ -4484,6 +5367,21 @@ dependencies = [ "utoipa-swagger-ui", ] +[[package]] +name = "shield-examples-diouxs-axum" +version = "0.0.4" +dependencies = [ + "axum", + "dioxus", + "shield", + "shield-dioxus-axum", + "shield-memory", + "shield-oidc", + "tokio", + "tower-sessions", + "tracing", +] + [[package]] name = "shield-examples-leptos-actix" version = "0.0.4" @@ -4700,12 +5598,42 @@ dependencies = [ "autocfg", ] +[[package]] +name = "sledgehammer_bindgen" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49e83e178d176459c92bc129cfd0958afac3ced925471b889b3a75546cfc4133" +dependencies = [ + "sledgehammer_bindgen_macro", + "wasm-bindgen", +] + +[[package]] +name = "sledgehammer_bindgen_macro" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f62f06db0370222f7f498ef478fce9f8df5828848d1d3517e3331936d7074f55" +dependencies = [ + "quote", + "syn 2.0.102", +] + +[[package]] +name = "sledgehammer_utils" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "debdd4b83524961983cea3c55383b3910fd2f24fd13a188f5b091d2d504a61ae" +dependencies = [ + "rustc-hash 1.1.0", +] + [[package]] name = "slotmap" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" dependencies = [ + "serde", "version_check", ] @@ -4990,6 +5918,34 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +[[package]] +name = "subsecond" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43c5b40acd555d02d9a0b5bf4080dbf2cd085d5e2eb2ae7851cb14b9bf5af15c" +dependencies = [ + "js-sys", + "libc", + "libloading", + "memfd", + "memmap2", + "serde", + "subsecond-types", + "thiserror 2.0.12", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "subsecond-types" +version = "0.7.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bedadae58a56e137ac970c38c44bff38cee24400fef64c37d5a188a065b1ec1f" +dependencies = [ + "serde", +] + [[package]] name = "subtle" version = "2.6.1" @@ -5018,6 +5974,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.102", +] + [[package]] name = "syn_derive" version = "0.2.0" @@ -5076,7 +6044,7 @@ dependencies = [ "paste", "reactive_graph", "reactive_stores", - "rustc-hash", + "rustc-hash 2.1.1", "rustc_version", "send_wrapper", "slotmap", @@ -5100,7 +6068,7 @@ dependencies = [ "fastrand", "getrandom 0.3.3", "once_cell", - "rustix", + "rustix 1.0.7", "windows-sys 0.59.0", ] @@ -5299,15 +6267,17 @@ dependencies = [ "bytes", "futures-core", "futures-sink", + "futures-util", + "hashbrown 0.15.4", "pin-project-lite", "tokio", ] [[package]] name = "toml" -version = "0.8.23" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" dependencies = [ "serde", "serde_spanned", @@ -5317,24 +6287,24 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.11" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.27" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -5493,6 +6463,16 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-log" version = "0.2.0" @@ -5522,6 +6502,17 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "tracing-wasm" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4575c663a174420fa2d78f4108ff68f65bf2fbb7dd89f33749b6e826b3626e07" +dependencies = [ + "tracing", + "tracing-subscriber", + "wasm-bindgen", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -5644,6 +6635,12 @@ dependencies = [ "serde", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "utf-8" version = "0.7.6" @@ -5773,6 +6770,28 @@ dependencies = [ "try-lock", ] +[[package]] +name = "warnings" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64f68998838dab65727c9b30465595c6f7c953313559371ca8bf31759b3680ad" +dependencies = [ + "pin-project", + "tracing", + "warnings-macro", +] + +[[package]] +name = "warnings-macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59195a1db0e95b920366d949ba5e0d3fc0e70b67c09be15ce5abb790106b0571" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.102", +] + [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" @@ -6166,6 +7185,15 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + [[package]] name = "winnow" version = "0.7.11" diff --git a/Cargo.toml b/Cargo.toml index 3311f55..f93fe02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ axum = "0.8.1" bon = "3.3.2" chrono = "0.4.39" console_error_panic_hook = "0.1.2" +dioxus = "0.7.0-alpha.1" futures = "0.3.31" http = "1.2.0" leptos = "0.8.0-beta" @@ -37,6 +38,8 @@ shield-actix = { path = "./packages/integrations/shield-actix", version = "0.0.4 shield-axum = { path = "./packages/integrations/shield-axum", version = "0.0.4" } shield-credentials = { path = "./packages/methods/shield-credentials", version = "0.0.4" } shield-diesel = { path = "./packages/storage/shield-diesel", version = "0.0.4" } +shield-dioxus = { path = "./packages/integrations/shield-dioxus", version = "0.0.4" } +shield-dioxus-axum = { path = "./packages/integrations/shield-dioxus-axum", version = "0.0.4" } shield-email = { path = "./packages/methods/shield-email", version = "0.0.4" } shield-leptos = { path = "./packages/integrations/shield-leptos", version = "0.0.4" } shield-leptos-actix = { path = "./packages/integrations/shield-leptos-actix", version = "0.0.4" } @@ -59,3 +62,15 @@ utoipa = { version = "5.3.1", features = ["chrono", "uuid"] } uuid = "1.11.0" wasm-bindgen = "0.2.100" wasm-tracing = "2.0.0" + +[profile] + +[profile.wasm-dev] +inherits = "dev" +opt-level = 1 + +[profile.server-dev] +inherits = "dev" + +[profile.android-dev] +inherits = "dev" diff --git a/deny.toml b/deny.toml index 21833e2..a346525 100644 --- a/deny.toml +++ b/deny.toml @@ -17,6 +17,7 @@ allow = [ "Apache-2.0", "BSD-3-Clause", "BSL-1.0", + "CC0-1.0", "CDLA-Permissive-2.0", "ISC", "MIT", diff --git a/examples/dioxus-axum/Cargo.toml b/examples/dioxus-axum/Cargo.toml new file mode 100644 index 0000000..b2892d6 --- /dev/null +++ b/examples/dioxus-axum/Cargo.toml @@ -0,0 +1,38 @@ +[package] +name = "shield-examples-diouxs-axum" +description = "Example with Dioxus and Axum." +publish = false + +authors.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +version.workspace = true + +[features] +default = ["server"] +# TODO: Enabling these triggers multiple RustSec advisories. +# desktop = ["dioxus/desktop"] +# mobile = ["dioxus/mobile"] +server = [ + "dep:axum", + "dep:shield-dioxus-axum", + "dep:shield-memory", + "dep:shield-oidc", + "dep:tokio", + "dep:tower-sessions", + "dioxus/server", + "shield-memory/method-oidc", +] +web = ["dioxus/web"] + +[dependencies] +axum = { workspace = true, optional = true } +dioxus = { workspace = true, features = ["router", "fullstack"] } +shield.workspace = true +shield-dioxus-axum = { workspace = true, optional = true } +shield-memory = { workspace = true, optional = true } +shield-oidc = { workspace = true, features = ["native-tls"], optional = true } +tokio = { workspace = true, features = ["rt-multi-thread"], optional = true } +tower-sessions = { workspace = true, optional = true } +tracing.workspace = true diff --git a/examples/dioxus-axum/Dioxus.toml b/examples/dioxus-axum/Dioxus.toml new file mode 100644 index 0000000..3757598 --- /dev/null +++ b/examples/dioxus-axum/Dioxus.toml @@ -0,0 +1,11 @@ +[application] + +[web.app] +title = "Shield Dioxus Axum Example" + +[web.resource] +style = [] +script = [] + +[web.resource.dev] +script = [] diff --git a/examples/dioxus-axum/clippy.toml b/examples/dioxus-axum/clippy.toml new file mode 100644 index 0000000..40456af --- /dev/null +++ b/examples/dioxus-axum/clippy.toml @@ -0,0 +1,8 @@ +await-holding-invalid-types = [ + "generational_box::GenerationalRef", + { path = "generational_box::GenerationalRef", reason = "Reads should not be held over an await point. This will cause any writes to fail while the await is pending since the read borrow is still active." }, + "generational_box::GenerationalRefMut", + { path = "generational_box::GenerationalRefMut", reason = "Write should not be held over an await point. This will cause any reads or writes to fail while the await is pending since the write borrow is still active." }, + "dioxus_signals::Write", + { path = "dioxus_signals::Write", reason = "Write should not be held over an await point. This will cause any reads or writes to fail while the await is pending since the write borrow is still active." }, +] diff --git a/examples/dioxus-axum/src/app.rs b/examples/dioxus-axum/src/app.rs new file mode 100644 index 0000000..42c969b --- /dev/null +++ b/examples/dioxus-axum/src/app.rs @@ -0,0 +1,19 @@ +use dioxus::prelude::*; + +use crate::home::Home; + +#[derive(Debug, Clone, Routable, PartialEq)] +#[rustfmt::skip] +enum Route { + #[route("/")] + Home {}, +} + +#[component] +pub fn App() -> Element { + rsx! { + main { + Router:: {} + } + } +} diff --git a/examples/dioxus-axum/src/home.rs b/examples/dioxus-axum/src/home.rs new file mode 100644 index 0000000..fd3effe --- /dev/null +++ b/examples/dioxus-axum/src/home.rs @@ -0,0 +1,8 @@ +use dioxus::prelude::*; + +#[component] +pub fn Home() -> Element { + rsx! { + h1 { "Shield Dioxus Axum Example" } + } +} diff --git a/examples/dioxus-axum/src/main.rs b/examples/dioxus-axum/src/main.rs new file mode 100644 index 0000000..b99a94d --- /dev/null +++ b/examples/dioxus-axum/src/main.rs @@ -0,0 +1,72 @@ +mod app; +mod home; + +use crate::app::App; + +#[cfg(not(feature = "server"))] +fn main() { + dioxus::launch(App); +} + +#[cfg(feature = "server")] +#[tokio::main] +async fn main() { + use std::sync::Arc; + + use axum::Router; + use dioxus::{ + cli_config::fullstack_address_or_localhost, + prelude::{DioxusRouterExt, *}, + }; + use shield::{Shield, ShieldOptions}; + use shield_dioxus_axum::ShieldLayer; + use shield_memory::MemoryStorage; + use shield_oidc::{Keycloak, OidcMethod}; + use tokio::net::TcpListener; + use tower_sessions::{Expiry, MemoryStore, SessionManagerLayer, cookie::time::Duration}; + use tracing::{Level, info}; + + // Initialize Dioxus + let addr = fullstack_address_or_localhost(); + dioxus::logger::init(Level::DEBUG).unwrap(); + + // Initialize sessions + let session_store = MemoryStore::default(); + let session_layer = SessionManagerLayer::new(session_store) + .with_secure(false) + .with_expiry(Expiry::OnInactivity(Duration::minutes(10))); + + // Initialize Shield + let storage = MemoryStorage::new(); + let shield = Shield::new( + storage.clone(), + vec![Arc::new( + OidcMethod::new(storage).with_providers([Keycloak::builder( + "keycloak", + "http://localhost:18080/realms/Shield", + "client1", + ) + .client_secret("xcpQsaGbRILTljPtX4npjmYMBjKrariJ") + .redirect_url(format!( + "http://localhost:{}/api/auth/sign-in/callback/oidc/keycloak", + addr.port() + )) + .build()]), + )], + ShieldOptions::default(), + ); + let shield_layer = ShieldLayer::new(shield.clone()); + + // Initialize router + let router = Router::new() + .serve_dioxus_application(ServeConfig::new().unwrap(), App) + .layer(shield_layer) + .layer(session_layer); + + // Start app + info!("listening on http://{}", &addr); + let listener = TcpListener::bind(&addr).await.unwrap(); + axum::serve(listener, router.into_make_service()) + .await + .unwrap(); +} diff --git a/packages/integrations/shield-dioxus-axum/Cargo.toml b/packages/integrations/shield-dioxus-axum/Cargo.toml new file mode 100644 index 0000000..abd80c6 --- /dev/null +++ b/packages/integrations/shield-dioxus-axum/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "shield-dioxus-axum" +description = "Dioxus Axum integration for Shield." + +authors.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +version.workspace = true + +[features] +default = [] +utoipa = ["shield-axum/utoipa"] + +[dependencies] +shield-axum.workspace = true diff --git a/packages/integrations/shield-dioxus-axum/src/lib.rs b/packages/integrations/shield-dioxus-axum/src/lib.rs new file mode 100644 index 0000000..94cc1b6 --- /dev/null +++ b/packages/integrations/shield-dioxus-axum/src/lib.rs @@ -0,0 +1 @@ +pub use shield_axum::*; diff --git a/packages/integrations/shield-dioxus/Cargo.toml b/packages/integrations/shield-dioxus/Cargo.toml new file mode 100644 index 0000000..11450c4 --- /dev/null +++ b/packages/integrations/shield-dioxus/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "shield-dioxus" +description = "Dioxus integration for Shield." + +authors.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +version.workspace = true + +[dependencies] diff --git a/packages/integrations/shield-dioxus/README.md b/packages/integrations/shield-dioxus/README.md new file mode 100644 index 0000000..b27e6b3 --- /dev/null +++ b/packages/integrations/shield-dioxus/README.md @@ -0,0 +1,13 @@ +

Shield Dioxus

+ +[Dioxus](https://dioxuslabs.com/) integration for Shield. + +## Documentation + +See [the Shield book](https://shield.rustforweb.org/) for documentation. + +## Rust for Web + +The Shield project is part of [Rust for Web](https://github.com/RustForWeb). + +[Rust for Web](https://github.com/RustForWeb) creates and ports web libraries for Rust. All projects are free and open source. diff --git a/packages/integrations/shield-dioxus/src/lib.rs b/packages/integrations/shield-dioxus/src/lib.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/packages/integrations/shield-dioxus/src/lib.rs @@ -0,0 +1 @@ +