From 4aea9b8992b08d6d29e78278a864a4c51a6fc3e3 Mon Sep 17 00:00:00 2001 From: 0xZensh Date: Sat, 27 Jul 2024 21:53:11 +0800 Subject: [PATCH] chore: update dependencies --- Cargo.lock | 232 ++++++++++++++++------------ Cargo.toml | 4 +- examples/ai_canister/Cargo.toml | 4 +- src/ic_oss/Cargo.toml | 2 +- src/ic_oss_bucket/Cargo.toml | 4 +- src/ic_oss_bucket/ic_oss_bucket.did | 32 +--- src/ic_oss_bucket/src/api_update.rs | 1 + src/ic_oss_bucket/src/store.rs | 3 +- src/ic_oss_can/Cargo.toml | 2 +- src/ic_oss_cli/Cargo.toml | 4 +- src/ic_oss_cluster/Cargo.toml | 4 +- src/ic_oss_cose/Cargo.toml | 4 +- src/ic_oss_types/src/file.rs | 4 +- src/ic_oss_types/src/lib.rs | 3 +- 14 files changed, 162 insertions(+), 141 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a9eb2a..1722a35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -87,33 +87,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -334,14 +334,14 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "cc" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" +checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" [[package]] name = "cfb" @@ -404,9 +404,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.9" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" +checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" dependencies = [ "clap_builder", "clap_derive", @@ -414,9 +414,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.9" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" +checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" dependencies = [ "anstream", "anstyle", @@ -426,27 +426,27 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.8" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" +checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "concurrent-queue" @@ -481,8 +481,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "coset" -version = "0.3.7" -source = "git+https://github.com/ldclabs/coset.git#5cab9381043000adc52b85f34822b8e446a7066e" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8cc80f631f8307b887faca24dcc3abc427cd0367f6eb6188f6e8f5b7ad8fb" dependencies = [ "ciborium", "ciborium-io", @@ -564,7 +565,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -870,7 +871,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1015,6 +1016,9 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "hmac" @@ -1303,7 +1307,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1317,7 +1321,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1336,9 +1340,9 @@ dependencies = [ [[package]] name = "ic-certification" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20052ce9255fbe2de7041a4f6996fddd095ba1f31ae83b6c0ccdee5be6e7bbcf" +checksum = "e64ee3d8b6e81b51f245716d3e0badb63c283c00f3c9fb5d5219afc30b5bf821" dependencies = [ "hex", "serde", @@ -1348,9 +1352,9 @@ dependencies = [ [[package]] name = "ic-http-certification" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ddb96501529c2380e087fa9f4552fd0d416f5784bb1e48142d746e9b3d6ae13" +checksum = "ff0b97e949845039149dc5e7ea6a7c12ee4333bb402e37bc507904643c7b3e41" dependencies = [ "candid", "http 0.2.12", @@ -1363,7 +1367,7 @@ dependencies = [ [[package]] name = "ic-oss" -version = "0.6.6" +version = "0.7.0" dependencies = [ "bytes", "candid", @@ -1382,7 +1386,7 @@ dependencies = [ [[package]] name = "ic-oss-can" -version = "0.6.6" +version = "0.7.0" dependencies = [ "bytes", "candid", @@ -1396,7 +1400,7 @@ dependencies = [ [[package]] name = "ic-oss-cli" -version = "0.6.6" +version = "0.7.0" dependencies = [ "anyhow", "bytes", @@ -1423,7 +1427,7 @@ dependencies = [ [[package]] name = "ic-oss-cose" -version = "0.6.6" +version = "0.7.0" dependencies = [ "base64 0.21.7", "candid", @@ -1444,7 +1448,7 @@ dependencies = [ [[package]] name = "ic-oss-types" -version = "0.6.6" +version = "0.7.0" dependencies = [ "base64 0.21.7", "candid", @@ -1463,9 +1467,9 @@ dependencies = [ [[package]] name = "ic-representation-independent-hash" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4d9c969c80e9b445255341da79772680f503ef856b95b3ddf162b41d096df1f" +checksum = "08ae59483e377cd9aad94ec339ed1d2583b0d5929cab989328dac2d853b2f570" dependencies = [ "leb128", "sha2 0.10.8", @@ -1517,7 +1521,7 @@ checksum = "8de254dd67bbd58073e23dc1c8553ba12fa1dc610a19de94ad2bbcd0460c067f" [[package]] name = "ic_oss_bucket" -version = "0.6.6" +version = "0.7.0" dependencies = [ "base64 0.21.7", "bytes", @@ -1546,7 +1550,7 @@ dependencies = [ [[package]] name = "ic_oss_cluster" -version = "0.6.6" +version = "0.7.0" dependencies = [ "base64 0.21.7", "bytes", @@ -1578,19 +1582,22 @@ dependencies = [ [[package]] name = "icrc-ledger-types" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c892bf95652101660a25cea10f059f73eb8973f6b04e0349758fda1190447" +checksum = "589f7f6b54df25295dd0ce2722d583c15e2ee7eec9cef58c10b424feb54561b2" dependencies = [ "base32", "candid", "crc32fast", "hex", + "itertools", "num-bigint", "num-traits", "serde", "serde_bytes", "sha2 0.10.8", + "strum", + "time", ] [[package]] @@ -1639,9 +1646,18 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] [[package]] name = "itoa" @@ -1705,6 +1721,12 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -1761,13 +1783,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1820,23 +1843,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", + "libm", ] [[package]] name = "object" -version = "0.36.1" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" dependencies = [ "memchr", ] @@ -1855,9 +1869,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -1876,7 +1890,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1887,9 +1901,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -2005,7 +2019,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2122,14 +2136,13 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" dependencies = [ "libc", "once_cell", "socket2", - "tracing", "windows-sys 0.52.0", ] @@ -2333,14 +2346,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.11" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.5", + "rustls-webpki 0.102.6", "subtle", "zeroize", ] @@ -2382,9 +2395,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.5" +version = "0.102.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" dependencies = [ "ring", "rustls-pki-types", @@ -2497,7 +2510,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2520,7 +2533,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2532,7 +2545,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2681,6 +2694,28 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.72", +] + [[package]] name = "subtle" version = "2.6.1" @@ -2706,9 +2741,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.71" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -2762,22 +2797,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.62" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.62" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2828,32 +2863,31 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2947,7 +2981,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -3056,9 +3090,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "want" @@ -3096,7 +3130,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-shared", ] @@ -3130,7 +3164,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3380,7 +3414,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 9869d7a..ccf9a89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ strip = true opt-level = 's' [workspace.package] -version = "0.6.6" +version = "0.7.0" edition = "2021" repository = "https://github.com/ldclabs/ic-oss" keywords = ["file", "storage", "oss", "s3", "icp"] @@ -52,7 +52,7 @@ num-traits = "0.2" ic-cdk = "0.15" ic-cdk-timers = "0.8" ic-stable-structures = "0.6" -icrc-ledger-types = "0.1" +icrc-ledger-types = "0.1.6" ic-http-certification = { version = "2.5", features = ["serde"] } anyhow = "1" crc32fast = "1.4" diff --git a/examples/ai_canister/Cargo.toml b/examples/ai_canister/Cargo.toml index 77a6f5e..5844ed5 100644 --- a/examples/ai_canister/Cargo.toml +++ b/examples/ai_canister/Cargo.toml @@ -22,5 +22,5 @@ serde = { workspace = true } serde_bytes = { workspace = true } getrandom = { workspace = true } rand = { version = "0.8", features = ["getrandom"] } -ic-oss-types = { path = "../../src/ic_oss_types", version = "0.6" } -ic-oss-can = { path = "../../src/ic_oss_can", version = "0.6" } +ic-oss-types = { path = "../../src/ic_oss_types", version = "0.7" } +ic-oss-can = { path = "../../src/ic_oss_can", version = "0.7" } diff --git a/src/ic_oss/Cargo.toml b/src/ic_oss/Cargo.toml index cc3be42..ea48b3f 100644 --- a/src/ic_oss/Cargo.toml +++ b/src/ic_oss/Cargo.toml @@ -22,4 +22,4 @@ futures-util = { workspace = true } crc32fast = { workspace = true } sha3 = { workspace = true } ic-agent = "0.36" -ic-oss-types = { path = "../ic_oss_types", version = "0.6" } +ic-oss-types = { path = "../ic_oss_types", version = "0.7" } diff --git a/src/ic_oss_bucket/Cargo.toml b/src/ic_oss_bucket/Cargo.toml index d0f9229..2815e3f 100644 --- a/src/ic_oss_bucket/Cargo.toml +++ b/src/ic_oss_bucket/Cargo.toml @@ -36,5 +36,5 @@ icrc-ledger-types = { workspace = true } getrandom = { workspace = true } lazy_static = "1.4" hyperx = { git = "https://github.com/ldclabs/hyperx", rev = "4b9bd373b8c4d29a32e59912bf598ba69273c032" } -ic-oss-types = { path = "../ic_oss_types", version = "0.6" } -ic-oss-cose = { path = "../ic_oss_cose", version = "0.6" } +ic-oss-types = { path = "../ic_oss_types", version = "0.7" } +ic-oss-cose = { path = "../ic_oss_cose", version = "0.7" } diff --git a/src/ic_oss_bucket/ic_oss_bucket.did b/src/ic_oss_bucket/ic_oss_bucket.did index 64c4bad..7c5606d 100644 --- a/src/ic_oss_bucket/ic_oss_bucket.did +++ b/src/ic_oss_bucket/ic_oss_bucket.did @@ -1,15 +1,3 @@ -type BTreeMap = vec record { - text; - variant { - Int : int; - Map : BTreeMap; - Nat : nat; - Nat64 : nat64; - Blob : blob; - Text : text; - Array : vec Value; - }; -}; type BucketInfo = record { status : int8; total_chunks : nat64; @@ -31,9 +19,10 @@ type BucketInfo = record { }; type CanisterArgs = variant { Upgrade : UpgradeArgs; Init : InitArgs }; type CreateFileInput = record { + dek : opt blob; status : opt int8; content : opt blob; - custom : opt vec record { text; Value }; + custom : opt vec record { text; MetadataValue }; hash : opt blob; name : text; crc32 : opt nat32; @@ -44,11 +33,12 @@ type CreateFileInput = record { type CreateFileOutput = record { id : nat32; created_at : nat64 }; type CreateFolderInput = record { name : text; parent : nat32 }; type FileInfo = record { - ex : opt vec record { text; Value }; + ex : opt vec record { text; MetadataValue }; id : nat32; + dek : opt blob; status : int8; updated_at : nat64; - custom : opt vec record { text; Value }; + custom : opt vec record { text; MetadataValue }; hash : opt blob; name : text; size : nat64; @@ -79,6 +69,7 @@ type InitArgs = record { max_folder_depth : nat8; file_id : nat32; }; +type MetadataValue = variant { Int : int; Nat : nat; Blob : blob; Text : text }; type MoveInput = record { id : nat32; to : nat32; from : nat32 }; type Result = variant { Ok; Err : text }; type Result_1 = variant { Ok : vec nat32; Err : text }; @@ -115,7 +106,7 @@ type UpdateFileChunkOutput = record { updated_at : nat64; filled : nat64 }; type UpdateFileInput = record { id : nat32; status : opt int8; - custom : opt vec record { text; Value }; + custom : opt vec record { text; MetadataValue }; hash : opt blob; name : opt text; content_type : opt text; @@ -133,15 +124,6 @@ type UpgradeArgs = record { max_file_size : opt nat64; max_folder_depth : opt nat8; }; -type Value = variant { - Int : int; - Map : BTreeMap; - Nat : nat; - Nat64 : nat64; - Blob : blob; - Text : text; - Array : vec Value; -}; service : (opt CanisterArgs) -> { admin_set_auditors : (vec principal) -> (Result); admin_set_managers : (vec principal) -> (Result); diff --git a/src/ic_oss_bucket/src/api_update.rs b/src/ic_oss_bucket/src/api_update.rs index 71b2a6e..597ff0a 100644 --- a/src/ic_oss_bucket/src/api_update.rs +++ b/src/ic_oss_bucket/src/api_update.rs @@ -50,6 +50,7 @@ fn create_file( content_type: input.content_type, size, hash: input.hash, + dek: input.dek, custom: input.custom, created_at: now_ms, updated_at: now_ms, diff --git a/src/ic_oss_bucket/src/store.rs b/src/ic_oss_bucket/src/store.rs index e1043bd..ec87242 100644 --- a/src/ic_oss_bucket/src/store.rs +++ b/src/ic_oss_bucket/src/store.rs @@ -234,7 +234,7 @@ pub struct FileMetadata { pub chunks: u32, pub status: i8, // -1: archived; 0: readable and writable; 1: readonly pub hash: Option>, // recommend sha3 256 - pub dek: Option>, // Data Encryption Key + pub dek: Option, // // Data Encryption Key that encrypted by BYOK or vetKey in COSE_Encrypt0 pub custom: Option, // custom metadata pub ex: Option, // External Resource, ER indicates that the file is an external resource. } @@ -267,6 +267,7 @@ impl FileMetadata { chunks: self.chunks, status: self.status, hash: self.hash, + dek: self.dek, custom: self.custom, ex: self.ex, } diff --git a/src/ic_oss_can/Cargo.toml b/src/ic_oss_can/Cargo.toml index 28e3a92..5011810 100644 --- a/src/ic_oss_can/Cargo.toml +++ b/src/ic_oss_can/Cargo.toml @@ -17,4 +17,4 @@ serde_bytes = { workspace = true } ciborium = { workspace = true } ic-cdk = { workspace = true } ic-stable-structures = { workspace = true } -ic-oss-types = { path = "../ic_oss_types", version = "0.6" } +ic-oss-types = { path = "../ic_oss_types", version = "0.7" } diff --git a/src/ic_oss_cli/Cargo.toml b/src/ic_oss_cli/Cargo.toml index 0d14964..62358cd 100644 --- a/src/ic_oss_cli/Cargo.toml +++ b/src/ic_oss_cli/Cargo.toml @@ -21,8 +21,8 @@ futures = { workspace = true } futures-util = { workspace = true } crc32fast = { workspace = true } sha3 = { workspace = true } -ic-oss = { path = "../ic_oss", version = "0.6" } -ic-oss-types = { path = "../ic_oss_types", version = "0.6" } +ic-oss = { path = "../ic_oss", version = "0.7" } +ic-oss-types = { path = "../ic_oss_types", version = "0.7" } ic-agent = "0.36" anyhow = "1" clap = { version = "=4.5", features = ["derive"] } diff --git a/src/ic_oss_cluster/Cargo.toml b/src/ic_oss_cluster/Cargo.toml index 03c8b49..b8df4f7 100644 --- a/src/ic_oss_cluster/Cargo.toml +++ b/src/ic_oss_cluster/Cargo.toml @@ -26,5 +26,5 @@ hex = { workspace = true } serde = { workspace = true } serde_bytes = { workspace = true } getrandom = { workspace = true } -ic-oss-types = { path = "../ic_oss_types", version = "0.6" } -ic-oss-cose = { path = "../ic_oss_cose", version = "0.6" } +ic-oss-types = { path = "../ic_oss_types", version = "0.7" } +ic-oss-cose = { path = "../ic_oss_cose", version = "0.7" } diff --git a/src/ic_oss_cose/Cargo.toml b/src/ic_oss_cose/Cargo.toml index 3ce482d..adb340f 100644 --- a/src/ic_oss_cose/Cargo.toml +++ b/src/ic_oss_cose/Cargo.toml @@ -23,5 +23,5 @@ icrc-ledger-types = { workspace = true } k256 = { workspace = true } ed25519-dalek = { workspace = true } sha2 = { workspace = true } -coset = { git = "https://github.com/ldclabs/coset.git", version = "0.3.7-ldc" } -ic-oss-types = { path = "../ic_oss_types", version = "0.6" } +coset = "0.3.8" +ic-oss-types = { path = "../ic_oss_types", version = "0.7" } diff --git a/src/ic_oss_types/src/file.rs b/src/ic_oss_types/src/file.rs index 96f153f..49597fc 100644 --- a/src/ic_oss_types/src/file.rs +++ b/src/ic_oss_types/src/file.rs @@ -24,8 +24,9 @@ pub struct FileInfo { pub chunks: u32, pub status: i8, // -1: archived; 0: readable and writable; 1: readonly pub hash: Option>, + pub dek: Option, // // Data Encryption Key that encrypted by BYOK or vetKey in COSE_Encrypt0 pub custom: Option, // custom metadata - pub ex: Option, // External Resource info + pub ex: Option, // External Resource info } #[derive(CandidType, Clone, Debug, Default, Deserialize, Serialize)] @@ -37,6 +38,7 @@ pub struct CreateFileInput { pub content: Option, // should <= 1024 * 1024 * 2 - 1024 pub status: Option, // when set to 1, the file must be fully filled, and hash must be provided pub hash: Option>, // recommend sha3 256 + pub dek: Option, pub custom: Option, pub crc32: Option, } diff --git a/src/ic_oss_types/src/lib.rs b/src/ic_oss_types/src/lib.rs index d0581c2..52fab28 100644 --- a/src/ic_oss_types/src/lib.rs +++ b/src/ic_oss_types/src/lib.rs @@ -18,7 +18,8 @@ mod bytes; pub use bytes::*; // should update to ICRC3Map -pub type MapValue = BTreeMap; +pub type MapValue = + BTreeMap; pub fn format_error(err: T) -> String where