]> git.proxmox.com Git - proxmox-backup.git/blobdiff - src/bin/proxmox_tape/encryption_key.rs
update to first proxmox crate split
[proxmox-backup.git] / src / bin / proxmox_tape / encryption_key.rs
index 5587d352936628a111d9ffe90cb3cc888cab3d9d..3feb72ffbfdc26b462db5a582954db6940924f4f 100644 (file)
@@ -1,41 +1,20 @@
 use anyhow::{bail, Error};
 use serde_json::Value;
 
-use proxmox::{
-    api::{
-        api,
-        cli::*,
-        RpcEnvironment,
-        ApiHandler,
-    },
-    sys::linux::tty,
-};
+use proxmox_router::{cli::*, ApiHandler, RpcEnvironment};
+use proxmox_schema::api;
+use proxmox::sys::linux::tty;
 
-use proxmox_backup::{
-    tools::{
-        self,
-        paperkey::{
-            PaperkeyFormat,
-            generate_paper_key,
-        },
-    },
-    config,
-    api2::{
-        self,
-        types::{
-            DRIVE_NAME_SCHEMA,
-            TAPE_ENCRYPTION_KEY_FINGERPRINT_SCHEMA,
-            PASSWORD_HINT_SCHEMA,
-            Kdf,
-        },
-    },
-    backup::Fingerprint,
-    config::tape_encryption_keys::{
-        load_key_configs,
-        complete_key_fingerprint,
-    },
+use pbs_api_types::{
+    Fingerprint, Kdf, DRIVE_NAME_SCHEMA, TAPE_ENCRYPTION_KEY_FINGERPRINT_SCHEMA,
+    PASSWORD_HINT_SCHEMA,
 };
 
+use pbs_datastore::paperkey::{PaperkeyFormat, generate_paper_key};
+use pbs_config::tape_encryption_keys::{load_key_configs,complete_key_fingerprint};
+
+use proxmox_backup::api2;
+
 pub fn encryption_key_commands() -> CommandLineInterface {
 
     let cmd_def = CliCommandMap::new()
@@ -84,7 +63,7 @@ pub fn encryption_key_commands() -> CommandLineInterface {
                 schema: TAPE_ENCRYPTION_KEY_FINGERPRINT_SCHEMA,
             },
             subject: {
-                description: "Include the specified subject as titel text.",
+                description: "Include the specified subject as title text.",
                 optional: true,
             },
             "output-format": {
@@ -128,7 +107,7 @@ fn paper_key(
         },
     },
 )]
-/// Print tthe encryption key's metadata.
+/// Print the encryption key's metadata.
 fn show_key(
     param: Value,
     rpcenv: &mut dyn RpcEnvironment,
@@ -142,10 +121,10 @@ fn show_key(
         _ => unreachable!(),
     };
 
-    let options = proxmox::api::cli::default_table_format_options()
+    let options = proxmox_router::cli::default_table_format_options()
         .column(ColumnConfig::new("kdf"))
-        .column(ColumnConfig::new("created").renderer(tools::format::render_epoch))
-        .column(ColumnConfig::new("modified").renderer(tools::format::render_epoch))
+        .column(ColumnConfig::new("created").renderer(pbs_tools::format::render_epoch))
+        .column(ColumnConfig::new("modified").renderer(pbs_tools::format::render_epoch))
         .column(ColumnConfig::new("fingerprint"))
         .column(ColumnConfig::new("hint"));
 
@@ -213,8 +192,8 @@ async fn restore_key(
     rpcenv: &mut dyn RpcEnvironment,
 ) -> Result<(), Error> {
 
-    let (config, _digest) = config::drive::config()?;
-    param["drive"] = crate::lookup_drive_name(&param, &config)?.into();
+    let (config, _digest) = pbs_config::drive::config()?;
+    param["drive"] = crate::extract_drive_name(&mut param, &config)?.into();
 
     if !tty::stdin_isatty() {
         bail!("no password input mechanism available");