Migrate to latest age-plugin crate commit
This commit is contained in:
Generated
+2
-4
@@ -36,8 +36,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "age-core"
|
name = "age-core"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/str4d/rage.git?rev=baf277a749c839e49f93bffb58d36734ac94be83#baf277a749c839e49f93bffb58d36734ac94be83"
|
||||||
checksum = "a5f11899bc2bbddd135edbc30c36b1924fa59d0746bb45beb5933fafe3fe509b"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.21.7",
|
"base64 0.21.7",
|
||||||
"chacha20poly1305",
|
"chacha20poly1305",
|
||||||
@@ -54,8 +53,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "age-plugin"
|
name = "age-plugin"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/str4d/rage.git?rev=baf277a749c839e49f93bffb58d36734ac94be83#baf277a749c839e49f93bffb58d36734ac94be83"
|
||||||
checksum = "04740d993aac0e06eaf4cfbf8484a8a23a6a7f950cf5d53bdf2d6ea3f429eb9d"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"age-core",
|
"age-core",
|
||||||
"base64 0.21.7",
|
"base64 0.21.7",
|
||||||
|
|||||||
@@ -56,3 +56,7 @@ man = "0.3"
|
|||||||
tempfile = "3"
|
tempfile = "3"
|
||||||
test-with = "0.11"
|
test-with = "0.11"
|
||||||
which = "5"
|
which = "5"
|
||||||
|
|
||||||
|
[patch.crates-io]
|
||||||
|
age-core = { git = "https://github.com/str4d/rage.git", rev = "baf277a749c839e49f93bffb58d36734ac94be83" }
|
||||||
|
age-plugin = { git = "https://github.com/str4d/rage.git", rev = "baf277a749c839e49f93bffb58d36734ac94be83" }
|
||||||
|
|||||||
+1
-5
@@ -327,11 +327,7 @@ fn main() -> Result<(), Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(state_machine) = opts.age_plugin {
|
if let Some(state_machine) = opts.age_plugin {
|
||||||
run_state_machine(
|
run_state_machine(&state_machine, plugin::Handler)?;
|
||||||
&state_machine,
|
|
||||||
Some(plugin::RecipientPlugin::default),
|
|
||||||
Some(plugin::IdentityPlugin::default),
|
|
||||||
)?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
} else if opts.version {
|
} else if opts.version {
|
||||||
println!("age-plugin-yubikey {}", env!("CARGO_PKG_VERSION"));
|
println!("age-plugin-yubikey {}", env!("CARGO_PKG_VERSION"));
|
||||||
|
|||||||
+21
-2
@@ -2,13 +2,28 @@ use age_core::format::{FileKey, Stanza};
|
|||||||
use age_plugin::{
|
use age_plugin::{
|
||||||
identity::{self, IdentityPluginV1},
|
identity::{self, IdentityPluginV1},
|
||||||
recipient::{self, RecipientPluginV1},
|
recipient::{self, RecipientPluginV1},
|
||||||
Callbacks,
|
Callbacks, PluginHandler,
|
||||||
};
|
};
|
||||||
use std::collections::HashMap;
|
use std::collections::{HashMap, HashSet};
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
use crate::{fl, format, key, p256::Recipient, PLUGIN_NAME};
|
use crate::{fl, format, key, p256::Recipient, PLUGIN_NAME};
|
||||||
|
|
||||||
|
pub(crate) struct Handler;
|
||||||
|
|
||||||
|
impl PluginHandler for Handler {
|
||||||
|
type RecipientV1 = RecipientPlugin;
|
||||||
|
type IdentityV1 = IdentityPlugin;
|
||||||
|
|
||||||
|
fn recipient_v1(self) -> io::Result<Self::RecipientV1> {
|
||||||
|
Ok(RecipientPlugin::default())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn identity_v1(self) -> io::Result<Self::IdentityV1> {
|
||||||
|
Ok(IdentityPlugin::default())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub(crate) struct RecipientPlugin {
|
pub(crate) struct RecipientPlugin {
|
||||||
recipients: Vec<Recipient>,
|
recipients: Vec<Recipient>,
|
||||||
@@ -58,6 +73,10 @@ impl RecipientPluginV1 for RecipientPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn labels(&mut self) -> HashSet<String> {
|
||||||
|
HashSet::new()
|
||||||
|
}
|
||||||
|
|
||||||
fn wrap_file_keys(
|
fn wrap_file_keys(
|
||||||
&mut self,
|
&mut self,
|
||||||
file_keys: Vec<FileKey>,
|
file_keys: Vec<FileKey>,
|
||||||
|
|||||||
Reference in New Issue
Block a user