summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWiktor Kwapisiewicz <wiktor@metacode.biz>2021-03-26 14:30:09 +0100
committerWiktor Kwapisiewicz <wiktor@metacode.biz>2021-03-31 11:29:22 +0200
commit80cdf06912ce0217c8af77f9b02b4377095cb803 (patch)
tree575203e2c48e693e52b0ba5e36ac333a3c85c83f
parent4516d5b4c39a765583f9f2fe4bad54bbe70de0c9 (diff)
ipc: Incorporate sequoia-core crate as a core module.
- This moves all functionality from sequoia_core crate as an inner `core` module of the ipc crate. - The `core` module has to be public as other crates depend on `core::Context` either directly (store, ffi) or indirectly (store through ffi crate). - Remove the `core` crate completely.
-rw-r--r--Cargo.lock15
-rw-r--r--Cargo.toml1
-rw-r--r--core/Cargo.toml27
-rw-r--r--ffi/Cargo.toml2
-rw-r--r--ffi/src/core.rs4
-rw-r--r--ffi/src/error.rs2
-rw-r--r--ipc/Cargo.toml2
-rw-r--r--ipc/src/core.rs (renamed from core/src/lib.rs)26
-rw-r--r--ipc/src/lib.rs2
-rw-r--r--store/Cargo.toml1
-rw-r--r--store/src/backend/mod.rs2
-rw-r--r--store/src/lib.rs45
-rw-r--r--store/tests/ipc-policy.rs3
13 files changed, 43 insertions, 89 deletions
diff --git a/Cargo.lock b/Cargo.lock
index f7bfbf8e..ff67f008 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1765,16 +1765,6 @@ dependencies = [
]
[[package]]
-name = "sequoia-core"
-version = "0.22.0"
-dependencies = [
- "anyhow",
- "dirs 2.0.2",
- "tempfile",
- "thiserror",
-]
-
-[[package]]
name = "sequoia-ffi"
version = "0.22.0"
dependencies = [
@@ -1784,8 +1774,8 @@ dependencies = [
"libc",
"memsec",
"native-tls",
- "sequoia-core",
"sequoia-ffi-macros",
+ "sequoia-ipc",
"sequoia-net",
"sequoia-openpgp",
"sequoia-store",
@@ -1820,6 +1810,7 @@ dependencies = [
"capnp-rpc",
"clap",
"ctor",
+ "dirs 2.0.2",
"fs2",
"futures",
"lalrpop",
@@ -1829,7 +1820,6 @@ dependencies = [
"memsec",
"quickcheck",
"rand",
- "sequoia-core",
"sequoia-openpgp",
"socket2",
"tempfile",
@@ -1948,7 +1938,6 @@ dependencies = [
"futures-util",
"rand",
"rusqlite",
- "sequoia-core",
"sequoia-ipc",
"sequoia-net",
"sequoia-openpgp",
diff --git a/Cargo.toml b/Cargo.toml
index eb625137..a391ad61 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,7 +2,6 @@
members = [
"autocrypt",
"buffered-reader",
- "core",
"ffi",
"ffi-macros",
"guide",
diff --git a/core/Cargo.toml b/core/Cargo.toml
deleted file mode 100644
index 40bd6b7a..00000000
--- a/core/Cargo.toml
+++ /dev/null
@@ -1,27 +0,0 @@
-[package]
-name = "sequoia-core"
-description = "Policies for Sequoia"
-version = "0.22.0"
-authors = [
- "Justus Winter <justus@sequoia-pgp.org>",
- "Kai Michaelis <kai@sequoia-pgp.org>",
- "Neal H. Walfield <neal@sequoia-pgp.org>",
-]
-documentation = "https://docs.sequoia-pgp.org/0.21.0/sequoia_core"
-homepage = "https://sequoia-pgp.org/"
-repository = "https://gitlab.com/sequoia-pgp/sequoia"
-readme = "../README.md"
-keywords = ["cryptography", "openpgp", "pgp", "encryption", "signing"]
-categories = ["cryptography", "authentication", "email"]
-license = "GPL-2.0-or-later"
-edition = "2018"
-
-[badges]
-gitlab = { repository = "sequoia-pgp/sequoia" }
-maintenance = { status = "actively-developed" }
-
-[dependencies]
-anyhow = "1.0.18"
-dirs = "2.0"
-tempfile = "3.1"
-thiserror = "1.0.2"
diff --git a/ffi/Cargo.toml b/ffi/Cargo.toml
index 6250a93e..edb21a5b 100644
--- a/ffi/Cargo.toml
+++ b/ffi/Cargo.toml
@@ -24,9 +24,9 @@ maintenance = { status = "actively-developed" }
[dependencies]
sequoia-ffi-macros = { path = "../ffi-macros", version = "0.22" }
sequoia-openpgp = { path = "../openpgp", version = "1.0.0", default-features = false }
-sequoia-core = { path = "../core", version = "0.22" }
sequoia-store = { path = "../store", version = "0.22", default-features = false }
sequoia-net = { path = "../net", version = "0.23", default-features = false }
+sequoia-ipc = { path = "../ipc", version = "0.22", default-features = false }
anyhow = "1.0.18"
lazy_static = "1.4.0"
libc = "0.2.66"
diff --git a/ffi/src/core.rs b/ffi/src/core.rs
index a24c2137..59f465b7 100644
--- a/ffi/src/core.rs
+++ b/ffi/src/core.rs
@@ -41,8 +41,8 @@
use std::ptr;
use libc::{c_char, c_int};
-use sequoia_core as core;
-use sequoia_core::Config;
+use sequoia_ipc::core as core;
+use sequoia_ipc::core::Config;
/// Wraps a Context and provides an error slot.
#[doc(hidden)]
diff --git a/ffi/src/error.rs b/ffi/src/error.rs
index ebce4e0d..b00984a1 100644
--- a/ffi/src/error.rs
+++ b/ffi/src/error.rs
@@ -3,7 +3,7 @@
use std::io;
use sequoia_openpgp as openpgp;
-use sequoia_core as core;
+use sequoia_ipc::core as core;
use sequoia_net as net;
pub use crate::openpgp::error::Status;
diff --git a/ipc/Cargo.toml b/ipc/Cargo.toml
index fb9bbecd..c5e9e6ca 100644
--- a/ipc/Cargo.toml
+++ b/ipc/Cargo.toml
@@ -21,7 +21,6 @@ maintenance = { status = "actively-developed" }
[dependencies]
sequoia-openpgp = { path = "../openpgp", version = "1.0.0", default-features = false }
-sequoia-core = { path = "../core", version = "0.22" }
anyhow = "1.0.18"
buffered-reader = { path = "../buffered-reader", version = "1.0.0", default-features = false }
@@ -38,6 +37,7 @@ thiserror = "1.0.2"
tokio = { version = "0.2.19", features = ["rt-core", "rt-util", "tcp", "uds", "io-util", "macros"] }
tokio-util = { version = "0.3", features = ["compat"] }
socket2 = "0.3.16"
+dirs = "2.0"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.8", default-features = false, features = ["winsock2"] }
diff --git a/core/src/lib.rs b/ipc/src/core.rs
index 9fae0fcc..06adc353 100644
--- a/core/src/lib.rs
+++ b/ipc/src/core.rs
@@ -10,9 +10,8 @@
//! `Context::new`:
//!
//! ```no_run
-//! # use sequoia_core::{Context, Result};
-//! # f().unwrap();
-//! # fn f() -> Result<()> {
+//! # use sequoia_ipc::core::{Context, Result};
+//! # fn main() -> Result<()> {
//! let c = Context::new();
//! # Ok(())
//! # }
@@ -36,9 +35,8 @@ use std::path::{Path, PathBuf};
/// `Context::new`:
///
/// ```no_run
-/// # use sequoia_core::{Context, Result};
-/// # f().unwrap();
-/// # fn f() -> Result<()> {
+/// # use sequoia_ipc::core::{Context, Result};
+/// # fn main() -> Result<()> {
/// let c = Context::new()?;
/// # Ok(())
/// # }
@@ -48,9 +46,8 @@ use std::path::{Path, PathBuf};
/// `Context::configure`:
///
/// ```
-/// # use sequoia_core::{Context, IPCPolicy, Result};
-/// # f().unwrap();
-/// # fn f() -> Result<()> {
+/// # use sequoia_ipc::core::{Context, IPCPolicy, Result};
+/// # fn main() -> Result<()> {
/// let c = Context::configure()
/// # .ephemeral()
/// .ipc_policy(IPCPolicy::Robust)
@@ -142,9 +139,8 @@ impl Context {
/// `Context::configure`:
///
/// ```
-/// # use sequoia_core::{Context, IPCPolicy, Result};
-/// # f().unwrap();
-/// # fn f() -> Result<()> {
+/// # use sequoia_ipc::core::{Context, IPCPolicy, Result};
+/// # fn main() -> Result<()> {
/// let c = Context::configure()
/// # .ephemeral()
/// .ipc_policy(IPCPolicy::Robust)
@@ -157,10 +153,9 @@ impl Context {
/// one-shot programs:
///
/// ```
-/// # use sequoia_core::{Context, Result};
+/// # use sequoia_ipc::core::{Context, Result};
/// # use std::path::Path;
-/// # f().unwrap();
-/// # fn f() -> Result<()> {
+/// # fn main() -> Result<()> {
/// let c = Context::configure().ephemeral().build()?;
/// let ephemeral_home = c.home().to_path_buf();
/// // Do some tests.
@@ -257,6 +252,7 @@ pub enum Error {
IoError(#[from] io::Error),
}
+
/* IPC policy. */
/// IPC policy for Sequoia.
diff --git a/ipc/src/lib.rs b/ipc/src/lib.rs
index 3c06c6ad..dbc9f965 100644
--- a/ipc/src/lib.rs
+++ b/ipc/src/lib.rs
@@ -64,7 +64,6 @@ use std::process::{Command, Stdio};
use std::thread;
use sequoia_openpgp as openpgp;
-use sequoia_core as core;
#[macro_use] mod trace;
pub mod assuan;
@@ -72,6 +71,7 @@ pub mod gnupg;
mod keygrip;
pub use self::keygrip::Keygrip;
pub mod sexp;
+pub mod core;
#[cfg(test)]
mod tests;
diff --git a/store/Cargo.toml b/store/Cargo.toml
index fed08fb7..036a8384 100644
--- a/store/Cargo.toml
+++ b/store/Cargo.toml
@@ -33,7 +33,6 @@ compression-bzip2 = ["sequoia-openpgp/compression-bzip2"]
[dependencies]
sequoia-openpgp = { path = "../openpgp", version = "1.0.0", default-features = false }
-sequoia-core = { path = "../core", version = "0.22" }
sequoia-ipc = { path = "../ipc", version = "0.22", default-features = false }
sequoia-net = { path = "../net", version = "0.23", default-features = false }
anyhow = "1.0.18"
diff --git a/store/src/backend/mod.rs b/store/src/backend/mod.rs
index a285d635..2da08201 100644
--- a/store/src/backend/mod.rs
+++ b/store/src/backend/mod.rs
@@ -24,7 +24,7 @@ use tokio_util::compat::Compat;
use crate::openpgp::{self, Cert, KeyID, Fingerprint};
use crate::openpgp::parse::Parse;
use crate::openpgp::serialize::Serialize;
-use sequoia_core as core;
+use sequoia_ipc::core as core;
use sequoia_net as net;
use sequoia_ipc as ipc;
diff --git a/store/src/lib.rs b/store/src/lib.rs
index 7a80e182..ce437669 100644
--- a/store/src/lib.rs
+++ b/store/src/lib.rs
@@ -21,7 +21,7 @@
//! ```
//! # use sequoia_openpgp as openpgp;
//! # use openpgp::Fingerprint;
-//! # use sequoia_core::{Context, IPCPolicy};
+//! # use sequoia_ipc::core::{Context, IPCPolicy};
//! # use sequoia_net as net;
//! # use sequoia_store::*;
//! # fn main() { f().unwrap(); }
@@ -66,15 +66,14 @@ use capnp_rpc::rpc_twoparty_capnp::Side;
use sequoia_openpgp as openpgp;
#[allow(unused_imports)]
-use sequoia_core as core;
-use sequoia_ipc;
+use sequoia_ipc::core as core;
use crate::openpgp::Fingerprint;
use crate::openpgp::KeyID;
use crate::openpgp::Cert;
use crate::openpgp::parse::Parse;
use crate::openpgp::serialize::Serialize;
-use sequoia_core::Context;
+use sequoia_ipc::core::Context;
use sequoia_ipc as ipc;
use sequoia_net as net;
@@ -154,7 +153,7 @@ impl Store {
/// # use sequoia_openpgp as openpgp;
/// # use openpgp::Cert;
/// # use openpgp::parse::Parse;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_store::{Store, Result};
/// # fn main() { f().unwrap(); }
/// # fn f() -> Result<()> {
@@ -187,7 +186,7 @@ impl Store {
/// # use sequoia_openpgp as openpgp;
/// # use openpgp::Cert;
/// # use openpgp::parse::Parse;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_store::{Store, Result};
/// # fn main() { f().unwrap(); }
/// # fn f() -> Result<()> {
@@ -219,7 +218,7 @@ impl Store {
/// # use sequoia_openpgp as openpgp;
/// # use openpgp::Cert;
/// # use openpgp::parse::Parse;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_store::{Store, Result};
/// # fn main() { f().unwrap(); }
/// # fn f() -> Result<()> {
@@ -252,7 +251,7 @@ impl Store {
/// # use sequoia_openpgp as openpgp;
/// # use openpgp::{Cert, KeyID};
/// # use openpgp::parse::Parse;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_store::{Store, Result};
/// # fn main() { f().unwrap(); }
/// # fn f() -> Result<()> {
@@ -366,7 +365,7 @@ impl Mapping {
/// ```
/// # use sequoia_openpgp as openpgp;
/// # use openpgp::Fingerprint;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_net as net;
/// # use sequoia_store::*;
/// # fn main() { f().unwrap(); }
@@ -397,7 +396,7 @@ impl Mapping {
/// # use sequoia_openpgp as openpgp;
/// # use openpgp::Cert;
/// # use openpgp::parse::Parse;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_net as net;
/// # use sequoia_store::*;
/// # fn main() { f().unwrap(); }
@@ -430,7 +429,7 @@ impl Mapping {
/// ```
/// # use sequoia_openpgp as openpgp;
/// # use openpgp::Fingerprint;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_net as net;
/// # use sequoia_store::*;
/// # fn main() { f().unwrap(); }
@@ -467,7 +466,7 @@ impl Mapping {
/// # use sequoia_openpgp as openpgp;
/// # use openpgp::{Cert, KeyID};
/// # use openpgp::parse::Parse;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_net as net;
/// # use sequoia_store::*;
/// # fn main() { f().unwrap(); }
@@ -509,9 +508,9 @@ impl Mapping {
///
/// ```
/// # use sequoia_openpgp as openpgp;
- /// # #[macro_use] use sequoia_core;
+ /// # #[macro_use] use sequoia_ipc::core;
/// # use openpgp::Fingerprint;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_net as net;
/// # use sequoia_store::*;
/// # fn main() { f().unwrap(); }
@@ -603,7 +602,7 @@ impl Binding {
/// ```
/// # use sequoia_openpgp as openpgp;
/// # use openpgp::Fingerprint;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_net as net;
/// # use sequoia_store::*;
/// # fn main() { f().unwrap(); }
@@ -664,10 +663,10 @@ impl Binding {
///
/// ```
/// # use sequoia_openpgp as openpgp;
- /// # #[macro_use] use sequoia_core;
+ /// # #[macro_use] use sequoia_ipc::core;
/// # use openpgp::Cert;
/// # use openpgp::parse::Parse;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_net as net;
/// # use sequoia_store::*;
/// # fn main() { f().unwrap(); }
@@ -719,10 +718,10 @@ impl Binding {
///
/// ```
/// # use sequoia_openpgp as openpgp;
- /// # #[macro_use] use sequoia_core;
+ /// # #[macro_use] use sequoia_ipc::core;
/// # use openpgp::Cert;
/// # use openpgp::parse::Parse;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_net as net;
/// # use sequoia_store::*;
/// # fn main() { f().unwrap(); }
@@ -764,9 +763,9 @@ impl Binding {
///
/// ```
/// # use sequoia_openpgp as openpgp;
- /// # #[macro_use] use sequoia_core;
+ /// # #[macro_use] use sequoia_ipc::core;
/// # use openpgp::Fingerprint;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_net as net;
/// # use sequoia_store::*;
/// # fn main() { f().unwrap(); }
@@ -870,11 +869,11 @@ impl Key {
///
/// ```
/// # use sequoia_openpgp as openpgp;
- /// # #[macro_use] use sequoia_core;
+ /// # #[macro_use] use sequoia_ipc::core;
/// # use openpgp::Fingerprint;
/// # use openpgp::Cert;
/// # use openpgp::parse::Parse;
- /// # use sequoia_core::{Context, IPCPolicy};
+ /// # use sequoia_ipc::core::{Context, IPCPolicy};
/// # use sequoia_net as net;
/// # use sequoia_store::*;
/// # fn main() { f().unwrap(); }
diff --git a/store/tests/ipc-policy.rs b/store/tests/ipc-policy.rs
index e744b036..1ff2d6fe 100644
--- a/store/tests/ipc-policy.rs
+++ b/store/tests/ipc-policy.rs
@@ -1,10 +1,9 @@
-use sequoia_core;
use sequoia_store;
use std::env::current_exe;
use std::path::PathBuf;
-use sequoia_core::{Context, IPCPolicy};
+use sequoia_ipc::core::{Context, IPCPolicy};
use sequoia_store::{Mapping, REALM_CONTACTS};
use sequoia_net as net;