From 00675738a4012580c6db10d9e1115732559bdaf3 Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Wed, 29 Jan 2025 03:27:31 -0600 Subject: do device code auth --- Cargo.lock | 517 +++++++++++++++++++++++++----------------- Cargo.toml | 3 + ozone-ui/Cargo.toml | 2 + ozone-ui/src/main.rs | 47 +++- src/auth.rs | 23 +- src/auth/device_code.rs | 103 --------- src/auth/oauth.rs | 8 + src/auth/oauth/device_code.rs | 243 ++++++++++++++++++++ src/auth/oauth/refresh.rs | 0 9 files changed, 617 insertions(+), 329 deletions(-) delete mode 100644 src/auth/device_code.rs create mode 100644 src/auth/oauth.rs create mode 100644 src/auth/oauth/device_code.rs create mode 100644 src/auth/oauth/refresh.rs diff --git a/Cargo.lock b/Cargo.lock index f9091a2..cd0fae1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -58,9 +58,9 @@ dependencies = [ "accesskit", "accesskit_consumer", "hashbrown 0.15.2", - "objc2", + "objc2 0.5.2", "objc2-app-kit", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -160,7 +160,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" dependencies = [ "android-properties", - "bitflags 2.6.0", + "bitflags 2.8.0", "cc", "cesu8", "jni", @@ -356,7 +356,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -391,7 +391,7 @@ checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -483,7 +483,7 @@ dependencies = [ "derive_utils", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -519,7 +519,7 @@ version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "cexpr", "clang-sys", "itertools 0.12.1", @@ -532,7 +532,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.93", + "syn 2.0.96", "which", ] @@ -544,9 +544,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "block" @@ -569,7 +569,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" dependencies = [ - "objc2", + "objc2 0.5.2", ] [[package]] @@ -596,9 +596,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "by_address" @@ -623,7 +623,7 @@ checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -671,7 +671,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "cairo-sys-rs", "glib", "libc", @@ -696,7 +696,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "log", "polling", "rustix", @@ -710,7 +710,7 @@ version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10929724661d1c43856fd87c7a127ae944ec55579134fb485e4136fb6a46fdcb" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "polling", "rustix", "slab", @@ -731,9 +731,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.6" +version = "1.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d6dbb628b8f8555f86d0323c2eb39e3ec81901f4b83e091db8a6a76d316a333" +checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" dependencies = [ "jobserver", "libc", @@ -897,7 +897,7 @@ checksum = "5387f5bbc9e9e6c96436ea125afa12614cebf8ac67f49abc08c1e7a891466c90" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -995,7 +995,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "core-foundation 0.10.0", "core-graphics-types 0.2.0", "foreign-types 0.5.0", @@ -1019,7 +1019,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "core-foundation 0.10.0", "libc", ] @@ -1071,7 +1071,7 @@ dependencies = [ "lazy_static", "proc-macro2", "regex", - "syn 2.0.93", + "syn 2.0.96", "unicode-xid", ] @@ -1083,7 +1083,7 @@ checksum = "25fcfea2ee05889597d35e986c2ad0169694320ae5cc8f6d2640a4bb8a884560" dependencies = [ "lazy_static", "proc-macro2", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -1098,14 +1098,14 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] name = "cpufeatures" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -1208,7 +1208,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -1252,7 +1252,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -1265,7 +1265,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -1285,7 +1285,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", "unicode-xid", ] @@ -1297,7 +1297,7 @@ checksum = "ccfae181bab5ab6c5478b2ccb69e4c68a02f8c3ec72f6616bfec9dbc599d2ee0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -1324,7 +1324,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -1354,7 +1354,7 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80bc8c5c6c2941f70a55c15f8d9f00f9710ebda3ffda98075f996a0e6c92756f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "bytemuck", "drm-ffi", "drm-fourcc", @@ -1462,7 +1462,7 @@ checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -1532,7 +1532,7 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36d63bc3ab69493186eefc2568dddc21d2fe5f3c552edc64def6c42297ec9bbd" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "bytemuck", "fnv", "glow 0.15.0", @@ -1659,7 +1659,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -1762,7 +1762,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -1810,7 +1810,7 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa9a106f044fbd21edf2d8cc57300df1e60630e46ed4bebd59cdcbb23cfad1ce" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "drm", "drm-fourcc", "gbm-sys", @@ -1953,6 +1953,18 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + [[package]] name = "gimli" version = "0.31.1" @@ -2008,7 +2020,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "futures-channel", "futures-core", "futures-executor", @@ -2036,7 +2048,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -2085,7 +2097,7 @@ version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03642b8b0cce622392deb0ee3e88511f75df2daac806102597905c3ea1974848" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "cfg_aliases", "cgl", "core-foundation 0.9.4", @@ -2094,9 +2106,9 @@ dependencies = [ "glutin_glx_sys", "glutin_wgl_sys", "libloading", - "objc2", + "objc2 0.5.2", "objc2-app-kit", - "objc2-foundation", + "objc2-foundation 0.2.2", "once_cell", "raw-window-handle", "wayland-sys", @@ -2205,7 +2217,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -2341,15 +2353,15 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" [[package]] name = "hyper" -version = "1.5.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", @@ -2556,7 +2568,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78e779ce58e0fe3977c028e2460e4aaecd65d32bc579d728e89ed3d2d5114e55" dependencies = [ "auto_enums", - "bitflags 2.6.0", + "bitflags 2.8.0", "bytemuck", "cfg-if", "chrono", @@ -2605,7 +2617,7 @@ checksum = "0ec8e1d457e06e12a5fd23a5e841c994b2ce48cecdaee872c008239380189b15" dependencies = [ "quote", "serde_json", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -2656,11 +2668,11 @@ dependencies = [ "i-slint-core", "i-slint-core-macros", "lyon_path", - "objc2", + "objc2 0.5.2", "objc2-app-kit", - "objc2-foundation", - "objc2-metal", - "objc2-quartz-core", + "objc2-foundation 0.2.2", + "objc2-metal 0.2.2", + "objc2-quartz-core 0.2.2", "once_cell", "pin-weak", "raw-window-handle", @@ -2811,7 +2823,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -2908,7 +2920,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbdc09524a91f9cacd26f16734ff63d7dc650daffadd2b6f84d17a285bd875a9" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "input-sys", "libc", "log", @@ -2943,9 +2955,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "itertools" @@ -3039,9 +3051,9 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -3122,7 +3134,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "libc", "redox_syscall 0.5.8", ] @@ -3154,9 +3166,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" @@ -3322,9 +3334,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ "adler2", "simd-adler32", @@ -3352,9 +3364,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" dependencies = [ "libc", "log", @@ -3373,7 +3385,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "jni-sys", "log", "ndk-sys", @@ -3409,7 +3421,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "cfg-if", "cfg_aliases", "libc", @@ -3475,7 +3487,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -3505,6 +3517,7 @@ dependencies = [ "serde", "serde_json", "sha1_smol", + "simple_logger", "sysinfo", "tokio", "tokio-stream", @@ -3552,20 +3565,29 @@ dependencies = [ "objc2-encode", ] +[[package]] +name = "objc2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3531f65190d9cff863b77a99857e74c314dd16bf56c538c4b57c7cbc3f3a6e59" +dependencies = [ + "objc2-encode", +] + [[package]] name = "objc2-app-kit" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", "libc", - "objc2", + "objc2 0.5.2", "objc2-core-data", "objc2-core-image", - "objc2-foundation", - "objc2-quartz-core", + "objc2-foundation 0.2.2", + "objc2-quartz-core 0.2.2", ] [[package]] @@ -3574,11 +3596,11 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", - "objc2", + "objc2 0.5.2", "objc2-core-location", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -3588,8 +3610,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" dependencies = [ "block2", - "objc2", - "objc2-foundation", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -3598,10 +3620,20 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", - "objc2", - "objc2-foundation", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daeaf60f25471d26948a1c2f840e3f7d86f4109e3af4e8e4b5cd70c39690d925" +dependencies = [ + "bitflags 2.8.0", + "objc2 0.6.0", ] [[package]] @@ -3611,9 +3643,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" dependencies = [ "block2", - "objc2", - "objc2-foundation", - "objc2-metal", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-metal 0.2.2", ] [[package]] @@ -3623,9 +3655,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" dependencies = [ "block2", - "objc2", + "objc2 0.5.2", "objc2-contacts", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -3640,11 +3672,22 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", "dispatch", "libc", - "objc2", + "objc2 0.5.2", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a21c6c9014b82c39515db5b396f91645182611c97d24637cf56ac01e5f8d998" +dependencies = [ + "bitflags 2.8.0", + "objc2 0.6.0", + "objc2-core-foundation", ] [[package]] @@ -3654,9 +3697,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" dependencies = [ "block2", - "objc2", + "objc2 0.5.2", "objc2-app-kit", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -3665,10 +3708,21 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", - "objc2", - "objc2-foundation", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-metal" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c41bc8b0e50ea7a5304a56f25e0066f526e99641b46fd7b9ad4421dd35bff6" +dependencies = [ + "bitflags 2.8.0", + "objc2 0.6.0", + "objc2-foundation 0.3.0", ] [[package]] @@ -3677,11 +3731,24 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", - "objc2", - "objc2-foundation", - "objc2-metal", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-metal 0.2.2", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb3794501bb1bee12f08dcad8c61f2a5875791ad1c6f47faa71a0f033f20071" +dependencies = [ + "bitflags 2.8.0", + "objc2 0.6.0", + "objc2-core-foundation", + "objc2-foundation 0.3.0", + "objc2-metal 0.3.0", ] [[package]] @@ -3690,8 +3757,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" dependencies = [ - "objc2", - "objc2-foundation", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -3700,16 +3767,16 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", - "objc2", + "objc2 0.5.2", "objc2-cloud-kit", "objc2-core-data", "objc2-core-image", "objc2-core-location", - "objc2-foundation", + "objc2-foundation 0.2.2", "objc2-link-presentation", - "objc2-quartz-core", + "objc2-quartz-core 0.2.2", "objc2-symbols", "objc2-uniform-type-identifiers", "objc2-user-notifications", @@ -3722,8 +3789,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" dependencies = [ "block2", - "objc2", - "objc2-foundation", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -3732,11 +3799,11 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", - "objc2", + "objc2 0.5.2", "objc2-core-location", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -3745,11 +3812,11 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68bc69301064cebefc6c4c90ce9cba69225239e4b8ff99d445a2b5563797da65" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", - "objc2", + "objc2 0.5.2", "objc2-app-kit", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -3782,11 +3849,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.68" +version = "0.10.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +checksum = "f5e534d133a060a3c19daec1eb3e98ec6f4685978834f2dbadfe2ec215bab64e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "cfg-if", "foreign-types 0.3.2", "libc", @@ -3803,14 +3870,14 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" @@ -3867,9 +3934,11 @@ dependencies = [ name = "ozone-ui" version = "0.1.0" dependencies = [ + "gtk", "reqwest", "simple_logger", "slint", + "winit", "wry", ] @@ -4054,14 +4123,14 @@ checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -4152,12 +4221,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" dependencies = [ "proc-macro2", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -4220,9 +4289,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -4355,13 +4424,14 @@ checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "raw-window-metal" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2000e45d7daa9b6d946e88dfa1d7ae330424a81918a6545741821c989eb80a9" +checksum = "40d213455a5f1dc59214213c7330e074ddf8114c9a42411eb890c767357ce135" dependencies = [ - "objc2", - "objc2-foundation", - "objc2-quartz-core", + "objc2 0.6.0", + "objc2-core-foundation", + "objc2-foundation 0.3.0", + "objc2-quartz-core 0.3.0", ] [[package]] @@ -4399,7 +4469,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", ] [[package]] @@ -4556,14 +4626,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "errno", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys 0.4.15", "windows-sys 0.59.0", ] @@ -4591,9 +4661,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" [[package]] name = "rustls-webpki" @@ -4618,7 +4688,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c85d1ccd519e61834798eb52c4e886e8c2d7d698dd3d6ce0b1b47eb8557f1181" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "bytemuck", "core_maths", "log", @@ -4636,7 +4706,7 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "bytemuck", "core_maths", "log", @@ -4650,9 +4720,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "same-file" @@ -4709,7 +4779,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -4769,14 +4839,14 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] name = "serde_json" -version = "1.0.134" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa 1.0.14", "memchr", @@ -4792,7 +4862,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -4934,7 +5004,7 @@ version = "0.78.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f15700ac678c06649077495acbba07e7ae01e5ca46b7dc18213f2c3477ada71" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "lazy_static", "skia-bindings", "windows 0.58.0", @@ -5002,7 +5072,7 @@ version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "calloop 0.13.0", "calloop-wayland-source", "cursor-icon", @@ -5076,9 +5146,9 @@ dependencies = [ "js-sys", "log", "memmap2", - "objc2", - "objc2-foundation", - "objc2-quartz-core", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-quartz-core 0.2.2", "raw-window-handle", "redox_syscall 0.5.8", "rustix", @@ -5199,7 +5269,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -5231,9 +5301,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.93" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -5257,7 +5327,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -5289,7 +5359,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "core-foundation 0.9.4", "system-configuration-sys", ] @@ -5325,7 +5395,7 @@ checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -5347,12 +5417,13 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" dependencies = [ "cfg-if", "fastrand", + "getrandom 0.3.1", "once_cell", "rustix", "windows-sys 0.59.0", @@ -5416,7 +5487,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -5427,7 +5498,7 @@ checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -5551,7 +5622,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -5651,7 +5722,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.24", + "winnow 0.6.25", ] [[package]] @@ -5701,7 +5772,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -5804,9 +5875,9 @@ checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "unicode-linebreak" @@ -5955,7 +6026,7 @@ checksum = "d8502f961cf2f1359fed21a70f67c831ccb3ab9e4c0b4dd3ad40387fbe8875db" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -5989,36 +6060,46 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.49" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", @@ -6029,9 +6110,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6039,22 +6120,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-streams" @@ -6089,7 +6173,7 @@ version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "rustix", "wayland-backend", "wayland-scanner", @@ -6101,7 +6185,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "cursor-icon", "wayland-backend", ] @@ -6123,7 +6207,7 @@ version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -6135,7 +6219,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b31cab548ee68c7eb155517f2212049dc151f7cd7910c2b66abfd31c3ee12bd" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -6148,7 +6232,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "782e12f6cd923c3c316130d56205ebab53f55d6666b7faddfad36cecaeeb4022" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -6180,9 +6264,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -6264,7 +6348,7 @@ checksum = "1d228f15bba3b9d56dde8bddbee66fa24545bd17b48d5128ccf4a8742b18e431" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -6383,7 +6467,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -6394,7 +6478,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -6405,7 +6489,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -6416,7 +6500,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -6754,7 +6838,7 @@ dependencies = [ "ahash", "android-activity", "atomic-waker", - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", "bytemuck", "calloop 0.13.0", @@ -6768,9 +6852,9 @@ dependencies = [ "libc", "memmap2", "ndk", - "objc2", + "objc2 0.5.2", "objc2-app-kit", - "objc2-foundation", + "objc2-foundation 0.2.2", "objc2-ui-kit", "orbclient", "percent-encoding", @@ -6808,9 +6892,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.24" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" +checksum = "ad699df48212c6cc6eb4435f35500ac6fd3b9913324f938aea302022ce19d310" dependencies = [ "memchr", ] @@ -6824,6 +6908,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.8.0", +] + [[package]] name = "write16" version = "1.0.0" @@ -6857,9 +6950,9 @@ dependencies = [ "kuchikiki", "libc", "ndk", - "objc2", + "objc2 0.5.2", "objc2-app-kit", - "objc2-foundation", + "objc2-foundation 0.2.2", "objc2-ui-kit", "objc2-web-kit", "once_cell", @@ -6938,7 +7031,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys 0.4.15", "rustix", ] @@ -6975,7 +7068,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "dlib", "log", "once_cell", @@ -7020,7 +7113,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", "synstructure", ] @@ -7080,7 +7173,7 @@ checksum = "709ab20fc57cb22af85be7b360239563209258430bccf38d8b979c5a2ae3ecce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", "zbus-lockstep", "zbus_xml", "zvariant", @@ -7095,7 +7188,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", "zvariant_utils", ] @@ -7141,7 +7234,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -7161,7 +7254,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", "synstructure", ] @@ -7190,7 +7283,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] [[package]] @@ -7250,7 +7343,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", "zvariant_utils", ] @@ -7262,5 +7355,5 @@ checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.96", ] diff --git a/Cargo.toml b/Cargo.toml index d4a405c..91a646c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,5 +25,8 @@ uuid = { version = "1.12.1", features = ["v4", "serde"] } walkdir = "2.5.0" zip = { version = "2.2.2", default-features = false, features = ["bzip2", "deflate", "deflate64", "lzma", "xz"] } +[dev-dependencies] +simple_logger = "5.0.0" + [workspace] members = [ "ozone-cli", "ozone-ui" ] diff --git a/ozone-ui/Cargo.toml b/ozone-ui/Cargo.toml index 714496a..e7c7845 100644 --- a/ozone-ui/Cargo.toml +++ b/ozone-ui/Cargo.toml @@ -8,3 +8,5 @@ reqwest = "0.12.12" simple_logger = { version = "5.0.0", features = ["colors"] } slint = { version = "1.9.2", features = ["raw-window-handle-06"] } wry = "0.48.1" +gtk = "0.18.2" +winit = "0.30.8" diff --git a/ozone-ui/src/main.rs b/ozone-ui/src/main.rs index 0d578a1..43a9c42 100644 --- a/ozone-ui/src/main.rs +++ b/ozone-ui/src/main.rs @@ -1,8 +1,13 @@ use std::borrow::Cow; +use std::error::Error; use reqwest::Url; use slint::run_event_loop; +use winit::application::ApplicationHandler; +use winit::event::WindowEvent; +use winit::event_loop::{ActiveEventLoop, ControlFlow, EventLoop}; +use winit::window::{Window, WindowAttributes, WindowId}; use wry::http::{Response, StatusCode}; -use wry::{WebViewBuilder, WebViewBuilderExtWindows}; +use wry::WebViewBuilder; slint::slint! { export component HelloWorld inherits Window { @@ -10,12 +15,39 @@ slint::slint! { } } -fn main() { +struct Application { + window: Option +} + +impl ApplicationHandler for Application { + fn resumed(&mut self, event_loop: &ActiveEventLoop) { + let win = event_loop.create_window(WindowAttributes::default()).unwrap(); + + + win.set_visible(true); + self.window = Some(win); + } + + fn window_event(&mut self, event_loop: &ActiveEventLoop, window_id: WindowId, event: WindowEvent) { + match event { + WindowEvent::CloseRequested => { + event_loop.exit(); + } + WindowEvent::RedrawRequested => { + if let Some(ref window) = self.window { + window.request_redraw(); + } + } + _ => { } + } + } +} + +fn main() -> Result<(), Box> { simple_logger::SimpleLogger::new().env().init().unwrap(); + gtk::init()?; let hw = HelloWorld::new().unwrap(); - hw.show().unwrap(); - let wv = WebViewBuilder::new() .with_url("https://login.live.com/oauth20_authorize.srf?client_id=00000000402b5328&redirect_uri=ms-xal-00000000402b5328://auth&response_type=token&display=touch&scope=service::user.auth.xboxlive.com::MBI_SSL%20offline_access&prompt=select_account") .with_navigation_handler(|url| { @@ -35,7 +67,8 @@ fn main() { } true - }).build(&hw.window().window_handle()).unwrap(); - - run_event_loop().unwrap(); + }).build_as_child(&hw.window().window_handle()).unwrap(); + wv.set_visible(true).unwrap(); + hw.run().unwrap(); + Ok(()) } diff --git a/src/auth.rs b/src/auth.rs index f4522ed..e7d8061 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -1,5 +1,5 @@ mod types; -pub mod device_code; +mod oauth; use std::error::Error; use std::fmt::{Display, Formatter}; @@ -9,12 +9,16 @@ pub use types::*; #[derive(Debug)] pub enum AuthError { Request { what: &'static str, error: reqwest::Error }, + Internal(String), + Timeout } impl Display for AuthError { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { - AuthError::Request { what, error } => write!(f, "auth request error ({}): {}", what, error) + AuthError::Request { what, error } => write!(f, "auth request error ({}): {}", what, error), + AuthError::Internal(msg) => write!(f, "internal auth error: {}", msg), + AuthError::Timeout => f.write_str("interactive authentication timed out") } } } @@ -22,7 +26,8 @@ impl Display for AuthError { impl Error for AuthError { fn source(&self) -> Option<&(dyn Error + 'static)> { match self { - AuthError::Request { error, .. } => Some(error) + AuthError::Request { error, .. } => Some(error), + _ => None } } } @@ -42,14 +47,18 @@ impl MsaUser { #[cfg(test)] mod test { use reqwest::Client; + use crate::auth::oauth::device_code; use super::*; #[tokio::test] async fn abc() { - device_code::DeviceCodeAuthBuilder::new() + simple_logger::SimpleLogger::new().with_colors(true).with_level(log::LevelFilter::Trace).init().unwrap(); + + _=device_code::DeviceCodeAuthBuilder::new() .client_id("00000000402b5328") - .scope("service::user.auth.xboxlive.com::MBI_SSL") - .url("https://login.live.com/oauth20_connect.srf") - .begin(Client::new()).await.unwrap(); + .add_scope("service::user.auth.xboxlive.com::MBI_SSL", true) + .code_request_url("https://login.live.com/oauth20_connect.srf") + .check_url("https://login.live.com/oauth20_token.srf") + .begin(Client::new()).await.unwrap().drive().await; } } diff --git a/src/auth/device_code.rs b/src/auth/device_code.rs deleted file mode 100644 index 087ff27..0000000 --- a/src/auth/device_code.rs +++ /dev/null @@ -1,103 +0,0 @@ -use std::ops::Add; -use std::time::Duration; -use futures::TryFutureExt; -use reqwest::Client; -use serde::{Deserialize, Serialize}; -use tokio::time::{Instant, MissedTickBehavior}; -use super::AuthError; -use crate::util::USER_AGENT; - -pub struct DeviceCodeAuthBuilder { - client_id: Option, - scope: Option, - url: Option -} - -#[derive(Serialize, Debug)] -struct DeviceCodeRequest { - client_id: String, - scope: String, - response_type: String -} - -#[derive(Deserialize, Debug)] -struct DeviceCodeResponse { - device_code: String, - user_code: String, - verification_uri: String, - expires_in: u64, - interval: u64, - message: Option -} - -impl DeviceCodeAuthBuilder { - pub fn new() -> DeviceCodeAuthBuilder { - DeviceCodeAuthBuilder { - client_id: None, - scope: None, - url: None - } - } - - pub fn client_id(mut self, client_id: &str) -> Self { - self.client_id = Some(client_id.to_owned()); - self - } - - pub fn scope(mut self, scope: &str) -> Self { - self.scope = Some(scope.to_owned()); - self - } - - pub fn url(mut self, url: &str) -> Self { - self.url = Some(url.to_owned()); - self - } - - pub async fn begin(self, client: Client) -> Result { - let scope = self.scope.expect("scope is not optional"); - let client_id = self.client_id.expect("client_id is not optional"); - let url = self.url.expect("url is not optional"); - - let device_code: DeviceCodeResponse = client.post(&url) - .header(reqwest::header::USER_AGENT, USER_AGENT) - .header(reqwest::header::ACCEPT, "application/json") - .form(&DeviceCodeRequest { - client_id, - scope, - response_type: "device_code".into() - }) - .send().await - .and_then(|r| r.error_for_status()) - .map_err(|e| AuthError::Request { what: "requesting device code auth", error: e })? - .json().await.map_err(|e| AuthError::Request { what: "receiving device code auth", error: e })?; - - let now = Instant::now(); - Ok(DeviceCodeAuth { - client, - start: now, - interval: Duration::from_secs(device_code.interval + 1), - expire_time: now.add(Duration::from_secs(device_code.expires_in)), - info: dbg!(device_code) - }) - } -} - -pub struct DeviceCodeAuth { - client: Client, - start: Instant, - interval: Duration, - expire_time: Instant, - info: DeviceCodeResponse -} - -impl DeviceCodeAuth { - async fn drive(&self) { - let mut i = tokio::time::interval_at(self.start, self.interval); - i.set_missed_tick_behavior(MissedTickBehavior::Skip); - - while self.expire_time.elapsed().is_zero() { - - } - } -} diff --git a/src/auth/oauth.rs b/src/auth/oauth.rs new file mode 100644 index 0000000..6d4da77 --- /dev/null +++ b/src/auth/oauth.rs @@ -0,0 +1,8 @@ +pub mod device_code; +mod refresh; + +pub struct AccessTokenWithRefresh { + pub access_token: String, + pub refresh_token: Option +} + diff --git a/src/auth/oauth/device_code.rs b/src/auth/oauth/device_code.rs new file mode 100644 index 0000000..4462aa7 --- /dev/null +++ b/src/auth/oauth/device_code.rs @@ -0,0 +1,243 @@ +use std::collections::BTreeSet; +use std::fmt::{Display, Formatter}; +use std::ops::Add; +use std::time::Duration; +use chrono::{DateTime, Utc}; +use log::{debug, trace}; +use reqwest::{Client, StatusCode}; +use serde::{Deserialize, Serialize}; +use tokio::time::{Instant, MissedTickBehavior}; +use crate::auth::AuthError; +use crate::auth::oauth::AccessTokenWithRefresh; +use crate::util::USER_AGENT; + +pub struct DeviceCodeAuthBuilder { + client_id: Option, + scopes: Vec<(String, bool)>, + code_request_url: Option, + check_url: Option +} + +#[derive(Serialize, Debug)] +struct DeviceCodeRequest<'s> { + client_id: &'s str, + scope: &'s str, + + #[serde(skip_serializing_if = "Option::is_none")] + response_type: Option<&'s str> +} + +#[derive(Deserialize, Debug)] +struct DeviceCodeResponse { + device_code: String, + user_code: String, + verification_uri: String, + expires_in: u64, + interval: u64, + message: Option +} + +trait StringJointerton { + fn joinerton(self, sep: char) -> String; +} + +impl StringJointerton for I +where + I: Iterator, + S: AsRef +{ + fn joinerton(self, sep: char) -> String { + self.fold(String::new(), |mut acc, s| { + if !acc.is_empty() { acc.push(sep) } + acc.push_str(s.as_ref()); + acc + }) + } +} + +impl DeviceCodeAuthBuilder { + pub fn new() -> DeviceCodeAuthBuilder { + DeviceCodeAuthBuilder { + client_id: None, + scopes: Vec::new(), + code_request_url: None, + check_url: None + } + } + + pub fn client_id(mut self, client_id: &str) -> Self { + self.client_id = Some(client_id.to_owned()); + self + } + + pub fn add_scope(mut self, scope: &str, required: bool) -> Self { + assert!(!scope.contains(' '), "multiple scopes should be passed using separate calls"); + self.scopes.push((scope.to_owned(), required)); + self + } + + pub fn code_request_url(mut self, url: &str) -> Self { + self.code_request_url = Some(url.to_owned()); + self + } + + pub fn check_url(mut self, url: &str) -> Self { + self.check_url = Some(url.to_owned()); + self + } + + pub async fn begin(self, client: Client) -> Result { + let client_id = self.client_id.expect("client_id is not optional"); + let code_req_url = self.code_request_url.expect("code url is not optional"); + let check_url = self.check_url.expect("check url is not optional"); + + let device_code: DeviceCodeResponse = client.post(&code_req_url) + .header(reqwest::header::USER_AGENT, USER_AGENT) + .header(reqwest::header::ACCEPT, "application/json") + .form(&DeviceCodeRequest { + client_id: client_id.as_str(), + scope: self.scopes.iter().map(|(scope, _)| scope.as_str()).joinerton(' ').as_str(), + response_type: Some("device_code") + }) + .send().await + .and_then(|r| r.error_for_status()) + .map_err(|e| AuthError::Request { what: "requesting device code auth", error: e })? + .json().await.map_err(|e| AuthError::Request { what: "receiving device code auth", error: e })?; + + let now = Instant::now(); + Ok(DeviceCodeAuth { + client, + client_id, + check_url, + scopes: self.scopes.into_iter().map(|(scope, _)| scope).collect(), + start: now, + interval: Duration::from_secs(device_code.interval + 1), + expire_time: now.add(Duration::from_secs(device_code.expires_in)), + info: dbg!(device_code) + }) + } +} + +pub struct DeviceCodeAuth { + client: Client, + client_id: String, + check_url: String, + scopes: Vec, + start: Instant, + interval: Duration, + expire_time: Instant, + info: DeviceCodeResponse +} + +#[derive(Serialize, Debug)] +struct DeviceCodeTokenRequest<'s> { + grant_type: &'s str, + client_id: &'s str, + device_code: &'s str +} + +#[derive(Deserialize, Debug, PartialEq, Eq)] +#[serde(rename_all = "snake_case")] +enum DeviceCodeErrorKind { + AuthorizationPending, + AuthorizationDeclined, + BadVerificationCode, + ExpiredToken, + + #[serde(other)] + Unknown +} + +// https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-device-code#successful-authentication-response +#[derive(Deserialize, Debug)] +#[serde(untagged)] +enum DeviceCodeTokenResponse { + Success { + // idc about token_type (we'll just assume it's always "Bearer" or else we don't know how to handle it) + // idc about expires_in (we are not storing this token for any length of time) + scope: Option, + access_token: String, + refresh_token: Option + }, + Error { + error: DeviceCodeErrorKind, + error_description: Option + } +} + +impl DeviceCodeAuth { + pub fn get_user_code(&self) -> &str { + self.info.user_code.as_str() + } + + pub fn get_user_link(&self) -> &str { + self.info.verification_uri.as_str() + } + + pub fn get_user_message(&self) -> Option<&str> { + self.info.message.as_ref().map(String::as_str) + } + + pub async fn drive(&self) -> Result { + let mut i = tokio::time::interval_at(self.start, self.interval); + i.set_missed_tick_behavior(MissedTickBehavior::Skip); + + let req = DeviceCodeTokenRequest { + grant_type: "urn:ietf:params:oauth:grant-type:device_code", + client_id: self.client_id.as_str(), + device_code: self.info.device_code.as_str() + }; + + while self.expire_time.elapsed().is_zero() { + i.tick().await; + + let res: DeviceCodeTokenResponse = self.client.get(&self.check_url) + .header(reqwest::header::USER_AGENT, USER_AGENT) + .header(reqwest::header::ACCEPT, "application/json") + .form(&req) + .send().await + .map_err(|e| AuthError::Request { what: "device code heartbeat", error: e })? + .json().await.map_err(|e| AuthError::Request { what: "decoding device code response", error: e })?; + + match res { + DeviceCodeTokenResponse::Success { scope, access_token, refresh_token } => { + if let Some(ref scope) = scope { + let scopes_granted = scope.split(' ').collect::>(); + for scope in self.scopes.iter() { + if !scopes_granted.contains(scope.as_str()) { + return Err(AuthError::Internal(format!("not granted required scope: {}", scope))); + } + } + } + + return Ok(AccessTokenWithRefresh { + access_token, + refresh_token + }) + }, + + // the user hasn't done anything yet. continue polling + DeviceCodeTokenResponse::Error { error, .. } if error == DeviceCodeErrorKind::AuthorizationPending => { + debug!("Authorization for device code pending (it has been {:?})...", Instant::now().duration_since(self.start)); + continue; + }, + + // the device code expired :( + DeviceCodeTokenResponse::Error { error, .. } if error == DeviceCodeErrorKind::ExpiredToken => { + debug!("Device auth interaction timeout (1)"); + return Err(AuthError::Timeout); + } + + DeviceCodeTokenResponse::Error { error, error_description } => { + debug!("Authorization for device code error: {:?} ({})", + error, + error_description.as_ref().map(|s| s.as_str()).unwrap_or("no description")); + } + } + } + + debug!("Device auth interaction timeout (2)"); + + Err(AuthError::Timeout) + } +} diff --git a/src/auth/oauth/refresh.rs b/src/auth/oauth/refresh.rs new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3-70-g09d2