From c1806bf092cafa5ad8247fb596665a5cb0e5fae1 Mon Sep 17 00:00:00 2001 From: "Aode (lion)" Date: Mon, 22 Nov 2021 14:00:31 -0600 Subject: [PATCH] Re-export in facade crate --- Cargo.toml | 19 +++++++++++++++++++ src/lib.rs | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index cdb90ee..149a5b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,26 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = ["utils"] +actix-web = ["apub-actix-web"] +awc = ["apub-awc"] +background-jobs = ["apub-background-jobs"] +openssl = ["apub-openssl"] +reqwest = ["apub-reqwest"] +rustcrypto = ["apub-rustcrypto"] +utils = ["apub-breaker-session", "apub-deref-client"] + [dependencies] +apub-actix-web = { version = "0.1.0", path = "./apub-actix-web/", optional = true } +apub-awc = { version = "0.1.0", path = "./apub-awc/", optional = true } +apub-background-jobs = { version = "0.1.0", path = "./apub-background-jobs/", optional = true } +apub-breaker-session = { version = "0.1.0", path = "./apub-breaker-session/", optional = true } +apub-core = { version = "0.1.0", path = "./apub-core/" } +apub-deref-client = { version = "0.1.0", path = "./apub-deref-client/", optional = true } +apub-openssl = { version = "0.1.0", path = "./apub-openssl/", optional = true } +apub-reqwest = { version = "0.1.0", path = "./apub-reqwest/", optional = true } +apub-rustcrypto = { version = "0.1.0", path = "./apub-rustcrypto/", optional = true } [workspace] members = [ diff --git a/src/lib.rs b/src/lib.rs index e69de29..86f77e4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -0,0 +1,55 @@ +pub mod clients { + pub use apub_core::deliver::{Activity, Client}; + pub use apub_core::deref::{Dereference, Repo}; + pub use apub_core::object_id::ObjectId; + + #[cfg(feature = "apub-deref-client")] + pub use apub_deref_client::{Client as CombinedClient, Error as CombinedError}; + + #[cfg(feature = "apub-awc")] + pub use apub_awc::{ + AwcClient, AwcError, SignatureConfig as AwcSignatureConfig, + SignatureError as AwcSignatureError, + }; + + #[cfg(feature = "apub-reqwest")] + pub use apub_reqwest::{ + ReqwestClient, ReqwestError, SignatureConfig as ReqwestSignatureConfig, + SignatureError as ReqwestSignatureError, + }; +} + +pub mod servers { + pub use apub_core::ingest::Ingest; + + #[cfg(feature = "apub-actix-web")] + pub use apub_actix_web::{ + inbox, serve_objects, RepoFactory, RepoFactoryX, + SignatureConfig as ActixWebSignatureConfig, Verifier, VerifyError, + }; +} + +pub mod background { + #[cfg(feature = "apub-background-jobs")] + pub use apub_background_jobs::{ + client, queue_deliver, ClientFactory, DeliverJob, EnqueueError, JobClient, + }; +} + +pub mod session { + pub use apub_core::session::{RequestCountSession, Session, SessionError}; + + #[cfg(feature = "apub-breaker-session")] + pub use apub_breaker_session::BreakerSession; +} + +pub mod crypto { + pub use apub_core::digest::{Digest, DigestBuilder, DigestFactory}; + pub use apub_core::signature::{Sign, SignFactory, Verify, VerifyBuilder}; + + #[cfg(feature = "apub-openssl")] + pub use apub_openssl::{OpenSsl, OpenSslDigest, OpenSslSigner, OpenSslVerifier}; + + #[cfg(feature = "apub-rustcrypto")] + pub use apub_rustcrypto::{RsaSigner, RsaVerifier, Rustcrypto, RustcryptoError, Sha256Digest}; +}