diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f95ddd86c8..1ca5ed55fc 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -34,6 +34,10 @@ jobs: target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Install libdbus + if: matrix.os == 'ubuntu-latest' + run: sudo apt-get install libdbus-1-dev + - name: Install musl tools if: matrix.binary_target == 'x86_64-unknown-linux-musl' run: sudo apt-get install musl-tools diff --git a/Cargo.lock b/Cargo.lock index 02b13da88b..90a368b860 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -199,9 +199,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "arboard" @@ -266,7 +266,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "synstructure", ] @@ -278,7 +278,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -323,7 +323,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -345,7 +345,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -356,7 +356,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -690,9 +690,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.20.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] name = "byteorder" @@ -769,7 +769,7 @@ checksum = "45565fc9416b9896014f5732ac776f810ee53a66730c17e4020c3ec064a8f88f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -866,7 +866,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1130,7 +1130,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1178,7 +1178,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1200,7 +1200,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1320,7 +1320,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1340,7 +1340,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core 0.20.2", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1369,7 +1369,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1469,7 +1469,7 @@ checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1777,7 +1777,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2157,9 +2157,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.4" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6884a48c6826ec44f524c7456b163cebe9e55a18d7b5e307cb4f100371cc767" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", "http", @@ -2244,7 +2244,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.90", + "syn 2.0.91", "unic-langid", ] @@ -2258,7 +2258,7 @@ dependencies = [ "i18n-config", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2399,7 +2399,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2476,7 +2476,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2560,9 +2560,12 @@ dependencies = [ [[package]] name = "inventory" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" +checksum = "e5d80fade88dd420ce0d9ab6f7c58ef2272dde38db874657950f827d4982c817" +dependencies = [ + "rustversion", +] [[package]] name = "io-lifetimes" @@ -2691,7 +2694,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5e25f9b861a88faa9d272ca4376e1a13c9a37d36de623f013c7bbb0ae2baa1" dependencies = [ "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2710,7 +2713,7 @@ dependencies = [ "anyhow", "logos", "plist", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -2844,7 +2847,7 @@ dependencies = [ "quote", "regex-syntax 0.8.5", "rustc_version", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3299,9 +3302,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -3516,7 +3519,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3562,9 +3565,9 @@ dependencies = [ [[package]] name = "png" -version = "0.17.15" +version = "0.17.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67582bd5b65bdff614270e2ea89a1cf15bef71245cc1e5f7ea126977144211d" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -3659,7 +3662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3747,7 +3750,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3785,7 +3788,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.90", + "syn 2.0.91", "tempfile", ] @@ -3799,7 +3802,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3922,7 +3925,7 @@ dependencies = [ "rustc-hash 2.1.0", "rustls", "socket2", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tracing", ] @@ -3941,7 +3944,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.8", + "thiserror 2.0.9", "tinyvec", "tracing", "web-time", @@ -4027,9 +4030,9 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54077e1872c46788540de1ea3d7f4ccb1983d12f9aa909b234468676c1a36779" +checksum = "75e669e5202259b5314d1ea5397316ad400819437857b90861765f24c4cf80a2" dependencies = [ "pem", "ring", @@ -4249,7 +4252,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.90", + "syn 2.0.91", "walkdir", ] @@ -4411,7 +4414,7 @@ checksum = "327e9d075f6df7e25fbf594f1be7ef55cf0d567a6cb5112eeccbbd51ceb48e0d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4577,14 +4580,14 @@ checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ "itoa", "memchr", @@ -4639,7 +4642,7 @@ checksum = "aafbefbe175fa9bf03ca83ef89beecff7d2a95aaacd5732325b90ac8c3bd7b90" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4675,9 +4678,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.11.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" dependencies = [ "base64 0.22.1", "chrono", @@ -4693,14 +4696,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.11.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4888,7 +4891,7 @@ dependencies = [ "sos-net", "tempfile", "terminal-banner", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tokio-rustls", "toml 0.8.19", @@ -4899,14 +4902,14 @@ dependencies = [ [[package]] name = "sos-account-extras" -version = "0.16.1" +version = "0.16.2" dependencies = [ "rustc_version", "serde", "serde_json", "serde_with", "sos-sdk", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tracing", ] @@ -4920,7 +4923,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.9", "time", "url", ] @@ -4961,7 +4964,7 @@ dependencies = [ "sos-test-utils", "sos-web", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tracing", "tracing-subscriber", @@ -4993,7 +4996,7 @@ dependencies = [ "sos-platform-authenticator", "sos-protocol", "sos-sdk", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tokio-util", "tower 0.5.2", @@ -5003,7 +5006,7 @@ dependencies = [ [[package]] name = "sos-net" -version = "0.16.1" +version = "0.16.2" dependencies = [ "anyhow", "async-recursion", @@ -5026,7 +5029,7 @@ dependencies = [ "sos-account-extras", "sos-protocol", "sos-sdk", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tokio-util", "tracing", @@ -5046,7 +5049,7 @@ dependencies = [ "rustc_version", "secrecy", "security-framework 3.1.0", - "thiserror 2.0.8", + "thiserror 2.0.9", "tracing", ] @@ -5072,7 +5075,7 @@ dependencies = [ "serde", "serde_json", "sos-sdk", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tokio-tungstenite", "tokio-util", @@ -5136,7 +5139,7 @@ dependencies = [ "sos-vfs", "subtle", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.9", "time", "time-tz", "tokio", @@ -5181,7 +5184,7 @@ dependencies = [ "serde_json", "sos-cli-helpers", "sos-protocol", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tokio-rustls", "tokio-rustls-acme", @@ -5241,7 +5244,7 @@ dependencies = [ "rustc_version", "sos-protocol", "sos-sdk", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tracing", ] @@ -5305,9 +5308,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" dependencies = [ "proc-macro2", "quote", @@ -5331,7 +5334,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -5426,11 +5429,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.8" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" dependencies = [ - "thiserror-impl 2.0.8", + "thiserror-impl 2.0.9", ] [[package]] @@ -5441,18 +5444,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] name = "thiserror-impl" -version = "2.0.8" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -5559,9 +5562,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -5598,7 +5601,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -5632,7 +5635,7 @@ dependencies = [ "rustls", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.9", "time", "tokio", "tokio-rustls", @@ -5860,7 +5863,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -5986,7 +5989,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a615d6c2764852a2e88a4f16e9ce1ea49bb776b5872956309e170d63a042a34f" dependencies = [ "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -6022,9 +6025,9 @@ dependencies = [ [[package]] name = "unicase" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" @@ -6153,7 +6156,7 @@ checksum = "564b03f8044ad6806bdc0d635e88be24967e785eef096df6b2636d2cc1e05d4b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "uuid", ] @@ -6199,7 +6202,7 @@ dependencies = [ "logos", "serde", "serde_with", - "thiserror 2.0.8", + "thiserror 2.0.9", "time", "unicode-segmentation", "uriparse", @@ -6286,7 +6289,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "wasm-bindgen-shared", ] @@ -6321,7 +6324,7 @@ checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6455,7 +6458,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -6466,7 +6469,7 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -6857,7 +6860,7 @@ dependencies = [ "anyhow", "arboard", "rustc_version", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tracing", "zeroize", @@ -6904,7 +6907,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "synstructure", ] @@ -6926,7 +6929,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -6946,7 +6949,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "synstructure", ] @@ -6967,7 +6970,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -6989,7 +6992,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] diff --git a/crates/account_extras/Cargo.toml b/crates/account_extras/Cargo.toml index 27188f6c18..2174266116 100644 --- a/crates/account_extras/Cargo.toml +++ b/crates/account_extras/Cargo.toml @@ -1,12 +1,16 @@ [package] name = "sos-account-extras" -version = "0.16.1" +version = "0.16.2" edition = "2021" description = "Extra features for Save Our Secrets local accounts." homepage = "https://saveoursecrets.com" license = "MIT OR Apache-2.0" repository = "https://github.com/saveoursecrets/sdk" +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [features] preferences = [] security-report = [] diff --git a/crates/ipc/src/extension_helper/server.rs b/crates/ipc/src/extension_helper/server.rs index 05fef5dd8e..62651697b7 100644 --- a/crates/ipc/src/extension_helper/server.rs +++ b/crates/ipc/src/extension_helper/server.rs @@ -60,6 +60,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { #[allow(dead_code)] @@ -84,6 +86,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { /// Create a server. diff --git a/crates/ipc/src/memory_server.rs b/crates/ipc/src/memory_server.rs index 29813b55c5..c7c68e2a76 100644 --- a/crates/ipc/src/memory_server.rs +++ b/crates/ipc/src/memory_server.rs @@ -123,6 +123,8 @@ impl LocalMemoryServer { + ErrorExt + From + From + + Send + + Sync + 'static, { let service = LocalWebService::new(app_info, accounts); diff --git a/crates/ipc/src/web_service/account.rs b/crates/ipc/src/web_service/account.rs index e98a6afa56..f7d802ba0c 100644 --- a/crates/ipc/src/web_service/account.rs +++ b/crates/ipc/src/web_service/account.rs @@ -37,6 +37,8 @@ where + std::error::Error + From + From + + Send + + Sync + 'static, { let accounts = accounts.as_ref().read().await; @@ -64,6 +66,8 @@ where + std::error::Error + From + From + + Send + + Sync + 'static, { let accounts = accounts.as_ref().read().await; @@ -102,6 +106,8 @@ where + std::error::Error + From + From + + Send + + Sync + 'static, { let accounts = accounts.as_ref().read().await; @@ -131,6 +137,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { let Some(account_id) = parse_account_id(&req) else { @@ -171,6 +179,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { use sos_platform_authenticator::{ @@ -222,6 +232,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { use sos_platform_authenticator::keyring_password; @@ -293,6 +305,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { let Some(account_id) = parse_account_id(&req) else { @@ -322,6 +336,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { tracing::debug!("sign_out::all"); @@ -346,6 +362,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { let mut user_accounts = accounts.as_ref().write().await; diff --git a/crates/ipc/src/web_service/mod.rs b/crates/ipc/src/web_service/mod.rs index 9ab65878f8..2271a0ded8 100644 --- a/crates/ipc/src/web_service/mod.rs +++ b/crates/ipc/src/web_service/mod.rs @@ -71,6 +71,8 @@ impl LocalWebService { + ErrorExt + From + From + + Send + + Sync + 'static, { let mut router = Router::new(); @@ -202,22 +204,18 @@ impl LocalWebService { ) .unwrap(); - { - let state = accounts.clone(); - router - .entry(Method::POST) - .or_default() - .insert( - "/signin", - BoxCloneService::new(service_fn( - move |req: Request| { - sign_in(req, state.clone()) - }, - )) - .into(), - ) - .unwrap(); - } + let state = accounts.clone(); + router + .entry(Method::POST) + .or_default() + .insert( + "/signin", + BoxCloneService::new(service_fn( + move |req: Request| sign_in(req, state.clone()), + )) + .into(), + ) + .unwrap(); let state = accounts.clone(); router @@ -234,22 +232,37 @@ impl LocalWebService { ) .unwrap(); - { - let state = accounts.clone(); - router - .entry(Method::GET) - .or_default() - .insert( - "/secret", - BoxCloneService::new(service_fn( - move |req: Request| { - read_secret(req, state.clone()) - }, - )) - .into(), - ) - .unwrap(); - } + let state = accounts.clone(); + router + .entry(Method::GET) + .or_default() + .insert( + "/secret", + BoxCloneService::new(service_fn( + move |req: Request| { + read_secret(req, state.clone()) + }, + )) + .into(), + ) + .unwrap(); + + /* + let state = accounts.clone(); + router + .entry(Method::POST) + .or_default() + .insert( + "/secret/favorite", + BoxCloneService::new(service_fn( + move |req: Request| { + set_favorite(req, state.clone()) + }, + )) + .into(), + ) + .unwrap(); + */ #[cfg(feature = "contacts")] { diff --git a/crates/ipc/src/web_service/search.rs b/crates/ipc/src/web_service/search.rs index 06d125066d..e6d43d4b0c 100644 --- a/crates/ipc/src/web_service/search.rs +++ b/crates/ipc/src/web_service/search.rs @@ -43,6 +43,8 @@ where + std::error::Error + From + From + + Send + + Sync + 'static, { let Ok(request) = parse_json_body::(req).await else { @@ -80,6 +82,8 @@ where + std::error::Error + From + From + + Send + + Sync + 'static, { let Ok(request) = parse_json_body::(req).await else { diff --git a/crates/ipc/src/web_service/secret.rs b/crates/ipc/src/web_service/secret.rs index 4e2735b4d6..87d04ca0f7 100644 --- a/crates/ipc/src/web_service/secret.rs +++ b/crates/ipc/src/web_service/secret.rs @@ -16,6 +16,14 @@ struct CopyRequest { request: Option, } +/* +#[derive(Deserialize)] +struct FavoriteRequest { + target: SecretPath, + value: bool, +} +*/ + /// Copy a secret to the clipboard. #[cfg(feature = "clipboard")] pub async fn copy_secret_clipboard( @@ -35,6 +43,8 @@ where + std::error::Error + From + From + + Send + + Sync + 'static, { use crate::web_service::internal_server_error; @@ -79,6 +89,8 @@ where + std::error::Error + From + From + + Send + + Sync + 'static, { let Some(account_id) = parse_account_id(&req) else { @@ -117,6 +129,85 @@ where } } +/* +/// Set favorite flag. +pub async fn set_favorite( + req: Request, + accounts: WebAccounts, +) -> hyper::Result> +where + A: Account + + SyncStorage + + Merge + + Sync + + Send + + 'static, + R: 'static, + E: std::fmt::Debug + + ErrorExt + + std::error::Error + + From + + From + + Send + + Sync + + 'static, +{ + let Some(account_id) = parse_account_id(&req) else { + return status(StatusCode::BAD_REQUEST); + }; + + let mut accounts = accounts.as_ref().write().await; + let Some(account) = + accounts.iter_mut().find(|a| a.address() == &account_id) + else { + return status(StatusCode::NOT_FOUND); + }; + + let Ok(request) = parse_json_body::(req).await else { + return status(StatusCode::BAD_REQUEST); + }; + + let Some(folder) = + account.find(|f| f.id() == request.target.folder_id()).await + else { + return status(StatusCode::NOT_FOUND); + }; + + let result = account + .read_secret(request.target.secret_id(), Some(folder)) + .await; + match result { + Ok(result) => { + let mut secret_row = result.0; + secret_row.meta_mut().set_favorite(request.value); + + let (id, meta, secret) = secret_row.into(); + if let Err(e) = account + .update_secret( + &id, + meta, + Some(secret), + Default::default(), + None, + ) + .await + { + return internal_server_error(e); + } + + status(StatusCode::OK) + } + Err(e) => { + if e.is_secret_not_found() { + return status(StatusCode::NOT_FOUND); + } + tracing::error!(error = %e, "read_secret"); + internal_server_error(e) + } + } +} +*/ + #[cfg(feature = "contacts")] pub async fn load_avatar( req: Request, @@ -135,6 +226,8 @@ where + std::error::Error + From + From + + Send + + Sync + 'static, { use crate::web_service::text; diff --git a/crates/ipc/src/web_service/web_accounts.rs b/crates/ipc/src/web_service/web_accounts.rs index 5cb2dab8e3..fe71760527 100644 --- a/crates/ipc/src/web_service/web_accounts.rs +++ b/crates/ipc/src/web_service/web_accounts.rs @@ -61,6 +61,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { accounts: Arc>>, @@ -82,6 +84,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { fn clone(&self) -> Self { @@ -107,6 +111,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { /// Create new accounts. @@ -224,6 +230,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { fn as_ref(&self) -> &Arc>> { @@ -249,6 +257,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { let paths = account.paths(); @@ -387,6 +397,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { let account_name = account_id.to_string(); @@ -545,6 +557,8 @@ where + ErrorExt + From + From + + Send + + Sync + 'static, { let storage = account.storage().await.unwrap(); diff --git a/crates/net/Cargo.toml b/crates/net/Cargo.toml index 8238fec331..329f850c10 100644 --- a/crates/net/Cargo.toml +++ b/crates/net/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sos-net" -version = "0.16.1" +version = "0.16.2" edition = "2021" description = "Networking library for the Save Our Secrets SDK." homepage = "https://saveoursecrets.com"