crypto: Depend on `git-ref-format-core` only
The `git-ref-format-core` crate is enough to implement everything required by `radicle-crypto`, and has a much smaller dependency footprint than `radicle-git-ext`. Notably, it does not depend on `git2` and also does not depend on procedural macros.
This commit is contained in:
parent
ac572e64e5
commit
b25d80d272
|
|
@ -2896,10 +2896,10 @@ dependencies = [
|
||||||
"cyphernet",
|
"cyphernet",
|
||||||
"ec25519",
|
"ec25519",
|
||||||
"fastrand",
|
"fastrand",
|
||||||
|
"git-ref-format-core",
|
||||||
"multibase",
|
"multibase",
|
||||||
"qcheck",
|
"qcheck",
|
||||||
"qcheck-macros",
|
"qcheck-macros",
|
||||||
"radicle-git-ext",
|
|
||||||
"radicle-ssh",
|
"radicle-ssh",
|
||||||
"serde",
|
"serde",
|
||||||
"signature 2.2.0",
|
"signature 2.2.0",
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ crossbeam-channel = "0.5.6"
|
||||||
cyphernet = "0.5.2"
|
cyphernet = "0.5.2"
|
||||||
dunce = "1.0.5"
|
dunce = "1.0.5"
|
||||||
fastrand = { version = "2.0.0", default-features = false }
|
fastrand = { version = "2.0.0", default-features = false }
|
||||||
|
git-ref-format-core = { version = "0.3.0", default-features = false }
|
||||||
git2 = { version = "0.19.0", default-features = false }
|
git2 = { version = "0.19.0", default-features = false }
|
||||||
human-panic = "2"
|
human-panic = "2"
|
||||||
itertools = "0.14"
|
itertools = "0.14"
|
||||||
|
|
|
||||||
|
|
@ -35,5 +35,5 @@ thiserror = { workspace = true }
|
||||||
fastrand = { workspace = true }
|
fastrand = { workspace = true }
|
||||||
qcheck = { workspace = true }
|
qcheck = { workspace = true }
|
||||||
qcheck-macros = { workspace = true }
|
qcheck-macros = { workspace = true }
|
||||||
radicle-crypto = { workspace = true, features = ["test", "radicle-git-ext"] }
|
radicle-crypto = { workspace = true, features = ["test", "git-ref-format-core"] }
|
||||||
tempfile = { workspace = true }
|
tempfile = { workspace = true }
|
||||||
|
|
@ -23,7 +23,7 @@ ec25519 = "0.1.0"
|
||||||
fastrand = { workspace = true, optional = true }
|
fastrand = { workspace = true, optional = true }
|
||||||
multibase = { workspace = true }
|
multibase = { workspace = true }
|
||||||
qcheck = { workspace = true, optional = true }
|
qcheck = { workspace = true, optional = true }
|
||||||
radicle-git-ext = { workspace = true, optional = true }
|
git-ref-format-core = { workspace = true, optional = true }
|
||||||
radicle-ssh = { workspace = true, optional = true }
|
radicle-ssh = { workspace = true, optional = true }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
signature = { workspace = true }
|
signature = { workspace = true }
|
||||||
|
|
|
||||||
|
|
@ -353,20 +353,20 @@ impl PublicKey {
|
||||||
multibase::encode(multibase::Base::Base58Btc, buf)
|
multibase::encode(multibase::Base::Base58Btc, buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "radicle-git-ext")]
|
#[cfg(feature = "git-ref-format-core")]
|
||||||
pub fn to_namespace(&self) -> radicle_git_ext::ref_format::RefString {
|
pub fn to_namespace(&self) -> git_ref_format_core::RefString {
|
||||||
use radicle_git_ext::ref_format::{refname, Component};
|
use git_ref_format_core::name::{Component, NAMESPACES, REFS};
|
||||||
refname!("refs/namespaces").join(Component::from(self))
|
REFS.to_owned().and(NAMESPACES).and(Component::from(self))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "radicle-git-ext")]
|
#[cfg(feature = "git-ref-format-core")]
|
||||||
pub fn to_component(&self) -> radicle_git_ext::ref_format::Component {
|
pub fn to_component(&self) -> git_ref_format_core::Component {
|
||||||
radicle_git_ext::ref_format::Component::from(self)
|
git_ref_format_core::Component::from(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "radicle-git-ext")]
|
#[cfg(feature = "git-ref-format-core")]
|
||||||
pub fn from_namespaced(
|
pub fn from_namespaced(
|
||||||
refstr: &radicle_git_ext::ref_format::Namespaced,
|
refstr: &git_ref_format_core::Namespaced,
|
||||||
) -> Result<Self, PublicKeyError> {
|
) -> Result<Self, PublicKeyError> {
|
||||||
let name = refstr.namespace().into_inner();
|
let name = refstr.namespace().into_inner();
|
||||||
|
|
||||||
|
|
@ -406,10 +406,10 @@ impl Deref for PublicKey {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "radicle-git-ext")]
|
#[cfg(feature = "git-ref-format-core")]
|
||||||
impl From<&PublicKey> for radicle_git_ext::ref_format::Component<'_> {
|
impl From<&PublicKey> for git_ref_format_core::Component<'_> {
|
||||||
fn from(id: &PublicKey) -> Self {
|
fn from(id: &PublicKey) -> Self {
|
||||||
use radicle_git_ext::ref_format::{Component, RefString};
|
use git_ref_format_core::{Component, RefString};
|
||||||
let refstr =
|
let refstr =
|
||||||
RefString::try_from(id.to_string()).expect("encoded public keys are valid ref strings");
|
RefString::try_from(id.to_string()).expect("encoded public keys are valid ref strings");
|
||||||
Component::from_refstr(refstr).expect("encoded public keys are valid refname components")
|
Component::from_refstr(refstr).expect("encoded public keys are valid refname components")
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ multibase = { workspace = true }
|
||||||
nonempty = { workspace = true, features = ["serialize"] }
|
nonempty = { workspace = true, features = ["serialize"] }
|
||||||
qcheck = { workspace = true, optional = true }
|
qcheck = { workspace = true, optional = true }
|
||||||
radicle-cob = { workspace = true }
|
radicle-cob = { workspace = true }
|
||||||
radicle-crypto = { workspace = true, features = ["radicle-git-ext", "ssh", "sqlite", "cyphernet"] }
|
radicle-crypto = { workspace = true, features = ["git-ref-format-core", "ssh", "sqlite", "cyphernet"] }
|
||||||
radicle-git-ext = { workspace = true, features = ["serde"] }
|
radicle-git-ext = { workspace = true, features = ["serde"] }
|
||||||
radicle-ssh = { workspace = true }
|
radicle-ssh = { workspace = true }
|
||||||
schemars = { workspace = true, optional = true }
|
schemars = { workspace = true, optional = true }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue