From d3d05c8a8431af373ca939664c9bc8d8b8521523 Mon Sep 17 00:00:00 2001 From: Emmanuel Coste Date: Tue, 10 Dec 2024 15:58:39 +0100 Subject: [PATCH] fix: save cli configuration if login/logout have been called --- Cargo.lock | 232 +++++++++++--------- Cargo.toml | 27 +-- README.md | 2 +- crate/cli/Cargo.toml | 10 +- crate/cli/src/actions/delete_datasets.rs | 2 +- crate/cli/src/actions/encrypt_and_index.rs | 2 +- crate/cli/src/actions/findex.rs | 3 +- crate/cli/src/actions/search_and_decrypt.rs | 29 ++- crate/cli/src/commands.rs | 87 ++++---- crate/cli/src/lib.rs | 1 - crate/gui/Cargo.toml | 6 +- documentation/docs/cli/main_commands.md | 182 ++++++++------- documentation/docs/configuration.md | 2 +- 13 files changed, 290 insertions(+), 295 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b282b99a..aaa459db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,7 +150,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -190,8 +190,8 @@ dependencies = [ "actix-utils", "futures-core", "futures-util", - "mio 1.0.2", - "socket2 0.5.7", + "mio 1.0.3", + "socket2 0.5.8", "tokio", "tracing", ] @@ -254,7 +254,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "smallvec", - "socket2 0.5.7", + "socket2 0.5.8", "time", "url", ] @@ -268,7 +268,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -540,7 +540,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "synstructure", ] @@ -552,7 +552,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -612,7 +612,7 @@ checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ "async-task", "concurrent-queue", - "fastrand 2.2.0", + "fastrand 2.3.0", "futures-lite 2.5.0", "slab", ] @@ -662,7 +662,7 @@ dependencies = [ "futures-lite 2.5.0", "parking", "polling 3.7.4", - "rustix 0.38.40", + "rustix 0.38.42", "slab", "tracing", "windows-sys 0.59.0", @@ -701,7 +701,7 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.40", + "rustix 0.38.42", "windows-sys 0.48.0", ] @@ -713,7 +713,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -728,7 +728,7 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix 0.38.40", + "rustix 0.38.42", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -748,7 +748,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1005,7 +1005,7 @@ checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1016,9 +1016,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "bytestring" @@ -1168,9 +1168,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.21" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", "clap_derive", @@ -1178,9 +1178,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.21" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", @@ -1199,14 +1199,14 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] name = "clap_lex" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "clipboard-win" @@ -1516,7 +1516,7 @@ dependencies = [ [[package]] name = "cosmian_config_utils" version = "0.1.0" -source = "git+https://www.github.com/Cosmian/http_client_server?branch=develop#3e77e49a0f7ed04380ea44f41d72316fceaf50a8" +source = "git+https://www.github.com/Cosmian/http_client_server?branch=develop#732ab49a020f72892332a288c08bdbf4eaa8317f" dependencies = [ "base64 0.21.7", "serde", @@ -1609,7 +1609,7 @@ dependencies = [ [[package]] name = "cosmian_findex_cli" version = "0.1.0" -source = "git+https://www.github.com/Cosmian/findex-server?branch=develop#4b89c2f766f257e7e2f4ee5bbfc8db438e9321d0" +source = "git+https://www.github.com/Cosmian/findex-server?branch=develop#ab00584a00c74606400c920886f5ed60638df29f" dependencies = [ "base64 0.22.1", "clap", @@ -1630,7 +1630,7 @@ dependencies = [ [[package]] name = "cosmian_findex_client" version = "0.1.0" -source = "git+https://www.github.com/Cosmian/findex-server?branch=develop#4b89c2f766f257e7e2f4ee5bbfc8db438e9321d0" +source = "git+https://www.github.com/Cosmian/findex-server?branch=develop#ab00584a00c74606400c920886f5ed60638df29f" dependencies = [ "cloudproof_findex 6.0.2 (git+https://www.github.com/Cosmian/cloudproof_rust?branch=feat%2Fadd_basic_findex_rest_client)", "cosmian_config_utils", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "cosmian_findex_structs" version = "0.1.0" -source = "git+https://www.github.com/Cosmian/findex-server?branch=develop#4b89c2f766f257e7e2f4ee5bbfc8db438e9321d0" +source = "git+https://www.github.com/Cosmian/findex-server?branch=develop#ab00584a00c74606400c920886f5ed60638df29f" dependencies = [ "base64 0.22.1", "cloudproof_findex 6.0.2 (git+https://www.github.com/Cosmian/cloudproof_rust?branch=feat%2Fadd_basic_findex_rest_client)", @@ -1684,7 +1684,7 @@ dependencies = [ [[package]] name = "cosmian_http_client" version = "0.1.0" -source = "git+https://www.github.com/Cosmian/http_client_server?branch=develop#3e77e49a0f7ed04380ea44f41d72316fceaf50a8" +source = "git+https://www.github.com/Cosmian/http_client_server?branch=develop#732ab49a020f72892332a288c08bdbf4eaa8317f" dependencies = [ "actix-web", "derive_more", @@ -1702,37 +1702,29 @@ dependencies = [ [[package]] name = "cosmian_kmip" -version = "4.20.0" -source = "git+https://www.github.com/Cosmian/kms?branch=develop#d72119e774d97e33e8acc86e8c1a019fd9716a11" +version = "4.20.1" +source = "git+https://www.github.com/Cosmian/kms?branch=develop#e07f061bc6ec43caee8b736a2557640a5620a488" dependencies = [ - "aes-gcm-siv", - "argon2", - "base64 0.21.7", "bitflags 2.6.0", "chrono", - "clap", - "cloudproof", "cosmian_logger", "hex", + "leb128", "num-bigint-dig", - "openssl", - "rust-ini", "serde", "serde_json", - "sha3", "strum", "thiserror 2.0.4", "time", "tracing", "uuid", - "x509-parser", "zeroize", ] [[package]] name = "cosmian_kms_access" -version = "4.20.0" -source = "git+https://www.github.com/Cosmian/kms?branch=develop#d72119e774d97e33e8acc86e8c1a019fd9716a11" +version = "4.20.1" +source = "git+https://www.github.com/Cosmian/kms?branch=develop#e07f061bc6ec43caee8b736a2557640a5620a488" dependencies = [ "cosmian_kmip", "serde", @@ -1740,21 +1732,21 @@ dependencies = [ [[package]] name = "cosmian_kms_cli" -version = "4.20.0" -source = "git+https://www.github.com/Cosmian/kms?branch=develop#d72119e774d97e33e8acc86e8c1a019fd9716a11" +version = "4.20.1" +source = "git+https://www.github.com/Cosmian/kms?branch=develop#e07f061bc6ec43caee8b736a2557640a5620a488" dependencies = [ "base64 0.21.7", "clap", "cloudproof", "cosmian_config_utils", "cosmian_kms_client", + "cosmian_kms_crypto", "cosmian_logger", "der", "hex", "jwt-simple", "leb128", "num-format", - "oauth2", "pem", "reqwest", "serde", @@ -1771,8 +1763,8 @@ dependencies = [ [[package]] name = "cosmian_kms_client" -version = "4.20.0" -source = "git+https://www.github.com/Cosmian/kms?branch=develop#d72119e774d97e33e8acc86e8c1a019fd9716a11" +version = "4.20.1" +source = "git+https://www.github.com/Cosmian/kms?branch=develop#e07f061bc6ec43caee8b736a2557640a5620a488" dependencies = [ "cloudproof", "cosmian_config_utils", @@ -1791,10 +1783,33 @@ dependencies = [ "zeroize", ] +[[package]] +name = "cosmian_kms_crypto" +version = "4.20.1" +source = "git+https://www.github.com/Cosmian/kms?branch=develop#e07f061bc6ec43caee8b736a2557640a5620a488" +dependencies = [ + "aes-gcm-siv", + "argon2", + "base64 0.21.7", + "cloudproof", + "cosmian_kmip", + "cosmian_logger", + "hex", + "num-bigint-dig", + "openssl", + "rust-ini", + "serde", + "serde_json", + "thiserror 2.0.4", + "tracing", + "x509-parser", + "zeroize", +] + [[package]] name = "cosmian_logger" version = "0.1.0" -source = "git+https://www.github.com/Cosmian/http_client_server?branch=develop#3e77e49a0f7ed04380ea44f41d72316fceaf50a8" +source = "git+https://www.github.com/Cosmian/http_client_server?branch=develop#732ab49a020f72892332a288c08bdbf4eaa8317f" dependencies = [ "tracing", "tracing-subscriber", @@ -1943,7 +1958,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1988,7 +2003,7 @@ checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -2020,7 +2035,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -2033,7 +2048,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -2068,7 +2083,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -2296,7 +2311,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -2323,12 +2338,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2386,9 +2401,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fdeflate" @@ -2512,7 +2527,7 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ - "fastrand 2.2.0", + "fastrand 2.3.0", "futures-core", "futures-io", "parking", @@ -3115,7 +3130,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3224,9 +3239,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jni" @@ -3361,9 +3376,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.162" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libloading" @@ -3382,7 +3397,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -3558,11 +3573,10 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi 0.3.9", "libc", "log", "wasi", @@ -3803,7 +3817,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4033,7 +4047,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4258,7 +4272,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand 2.2.0", + "fastrand 2.3.0", "futures-io", ] @@ -4345,7 +4359,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.40", + "rustix 0.38.42", "tracing", "windows-sys 0.59.0", ] @@ -4448,9 +4462,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -4743,15 +4757,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.40" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4915,22 +4929,22 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4964,7 +4978,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5125,9 +5139,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -5193,7 +5207,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5228,9 +5242,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -5251,7 +5265,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5301,9 +5315,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", - "fastrand 2.2.0", + "fastrand 2.3.0", "once_cell", - "rustix 0.38.40", + "rustix 0.38.42", "windows-sys 0.59.0", ] @@ -5339,7 +5353,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5350,7 +5364,7 @@ checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5456,7 +5470,7 @@ checksum = "8d9ef545650e79f30233c0003bcc2504d7efac6dad25fca40744de773fe2049c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5468,11 +5482,11 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.2", + "mio 1.0.3", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", + "socket2 0.5.8", "tokio-macros", "windows-sys 0.52.0", ] @@ -5485,7 +5499,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5592,7 +5606,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5677,9 +5691,9 @@ checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-segmentation" @@ -5850,7 +5864,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "wasm-bindgen-shared", ] @@ -5884,7 +5898,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6064,7 +6078,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -6465,7 +6479,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" dependencies = [ "gethostname", - "rustix 0.38.40", + "rustix 0.38.42", "x11rb-protocol", ] @@ -6550,7 +6564,7 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "synstructure", ] @@ -6638,7 +6652,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -6658,7 +6672,7 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "synstructure", ] @@ -6680,7 +6694,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -6702,7 +6716,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 212e1ebe..6a08b18c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,41 +38,18 @@ incremental = false opt-level = 0 [workspace.dependencies] -actix-rt = "2.10" -actix-server = { version = "2.5", default-features = false } -actix-web = { version = "4.9.0", default-features = false } -base64 = "0.21" -chrono = "0.4" clap = { version = "4.5", default-features = false } -cloudproof = "3.0" cosmian_kms_cli = { git = "https://www.github.com/Cosmian/kms", branch = "develop" } cosmian_findex_cli = { git = "https://www.github.com/Cosmian/findex-server", branch = "develop" } cosmian_config_utils = { git = "https://www.github.com/Cosmian/http_client_server", branch = "develop" } cosmian_http_client = { git = "https://www.github.com/Cosmian/http_client_server", branch = "develop" } cosmian_logger = { git = "https://www.github.com/Cosmian/http_client_server", branch = "develop" } -der = { version = "0.7", default-features = false } -env_logger = "0.11" hex = { version = "0.4", default-features = false } -leb128 = "0.2.5" -native-tls = "0.2" -num_cpus = "1.13" -num-bigint-dig = { version = "0.8", default-features = false } openssl = { version = "0.10", default-features = false } -pem = "3.0" -pyo3 = { version = "0.20", default-features = false } -reqwest = { version = "0.11", default-features = false } -rustls = "0.21" serde = "1.0" -serde_json = "1.0" -sha3 = { version = "0.10", default-features = false } -strum = { version = "0.25", default-features = false } thiserror = "1.0" -time = "0.3" -tokio = { version = "1.39", default-features = false } -tracing-subscriber = { version = "0.3", default-features = false } +tokio = { version = "1.42", default-features = false } tracing = "0.1" url = "2.5" -uuid = "1.10" -x509-cert = { version = "0.2.5", default-features = false } +uuid = "1.11" x509-parser = "0.16" -zeroize = { version = "1.8", default-features = false } diff --git a/README.md b/README.md index c359066e..5e1836aa 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ docker run -p 9998:9998 --rm --name kms ghcr.io/cosmian/kms ``` > [!NOTE]: -> The KMS server can also be installed using these [instructions](https://docs.cosmian./key_management_system/installation). +> The KMS server can also be installed using these [instructions](https://docs.cosmian.com/key_management_system/single_server_mode/#quick-start). In the same manner, you can run a Findex server (using Docker image) on `http://localhost:6668`: diff --git a/crate/cli/Cargo.toml b/crate/cli/Cargo.toml index 038a7e9e..962c0480 100644 --- a/crate/cli/Cargo.toml +++ b/crate/cli/Cargo.toml @@ -35,7 +35,7 @@ cosmian_kms_cli = { workspace = true } cosmian_findex_cli = { workspace = true } cosmian_config_utils = { workspace = true } cosmian_logger = { workspace = true } -csv = "1.3.0" +csv = "1.3.1" hex = { workspace = true } thiserror = { workspace = true } serde = { workspace = true } @@ -45,14 +45,14 @@ url = { workspace = true } uuid = { workspace = true } [dev-dependencies] -actix-rt = { workspace = true } -actix-server = { workspace = true } +actix-rt = "2.10" +actix-server = { version = "2.5", default-features = false } assert_cmd = "2.0" const-oid = { version = "0.9", features = ["db"] } openssl = { workspace = true } predicates = "3.1" -regex = { version = "1.10", default-features = false } -tempfile = "3.11" +regex = { version = "1.11", default-features = false } +tempfile = "3.14" x509-parser = { workspace = true, features = ["verify"] } # ------------------------------------------------------------------------------ diff --git a/crate/cli/src/actions/delete_datasets.rs b/crate/cli/src/actions/delete_datasets.rs index d063b864..b7d64daa 100644 --- a/crate/cli/src/actions/delete_datasets.rs +++ b/crate/cli/src/actions/delete_datasets.rs @@ -21,7 +21,7 @@ pub struct DeleteDatasetAction { impl DeleteDatasetAction { #[allow(clippy::future_not_send, clippy::print_stdout)] - pub(crate) async fn run(&self, findex_rest_client: FindexRestClient) -> CosmianResult<()> { + pub(crate) async fn run(&self, findex_rest_client: &FindexRestClient) -> CosmianResult<()> { let uuids = Uuids::from(self.uuid.clone()); findex_rest_client .delete_entries(&self.index_id, &uuids) diff --git a/crate/cli/src/actions/encrypt_and_index.rs b/crate/cli/src/actions/encrypt_and_index.rs index fa950473..73bbde3d 100644 --- a/crate/cli/src/actions/encrypt_and_index.rs +++ b/crate/cli/src/actions/encrypt_and_index.rs @@ -269,7 +269,7 @@ impl EncryptAndIndexAction { #[allow(clippy::future_not_send, clippy::print_stdout)] pub async fn run( &self, - findex_rest_client: FindexRestClient, + findex_rest_client: &FindexRestClient, kms_rest_client: &KmsClient, ) -> CosmianResult<()> { let nonce = self diff --git a/crate/cli/src/actions/findex.rs b/crate/cli/src/actions/findex.rs index 8e6d1e0b..4e201824 100644 --- a/crate/cli/src/actions/findex.rs +++ b/crate/cli/src/actions/findex.rs @@ -19,12 +19,13 @@ pub enum FindexActions { impl FindexActions { /// Combine Findex with KMS encryption + /// /// # Errors /// Returns an error if the action fails #[allow(clippy::future_not_send)] pub async fn run( &self, - findex_rest_client: FindexRestClient, + findex_rest_client: &mut FindexRestClient, kms_rest_client: &KmsClient, ) -> CosmianResult<()> { match self { diff --git a/crate/cli/src/actions/search_and_decrypt.rs b/crate/cli/src/actions/search_and_decrypt.rs index 03aee752..51158355 100644 --- a/crate/cli/src/actions/search_and_decrypt.rs +++ b/crate/cli/src/actions/search_and_decrypt.rs @@ -71,23 +71,22 @@ impl SearchAndDecryptAction { #[allow(clippy::future_not_send, clippy::print_stdout)] pub(crate) async fn run( &self, - findex_rest_client: FindexRestClient, + findex_rest_client: &FindexRestClient, kms_rest_client: &KmsClient, ) -> CosmianResult<()> { - let results = - instantiate_findex(findex_rest_client.clone(), &self.findex_parameters.index_id) - .await? - .search( - &self.findex_parameters.user_key()?, - &self.findex_parameters.label(), - self.keyword - .clone() - .into_iter() - .map(|word| Keyword::from(word.as_bytes())) - .collect::(), - &|_| async move { Ok(false) }, - ) - .await?; + let results = instantiate_findex(findex_rest_client, &self.findex_parameters.index_id) + .await? + .search( + &self.findex_parameters.user_key()?, + &self.findex_parameters.label(), + self.keyword + .clone() + .into_iter() + .map(|word| Keyword::from(word.as_bytes())) + .collect::(), + &|_| async move { Ok(false) }, + ) + .await?; trace!("Index search results: {results}"); let mut uuids = Vec::new(); diff --git a/crate/cli/src/commands.rs b/crate/cli/src/commands.rs index f49523aa..964aa731 100644 --- a/crate/cli/src/commands.rs +++ b/crate/cli/src/commands.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; use clap::{CommandFactory, Parser, Subcommand}; use cosmian_config_utils::ConfigUtils; -use cosmian_findex_cli::reexports::cosmian_findex_client::FindexRestClient; +use cosmian_findex_cli::{CoreFindexActions, reexports::cosmian_findex_client::FindexRestClient}; use cosmian_kms_cli::{KmsActions, reexport::cosmian_kms_client::KmsClient}; use cosmian_logger::log_init; use tracing::{info, trace}; @@ -19,10 +19,10 @@ use crate::{ pub struct Cli { /// Configuration file location /// - /// This is an alternative to the env variable `KMS_CLI_CONF`. - /// Takes precedence over `KMS_CLI_CONF` env variable. - #[arg(short, long)] - conf: Option, + /// This is an alternative to the env variable `COSMIAN_CLI_CONF_PATH`. + /// Takes precedence over `COSMIAN_CLI_CONF_PATH` env variable. + #[arg(short, env = "COSMIAN_CLI_CONF_PATH", long)] + conf_path: Option, #[command(subcommand)] pub command: CliCommands, @@ -36,12 +36,12 @@ pub struct Cli { /// `accept_invalid_certs` is useful if the CLI needs to connect to an HTTPS KMS server /// running an invalid or insecure SSL certificate #[arg(long)] - pub kms_accept_invalid_certs: Option, + pub kms_accept_invalid_certs: bool, /// Output the KMS JSON KMIP request and response. /// This is useful to understand JSON POST requests and responses /// required to programmatically call the KMS on the `/kmip/2_1` endpoint - #[arg(long, default_value = "false")] + #[arg(long)] pub kms_print_json: bool, /// The URL of the Findex server @@ -53,7 +53,7 @@ pub struct Cli { /// `accept_invalid_certs` is useful if the CLI needs to connect to an HTTPS KMS server /// running an invalid or insecure SSL certificate #[arg(long)] - pub findex_accept_invalid_certs: Option, + pub findex_accept_invalid_certs: bool, } #[derive(Subcommand)] @@ -84,65 +84,74 @@ pub enum CliCommands { /// - The command-line arguments cannot be parsed. /// - The configuration file cannot be located or loaded. /// - Any of the subcommands fail during their execution. -#[allow(clippy::future_not_send)] +#[allow(clippy::future_not_send, clippy::cognitive_complexity)] pub async fn cosmian_main() -> CosmianResult<()> { log_init(None); info!("Starting Cosmian CLI"); let cli = Cli::parse(); - let conf_path = ClientConf::location(cli.conf)?; - let mut conf = ClientConf::from_toml(&conf_path)?; + let conf_path = ClientConf::location(cli.conf_path)?; + let mut config = ClientConf::from_toml(&conf_path)?; - // Override the configuration with the CLI arguments - let mut has_been_overridden = false; + // Handle KMS configuration if let Some(url) = cli.kms_url.clone() { - conf.kms_config.http_config.server_url = url; - has_been_overridden = true; + config.kms_config.http_config.server_url = url; } - if let Some(accept_invalid_certs) = cli.kms_accept_invalid_certs { - conf.kms_config.http_config.accept_invalid_certs = accept_invalid_certs; - has_been_overridden = true; + if cli.kms_accept_invalid_certs { + config.kms_config.http_config.accept_invalid_certs = true; } - if let Some(url) = cli.findex_url.clone() { - if let Some(findex_conf) = conf.findex_config.as_mut() { - findex_conf.http_config.server_url = url; - has_been_overridden = true; + config.kms_config.print_json = Some(cli.kms_print_json); + + // Handle Findex server configuration + if let Some(findex_config) = config.findex_config.as_mut() { + if let Some(url) = cli.findex_url.clone() { + findex_config.http_config.server_url = url; } - } - if let Some(accept_invalid_certs) = cli.findex_accept_invalid_certs { - if let Some(findex_conf) = conf.findex_config.as_mut() { - findex_conf.http_config.accept_invalid_certs = accept_invalid_certs; - has_been_overridden = true; + if cli.findex_accept_invalid_certs { + findex_config.http_config.accept_invalid_certs = true; } } - conf.kms_config.print_json = Some(cli.kms_print_json); - if has_been_overridden { - conf.to_toml(&conf_path)?; - } - trace!("Configuration: {conf:?}"); + trace!("Configuration: {config:?}"); - // Instantiate the KMS and Findex clients - let kms_rest_client = KmsClient::new(conf.kms_config)?; + // Instantiate the KMS client + let mut kms_rest_client = KmsClient::new(config.kms_config.clone())?; - match cli.command { + match &cli.command { CliCommands::Markdown(action) => { let command = ::command(); action.process(&command)?; return Ok(()) } CliCommands::Kms(kms_actions) => { - kms_actions.process(&kms_rest_client).await?; + kms_actions.process(&mut kms_rest_client).await?; + config.kms_config = kms_rest_client.config.clone(); } CliCommands::FindexServer(findex_actions) => { - let findex_config = conf.findex_config.ok_or_else(|| { + let findex_config = config.findex_config.as_ref().ok_or_else(|| { cli_error!("Findex server configuration is missing in the configuration file") })?; - let findex_rest_client = FindexRestClient::new(findex_config)?; + let mut findex_rest_client = FindexRestClient::new(findex_config.clone())?; findex_actions - .run(findex_rest_client, &kms_rest_client) + .run(&mut findex_rest_client, &kms_rest_client) .await?; + config.findex_config = Some(findex_rest_client.config.clone()); + } + } + + // Save the configuration + match cli.command { + CliCommands::Kms(KmsActions::Login(_) | KmsActions::Logout(_)) => { + config.to_toml(&conf_path)?; + info!("Saving configuration to: {conf_path:?}"); + } + CliCommands::FindexServer(FindexActions::Findex( + CoreFindexActions::Login(_) | CoreFindexActions::Logout(_), + )) => { + config.to_toml(&conf_path)?; + info!("Saving configuration to: {conf_path:?}"); } + _ => {} } Ok(()) diff --git a/crate/cli/src/lib.rs b/crate/cli/src/lib.rs index a52becae..80f6bae7 100644 --- a/crate/cli/src/lib.rs +++ b/crate/cli/src/lib.rs @@ -4,7 +4,6 @@ future_incompatible, keyword_idents, let_underscore, - // rust_2024_compatibility, unreachable_pub, unused, clippy::all, diff --git a/crate/gui/Cargo.toml b/crate/gui/Cargo.toml index af7c9bb2..6f6ef929 100644 --- a/crate/gui/Cargo.toml +++ b/crate/gui/Cargo.toml @@ -17,10 +17,10 @@ test = false fips = ["cosmian_cli/fips"] [dependencies] -clap = "4.4" +clap = "4.5" cosmian_cli = { path = "../cli" } klask = { git = "https://github.com/Cosmian/klask.git" } -tokio = { version = "1.34", features = ["full"] } +tokio = { workspace = true, features = ["full"] } [target.'cfg(windows)'.dependencies] -winapi = { version = "0.3.5", features = ["winnt", "winuser"] } +winapi = { version = "0.3.9", features = ["winnt", "winuser"] } diff --git a/documentation/docs/cli/main_commands.md b/documentation/docs/cli/main_commands.md index 15a86038..3b2b58be 100644 --- a/documentation/docs/cli/main_commands.md +++ b/documentation/docs/cli/main_commands.md @@ -6,7 +6,7 @@ CLI used to manage the Cosmian KMS. ### Usage `cosmian [options]` ### Arguments -`--conf [-c] ` Configuration file location +`--conf-path [-c] ` Configuration file location `--kms-url ` The URL of the KMS @@ -16,7 +16,7 @@ Possible values: `"true", "false"` `--kms-print-json ` Output the KMS JSON KMIP request and response. This is useful to understand JSON POST requests and responses required to programmatically call the KMS on the `/kmip/2_1` endpoint -Possible values: `"true", "false"` [default: `"false"`] +Possible values: `"true", "false"` `--findex-url ` The URL of the Findex server @@ -200,13 +200,11 @@ Get the KMIP object attributes and tags. To specify multiple attributes, use the option multiple times. If not specified, all possible attributes are returned. -Possible values: `"ActivationDate", "ApplicationData", "ApplicationNamespace", "ApplicationSpecific_Information", "ArchiveDate", "AsynchronousCorrelation_Value", "AsynchronousIndicator", "Attribute", "AttributeName", "AttributeValue", "Authentication", "BatchCount", "BatchErrorContinuationOption", "BatchItem", "BatchOrderOption", "BlockCipherMode", "CancellationResult", "Certificate", "CertificateRequest", "CertificateRequestType", "CertificateType", "CertificateValue", "CompromiseDate", "CompromiseOccurrenceDate", "ContactInformation", "Credential", "CredentialType", "CredentialValue", "CriticalityIndicator", "CRTCoefficient", "CryptographicAlgorithm", "CryptographicDomainParameters", "CryptographicLength", "CryptographicParameters", "CryptographicUsageMask", "D", "DeactivationDate", "DerivationData", "DerivationMethod", "DerivationParameters", "DestroyDate", "Digest", "DigestValue", "EncryptionKeyInformation", "G", "HashingAlgorithm", "InitialDate", "InitializationVector", "IterationCount", "IVCounterNonce", "J", "Key", "KeyBlock", "KeyCompressionType", "KeyFormatType", "KeyMaterial", "KeyPartIdentifier", "KeyValue", "KeyWrappingData", "KeyWrappingSpecification", "LastChangeDate", "LeaseTime", "Link", "LinkType", "LinkedObjectIdentifier", "MACSignature", "MACSignatureKey_Information", "MaximumItems", "MaximumResponseSize", "MessageExtension", "Modulus", "Name", "NameType", "NameValue", "ObjectGroup", "ObjectType", "Offset", "OpaqueDataType", "OpaqueDataValue", "OpaqueObject", "Operation", "P", "PaddingMethod", "PrimeExponentP", "PrimeExponentQ", "PrimeFieldSize", "PrivateExponent", "PrivateKey", "PrivateKeyUniqueIdentifier", "ProcessStartDate", "ProtectStopDate", "ProtocolVersion", "ProtocolVersionMajor", "ProtocolVersionMinor", "PublicExponent", "PublicKey", "PublicKeyUniqueIdentifier", "PutFunction", "Q", "QString", "Qlength", "QueryFunction", "RecommendedCurve", "ReplacedUniqueIdentifier", "RequestHeader", "RequestMessage", "RequestPayload", "ResponseHeader", "ResponseMessage", "ResponsePayload", "ResultMessage", "ResultReason", "ResultStatus", "RevocationMessage", "RevocationReason", "RevocationReasonCode", "KeyRoleType", "Salt", "SecretData", "SecretDataType", "ServerInformation", "SplitKey", "SplitKeyMethod", "SplitKeyParts", "SplitKeyThreshold", "State", "StorageStatusMask", "SymmetricKey", "TimeStamp", "UniqueBatchItemID", "UniqueIdentifier", "UsageLimits", "UsageLimitsCount", "UsageLimitsTotal", "UsageLimitsUnit", "Username", "ValidityDate", "ValidityIndicator", "VendorExtension", "VendorIdentification", "WrappingMethod", "X", "Y", "Password", "DeviceIdentifier", "EncodingOption", "ExtensionInformation", "ExtensionName", "ExtensionTag", "ExtensionType", "Fresh", "MachineIdentifier", "MediaIdentifier", "NetworkIdentifier", "ObjectGroupMember", "CertificateLength", "DigitalSignatureAlgorithm", "CertificateSerialNumber", "DeviceSerialNumber", "IssuerAlternativeName", "IssuerDistinguishedName", "SubjectAlternativeName", "SubjectDistinguishedName", "X509CertificateIdentifier", "X509CertificateIssuer", "X509CertificateSubject", "KeyValueLocation", "KeyValueLocationValue", "KeyValueLocationType", "KeyValuePresent", "OriginalCreationDate", "PGPKey", "PGPKeyVersion", "AlternativeName", "AlternativeNameValue", "AlternativeNameType", "Data", "SignatureData", "DataLength", "RandomIV", "MACData", "AttestationType", "Nonce", "NonceID", "NonceValue", "AttestationMeasurement", "AttestationAssertion", "IVLength", "TagLength", "FixedFieldLength", "CounterLength", "InitialCounterValue", "InvocationFieldLength", "AttestationCapableIndicator", "OffsetItems", "LocatedItems", "CorrelationValue", "InitIndicator", "FinalIndicator", "RNGParameters", "RNGAlgorithm", "DRBGAlgorithm", "FIPS186Variation", "PredictionResistance", "RandomNumberGenerator", "ValidationInformation", "ValidationAuthorityType", "ValidationAuthorityCountry", "ValidationAuthorityURI", "ValidationVersionMajor", "ValidationVersionMinor", "ValidationType", "ValidationLevel", "ValidationCertificateIdentifier", "ValidationCertificateURI", "ValidationVendorURI", "ValidationProfile", "ProfileInformation", "ProfileName", "ServerURI", "ServerPort", "StreamingCapability", "AsynchronousCapability", "AttestationCapability", "UnwrapMode", "DestroyAction", "ShreddingAlgorithm", "RNGMode", "ClientRegistrationMethod", "CapabilityInformation", "KeyWrapType", "BatchUndoCapability", "BatchContinueCapability", "PKCS12FriendlyName", "Description", "Comment", "AuthenticatedEncryptionAdditionalData", "AuthenticatedEncryptionTag", "SaltLength", "MaskGenerator", "MaskGeneratorHashingAlgorithm", "PSource", "TrailerField", "ClientCorrelationValue", "ServerCorrelationValue", "DigestedData", "CertificateSubjectCN", "CertificateSubjectO", "CertificateSubjectOU", "CertificateSubjectEmail", "CertificateSubjectC", "CertificateSubjectST", "CertificateSubjectL", "CertificateSubjectUID", "CertificateSubjectSerialNumber", "CertificateSubjectTitle", "CertificateSubjectDC", "CertificateSubjectDNQualifier", "CertificateIssuerCN", "CertificateIssuerO", "CertificateIssuerOU", "CertificateIssuerEmail", "CertificateIssuerC", "CertificateIssuerST", "CertificateIssuerL", "CertificateIssuerUID", "CertificateIssuerSerialNumber", "CertificateIssuerTitle", "CertificateIssuerDC", "CertificateIssuerDNQualifier", "Sensitive", "AlwaysSensitive", "Extractable", "NeverExtractable", "ReplaceExisting", "Attributes", "CommonAttributes", "PrivateKeyAttributes", "PublicKeyAttributes", "ExtensionEnumeration", "ExtensionAttribute", "ExtensionParentStructureTag", "ExtensionDescription", "ServerName", "ServerSerialNumber", "ServerVersion", "ServerLoad", "ProductName", "BuildLevel", "BuildDate", "ClusterInfo", "AlternateFailoverEndpoints", "ShortUniqueIdentifier", "Reserved", "Tag", "CertificateRequestUniqueIdentifier", "NISTKeyType", "AttributeReference", "CurrentAttribute", "NewAttribute", "CertificateRequestValue", "LogMessage", "ProfileVersion", "ProfileVersionMajor", "ProfileVersionMinor", "ProtectionLevel", "ProtectionPeriod", "QuantumSafe", "QuantumSafeCapability", "Ticket", "TicketType", "TicketValue", "RequestCount", "Rights", "Objects", "Operations", "Right", "EndpointRole", "DefaultsInformation", "ObjectDefaults", "Ephemeral", "ServerHashedPassword", "OneTimePassword", "HashedPassword", "AdjustmentType", "PKCS11Interface", "PKCS11Function", "PKCS11InputParameters", "PKCS11OutputParameters", "PKCS11ReturnCode", "ProtectionStorageMask", "ProtectionStorageMasks", "InteropFunction", "InteropIdentifier", "AdjustmentValue", "CommonProtectionStorageMasks", "PrivateProtectionStorageMasks", "PublicProtectionStorageMasks"` - `--link-type [-l] ` Filter on retrieved links. Only if KMIP tag `LinkType` is used in `attribute` parameter. To specify multiple attributes, use the option multiple times. If not specified, all possible link types are returned. -Possible values: `"CertificateLink", "PublicKeyLink", "PrivateKeyLink", "DerivationBaseObjectLink", "DerivedKeyLink", "ReplacementObjectLink", "ReplacedObjectLink", "ParentLink", "ChildLink", "PreviousLink", "NextLink", "PKCS12CertificateLink", "PKCS12PasswordLink", "WrappingKeyLink"` +Possible values: `"certificate", "public-key", "private-key", "derivation-base-object", "derived-key", "replacement-object", "replaced-object", "parent", "child", "previous", "next", "pkcs12-certificate", "pkcs12-password", "wrapping-key"` `--output-file [-o] ` An optional file where to export the attributes. The attributes will be in JSON TTLV format. @@ -230,7 +228,7 @@ Set the KMIP object attributes. `--cryptographic-algorithm [-a] ` The cryptographic algorithm used by the key -Possible values: `"DES", "THREE_DES", "AES", "RSA", "DSA", "ECDSA", "HMACSHA1", "HMACSHA224", "HMACSHA256", "HMACSHA384", "HMACSHA512", "HMACMD5", "DH", "ECDH", "ECMQV", "Blowfish", "Camellia", "CAST5", "IDEA", "MARS", "RC2", "RC4", "RC5", "SKIPJACK", "Twofish", "EC", "OneTimePad", "ChaCha20", "Poly1305", "ChaCha20Poly1305", "SHA3224", "SHA3256", "SHA3384", "SHA3512", "HMACSHA3224", "HMACSHA3256", "HMACSHA3384", "HMACSHA3512", "SHAKE128", "SHAKE256", "ARIA", "SEED", "SM2", "SM3", "SM4", "GOSTR34102012", "GOSTR34112012", "GOSTR34132015", "GOST2814789", "XMSS", "SPHINCS_256", "Page166Of230McEliece", "McEliece6960119", "McEliece8192128", "Ed25519", "Ed448", "CoverCrypt", "CoverCryptBulk"` +Possible values: `"aes", "rsa", "ecdsa", "ecdh", "ec", "chacha20", "chacha20-poly1305", "sha3224", "sha3256", "sha3384", "sha3512", "ed25519", "ed448", "covercrypt", "covercrypt-bulk"` `--cryptographic-length ` The length of the cryptographic key @@ -277,7 +275,7 @@ Delete the KMIP object attributes. `--cryptographic-algorithm [-a] ` The cryptographic algorithm used by the key -Possible values: `"DES", "THREE_DES", "AES", "RSA", "DSA", "ECDSA", "HMACSHA1", "HMACSHA224", "HMACSHA256", "HMACSHA384", "HMACSHA512", "HMACMD5", "DH", "ECDH", "ECMQV", "Blowfish", "Camellia", "CAST5", "IDEA", "MARS", "RC2", "RC4", "RC5", "SKIPJACK", "Twofish", "EC", "OneTimePad", "ChaCha20", "Poly1305", "ChaCha20Poly1305", "SHA3224", "SHA3256", "SHA3384", "SHA3512", "HMACSHA3224", "HMACSHA3256", "HMACSHA3384", "HMACSHA3512", "SHAKE128", "SHAKE256", "ARIA", "SEED", "SM2", "SM3", "SM4", "GOSTR34102012", "GOSTR34112012", "GOSTR34132015", "GOST2814789", "XMSS", "SPHINCS_256", "Page166Of230McEliece", "McEliece6960119", "McEliece8192128", "Ed25519", "Ed448", "CoverCrypt", "CoverCryptBulk"` +Possible values: `"aes", "rsa", "ecdsa", "ecdh", "ec", "chacha20", "chacha20-poly1305", "sha3224", "sha3256", "sha3384", "sha3512", "ed25519", "ed448", "covercrypt", "covercrypt-bulk"` `--cryptographic-length ` The length of the cryptographic key @@ -308,8 +306,6 @@ Possible values: `"sign", "verify", "encrypt", "decrypt", "wrap-key", "unwrap-k `--attribute ` The attributes or tags to retrieve. To specify multiple attributes, use the option multiple times. -Possible values: `"ActivationDate", "ApplicationData", "ApplicationNamespace", "ApplicationSpecific_Information", "ArchiveDate", "AsynchronousCorrelation_Value", "AsynchronousIndicator", "Attribute", "AttributeName", "AttributeValue", "Authentication", "BatchCount", "BatchErrorContinuationOption", "BatchItem", "BatchOrderOption", "BlockCipherMode", "CancellationResult", "Certificate", "CertificateRequest", "CertificateRequestType", "CertificateType", "CertificateValue", "CompromiseDate", "CompromiseOccurrenceDate", "ContactInformation", "Credential", "CredentialType", "CredentialValue", "CriticalityIndicator", "CRTCoefficient", "CryptographicAlgorithm", "CryptographicDomainParameters", "CryptographicLength", "CryptographicParameters", "CryptographicUsageMask", "D", "DeactivationDate", "DerivationData", "DerivationMethod", "DerivationParameters", "DestroyDate", "Digest", "DigestValue", "EncryptionKeyInformation", "G", "HashingAlgorithm", "InitialDate", "InitializationVector", "IterationCount", "IVCounterNonce", "J", "Key", "KeyBlock", "KeyCompressionType", "KeyFormatType", "KeyMaterial", "KeyPartIdentifier", "KeyValue", "KeyWrappingData", "KeyWrappingSpecification", "LastChangeDate", "LeaseTime", "Link", "LinkType", "LinkedObjectIdentifier", "MACSignature", "MACSignatureKey_Information", "MaximumItems", "MaximumResponseSize", "MessageExtension", "Modulus", "Name", "NameType", "NameValue", "ObjectGroup", "ObjectType", "Offset", "OpaqueDataType", "OpaqueDataValue", "OpaqueObject", "Operation", "P", "PaddingMethod", "PrimeExponentP", "PrimeExponentQ", "PrimeFieldSize", "PrivateExponent", "PrivateKey", "PrivateKeyUniqueIdentifier", "ProcessStartDate", "ProtectStopDate", "ProtocolVersion", "ProtocolVersionMajor", "ProtocolVersionMinor", "PublicExponent", "PublicKey", "PublicKeyUniqueIdentifier", "PutFunction", "Q", "QString", "Qlength", "QueryFunction", "RecommendedCurve", "ReplacedUniqueIdentifier", "RequestHeader", "RequestMessage", "RequestPayload", "ResponseHeader", "ResponseMessage", "ResponsePayload", "ResultMessage", "ResultReason", "ResultStatus", "RevocationMessage", "RevocationReason", "RevocationReasonCode", "KeyRoleType", "Salt", "SecretData", "SecretDataType", "ServerInformation", "SplitKey", "SplitKeyMethod", "SplitKeyParts", "SplitKeyThreshold", "State", "StorageStatusMask", "SymmetricKey", "TimeStamp", "UniqueBatchItemID", "UniqueIdentifier", "UsageLimits", "UsageLimitsCount", "UsageLimitsTotal", "UsageLimitsUnit", "Username", "ValidityDate", "ValidityIndicator", "VendorExtension", "VendorIdentification", "WrappingMethod", "X", "Y", "Password", "DeviceIdentifier", "EncodingOption", "ExtensionInformation", "ExtensionName", "ExtensionTag", "ExtensionType", "Fresh", "MachineIdentifier", "MediaIdentifier", "NetworkIdentifier", "ObjectGroupMember", "CertificateLength", "DigitalSignatureAlgorithm", "CertificateSerialNumber", "DeviceSerialNumber", "IssuerAlternativeName", "IssuerDistinguishedName", "SubjectAlternativeName", "SubjectDistinguishedName", "X509CertificateIdentifier", "X509CertificateIssuer", "X509CertificateSubject", "KeyValueLocation", "KeyValueLocationValue", "KeyValueLocationType", "KeyValuePresent", "OriginalCreationDate", "PGPKey", "PGPKeyVersion", "AlternativeName", "AlternativeNameValue", "AlternativeNameType", "Data", "SignatureData", "DataLength", "RandomIV", "MACData", "AttestationType", "Nonce", "NonceID", "NonceValue", "AttestationMeasurement", "AttestationAssertion", "IVLength", "TagLength", "FixedFieldLength", "CounterLength", "InitialCounterValue", "InvocationFieldLength", "AttestationCapableIndicator", "OffsetItems", "LocatedItems", "CorrelationValue", "InitIndicator", "FinalIndicator", "RNGParameters", "RNGAlgorithm", "DRBGAlgorithm", "FIPS186Variation", "PredictionResistance", "RandomNumberGenerator", "ValidationInformation", "ValidationAuthorityType", "ValidationAuthorityCountry", "ValidationAuthorityURI", "ValidationVersionMajor", "ValidationVersionMinor", "ValidationType", "ValidationLevel", "ValidationCertificateIdentifier", "ValidationCertificateURI", "ValidationVendorURI", "ValidationProfile", "ProfileInformation", "ProfileName", "ServerURI", "ServerPort", "StreamingCapability", "AsynchronousCapability", "AttestationCapability", "UnwrapMode", "DestroyAction", "ShreddingAlgorithm", "RNGMode", "ClientRegistrationMethod", "CapabilityInformation", "KeyWrapType", "BatchUndoCapability", "BatchContinueCapability", "PKCS12FriendlyName", "Description", "Comment", "AuthenticatedEncryptionAdditionalData", "AuthenticatedEncryptionTag", "SaltLength", "MaskGenerator", "MaskGeneratorHashingAlgorithm", "PSource", "TrailerField", "ClientCorrelationValue", "ServerCorrelationValue", "DigestedData", "CertificateSubjectCN", "CertificateSubjectO", "CertificateSubjectOU", "CertificateSubjectEmail", "CertificateSubjectC", "CertificateSubjectST", "CertificateSubjectL", "CertificateSubjectUID", "CertificateSubjectSerialNumber", "CertificateSubjectTitle", "CertificateSubjectDC", "CertificateSubjectDNQualifier", "CertificateIssuerCN", "CertificateIssuerO", "CertificateIssuerOU", "CertificateIssuerEmail", "CertificateIssuerC", "CertificateIssuerST", "CertificateIssuerL", "CertificateIssuerUID", "CertificateIssuerSerialNumber", "CertificateIssuerTitle", "CertificateIssuerDC", "CertificateIssuerDNQualifier", "Sensitive", "AlwaysSensitive", "Extractable", "NeverExtractable", "ReplaceExisting", "Attributes", "CommonAttributes", "PrivateKeyAttributes", "PublicKeyAttributes", "ExtensionEnumeration", "ExtensionAttribute", "ExtensionParentStructureTag", "ExtensionDescription", "ServerName", "ServerSerialNumber", "ServerVersion", "ServerLoad", "ProductName", "BuildLevel", "BuildDate", "ClusterInfo", "AlternateFailoverEndpoints", "ShortUniqueIdentifier", "Reserved", "Tag", "CertificateRequestUniqueIdentifier", "NISTKeyType", "AttributeReference", "CurrentAttribute", "NewAttribute", "CertificateRequestValue", "LogMessage", "ProfileVersion", "ProfileVersionMajor", "ProfileVersionMinor", "ProtectionLevel", "ProtectionPeriod", "QuantumSafe", "QuantumSafeCapability", "Ticket", "TicketType", "TicketValue", "RequestCount", "Rights", "Objects", "Operations", "Right", "EndpointRole", "DefaultsInformation", "ObjectDefaults", "Ephemeral", "ServerHashedPassword", "OneTimePassword", "HashedPassword", "AdjustmentType", "PKCS11Interface", "PKCS11Function", "PKCS11InputParameters", "PKCS11OutputParameters", "PKCS11ReturnCode", "ProtectionStorageMask", "ProtectionStorageMasks", "InteropFunction", "InteropIdentifier", "AdjustmentValue", "CommonProtectionStorageMasks", "PrivateProtectionStorageMasks", "PublicProtectionStorageMasks"` - @@ -1852,22 +1848,22 @@ Handle Findex server actions **`delete-dataset`** [[2.3]](#23-cosmian-findex-server-delete-dataset) Delete encrypted entries. (Indexes are not deleted) -**`index`** [[2.4]](#24-cosmian-findex-server-index) Index new keywords +**`datasets`** [[2.4]](#24-cosmian-findex-server-datasets) Manage encrypted datasets **`delete`** [[2.5]](#25-cosmian-findex-server-delete) Delete indexed keywords -**`search`** [[2.6]](#26-cosmian-findex-server-search) Findex: Search keywords. +**`index`** [[2.6]](#26-cosmian-findex-server-index) Index new keywords -**`server-version`** [[2.7]](#27-cosmian-findex-server-server-version) Print the version of the server - -**`login`** [[2.8]](#28-cosmian-findex-server-login) Login to the Identity Provider of the Findex server using the `OAuth2` +**`login`** [[2.7]](#27-cosmian-findex-server-login) Login to the Identity Provider of the Findex server using the `OAuth2` authorization code flow. -**`logout`** [[2.9]](#29-cosmian-findex-server-logout) Logout from the Identity Provider. +**`logout`** [[2.8]](#28-cosmian-findex-server-logout) Logout from the Identity Provider. + +**`permissions`** [[2.9]](#29-cosmian-findex-server-permissions) Manage the users permissions to the indexes -**`permissions`** [[2.10]](#210-cosmian-findex-server-permissions) Manage the users permissions to the indexes +**`search`** [[2.10]](#210-cosmian-findex-server-search) Findex: Search keywords. -**`datasets`** [[2.11]](#211-cosmian-findex-server-datasets) Manage encrypted datasets +**`server-version`** [[2.11]](#211-cosmian-findex-server-server-version) Print the version of the server --- @@ -1946,20 +1942,64 @@ Delete encrypted entries. (Indexes are not deleted) --- -## 2.4 cosmian findex-server index +## 2.4 cosmian findex-server datasets -Index new keywords +Manage encrypted datasets ### Usage -`cosmian findex-server index [options]` +`cosmian findex-server datasets ` + +### Subcommands + +**`add`** [[2.4.1]](#241-cosmian-findex-server-datasets-add) Add datasets entries + +**`delete`** [[2.4.2]](#242-cosmian-findex-server-datasets-delete) Delete datasets entries using corresponding entries UUID + +**`get`** [[2.4.3]](#243-cosmian-findex-server-datasets-get) Get datasets entries using corresponding entries UUID. Returns the entries + +--- + +## 2.4.1 cosmian findex-server datasets add + +Add datasets entries + +### Usage +`cosmian findex-server datasets add [options]` ### Arguments -`--key [-k] ` The user findex key used (to add, search, delete and compact). The key is a 16 bytes hex string +`--index-id ` The index ID -`--label [-l]