mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-13 06:50:46 +08:00
The motivation of this change is to move away from tying signing to be specifically for ed25519. The reason being that the protocol will want move towards two different kinds of signing – the node signing artifacts, and an author signing artifacts. This change captures the former, node signing, by introducing a `Device` type that is the `NodeId` – a PublicKey underneath the hood – and a signing mechanism. This allows the replacement of the `Signer` trait being used – which always assumed a `PublicKey`. Instead, the `Device` is constructed with `NodeId`. In `radicle-cob`, a signer is expected to implement `signature::Signer<ExtendedSignature>`, and everywhere in `radicle`, `radicle-node`, `radicle-cli`, and `radicle-remote-helper` is expected the signer is expected to implement `signature::Signer<Signature>`. A `Device` implements both of these but only requires `signature::Signer<Signature>` to do so – since an `ExtendedSignature` is essentially `(PublicKey, Signature)`, and the `NodeId` of the `Device` can be used.
47 lines
1.4 KiB
Rust
47 lines
1.4 KiB
Rust
// N.b. Rust 1.85 introduced some annoying clippy warnings about using `b""`
|
|
// syntax in place of `b''`, but in our cases they were u8 and not [u8] so the
|
|
// suggestions did not make sense.
|
|
#![allow(clippy::byte_char_slices)]
|
|
|
|
pub mod bounded;
|
|
pub mod control;
|
|
pub mod deserializer;
|
|
pub mod runtime;
|
|
pub mod service;
|
|
#[cfg(any(test, feature = "test"))]
|
|
pub mod test;
|
|
#[cfg(test)]
|
|
pub mod tests;
|
|
pub mod wire;
|
|
pub mod worker;
|
|
|
|
use radicle::version::Version;
|
|
|
|
pub use localtime::{LocalDuration, LocalTime};
|
|
pub use netservices::Direction as Link;
|
|
pub use radicle::node::PROTOCOL_VERSION;
|
|
pub use radicle::prelude::Timestamp;
|
|
pub use radicle::{collections, crypto, git, identity, node, profile, rad, storage};
|
|
pub use runtime::Runtime;
|
|
|
|
/// Node version.
|
|
pub const VERSION: Version = Version {
|
|
name: env!("CARGO_PKG_NAME"),
|
|
commit: env!("GIT_HEAD"),
|
|
version: env!("RADICLE_VERSION"),
|
|
timestamp: env!("SOURCE_DATE_EPOCH"),
|
|
};
|
|
|
|
pub mod prelude {
|
|
pub use crate::bounded::BoundedVec;
|
|
pub use crate::crypto::{PublicKey, Signature};
|
|
pub use crate::deserializer::Deserializer;
|
|
pub use crate::identity::{Did, RepoId};
|
|
pub use crate::node::Address;
|
|
pub use crate::service::filter::Filter;
|
|
pub use crate::service::{DisconnectReason, Event, Message, Network, NodeId};
|
|
pub use crate::storage::refs::Refs;
|
|
pub use crate::storage::WriteStorage;
|
|
pub use crate::{LocalDuration, LocalTime, Timestamp};
|
|
}
|