mirror of
https://github.com/fluencelabs/trust-graph
synced 2025-03-15 12:50:48 +00:00
move identity to separate package
This commit is contained in:
parent
e8c109df99
commit
dd761dd61c
18
Cargo.lock
generated
18
Cargo.lock
generated
@ -356,6 +356,23 @@ dependencies = [
|
|||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fluence-identity"
|
||||||
|
version = "0.2.0"
|
||||||
|
dependencies = [
|
||||||
|
"bs58 0.3.1",
|
||||||
|
"derivative",
|
||||||
|
"ed25519-dalek",
|
||||||
|
"failure",
|
||||||
|
"fluence-fork-libp2p-core",
|
||||||
|
"log",
|
||||||
|
"rand 0.7.3",
|
||||||
|
"ref-cast",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"signature",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fnv"
|
name = "fnv"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
@ -1325,6 +1342,7 @@ dependencies = [
|
|||||||
"ed25519-dalek",
|
"ed25519-dalek",
|
||||||
"failure",
|
"failure",
|
||||||
"fluence-fork-libp2p-core",
|
"fluence-fork-libp2p-core",
|
||||||
|
"fluence-identity",
|
||||||
"log",
|
"log",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"ref-cast",
|
"ref-cast",
|
||||||
|
@ -9,6 +9,7 @@ license = "Apache-2.0"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
libp2p-core = { package = "fluence-fork-libp2p-core", version = "0.26.0" }
|
libp2p-core = { package = "fluence-fork-libp2p-core", version = "0.26.0" }
|
||||||
serde = { version = "=1.0.118", features = ["derive"] }
|
serde = { version = "=1.0.118", features = ["derive"] }
|
||||||
|
fluence-identity = { path = "identity" }
|
||||||
serde_json = "1.0.58"
|
serde_json = "1.0.58"
|
||||||
bs58 = "0.3.1"
|
bs58 = "0.3.1"
|
||||||
failure = "0.1.6"
|
failure = "0.1.6"
|
||||||
|
18
bin/Cargo.lock
generated
18
bin/Cargo.lock
generated
@ -366,6 +366,23 @@ dependencies = [
|
|||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fluence-identity"
|
||||||
|
version = "0.2.0"
|
||||||
|
dependencies = [
|
||||||
|
"bs58 0.3.1",
|
||||||
|
"derivative",
|
||||||
|
"ed25519-dalek",
|
||||||
|
"failure",
|
||||||
|
"fluence-fork-libp2p-core",
|
||||||
|
"log",
|
||||||
|
"rand 0.7.3",
|
||||||
|
"ref-cast",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"signature",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fluence-sdk-macro"
|
name = "fluence-sdk-macro"
|
||||||
version = "0.2.18"
|
version = "0.2.18"
|
||||||
@ -1369,6 +1386,7 @@ dependencies = [
|
|||||||
"ed25519-dalek",
|
"ed25519-dalek",
|
||||||
"failure",
|
"failure",
|
||||||
"fluence-fork-libp2p-core",
|
"fluence-fork-libp2p-core",
|
||||||
|
"fluence-identity",
|
||||||
"log",
|
"log",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"ref-cast",
|
"ref-cast",
|
||||||
|
20
identity/Cargo.toml
Normal file
20
identity/Cargo.toml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
[package]
|
||||||
|
name = "fluence-identity"
|
||||||
|
version = "0.2.0"
|
||||||
|
authors = ["Fluence Labs"]
|
||||||
|
edition = "2018"
|
||||||
|
description = "identity"
|
||||||
|
license = "Apache-2.0"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
libp2p-core = { package = "fluence-fork-libp2p-core", version = "0.26.0" }
|
||||||
|
serde = { version = "=1.0.118", features = ["derive"] }
|
||||||
|
serde_json = "1.0.58"
|
||||||
|
bs58 = "0.3.1"
|
||||||
|
failure = "0.1.6"
|
||||||
|
log = "0.4.11"
|
||||||
|
ref-cast = "1.0.2"
|
||||||
|
derivative = "2.1.1"
|
||||||
|
ed25519-dalek = "1.0.1"
|
||||||
|
rand = "0.7.0"
|
||||||
|
signature = "1.3.0"
|
33
identity/src/lib.rs
Normal file
33
identity/src/lib.rs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2020 Fluence Labs Limited
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#![recursion_limit = "512"]
|
||||||
|
#![warn(rust_2018_idioms)]
|
||||||
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
nonstandard_style,
|
||||||
|
unused_imports,
|
||||||
|
unused_mut,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
|
|
||||||
|
pub mod key_pair;
|
||||||
|
|
||||||
|
pub use key_pair::KeyPair;
|
||||||
|
|
||||||
|
pub(crate) use libp2p_core::identity::ed25519;
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use ed25519_dalek::PublicKey;
|
use ed25519_dalek::PublicKey;
|
||||||
use crate::key_pair::KeyPair;
|
use fluence_identity::key_pair::KeyPair;
|
||||||
use crate::trust::{Trust, TRUST_LEN};
|
use crate::trust::{Trust, TRUST_LEN};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
@ -237,7 +237,7 @@ mod tests {
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::misc::current_time;
|
use crate::misc::current_time;
|
||||||
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||||
use crate::key_pair::KeyPair;
|
use fluence_identity::key_pair::KeyPair;
|
||||||
|
|
||||||
pub fn one_second() -> Duration {
|
pub fn one_second() -> Duration {
|
||||||
Duration::from_secs(1)
|
Duration::from_secs(1)
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
mod certificate;
|
mod certificate;
|
||||||
pub mod certificate_serde;
|
pub mod certificate_serde;
|
||||||
mod key_pair;
|
|
||||||
mod misc;
|
mod misc;
|
||||||
mod public_key_hashable;
|
mod public_key_hashable;
|
||||||
mod revoke;
|
mod revoke;
|
||||||
@ -37,10 +36,7 @@ mod trust_graph;
|
|||||||
mod trust_graph_storage;
|
mod trust_graph_storage;
|
||||||
mod trust_node;
|
mod trust_node;
|
||||||
|
|
||||||
pub(crate) use libp2p_core::identity::ed25519;
|
|
||||||
|
|
||||||
pub use crate::certificate::Certificate;
|
pub use crate::certificate::Certificate;
|
||||||
pub use crate::key_pair::KeyPair;
|
|
||||||
pub use crate::misc::current_time;
|
pub use crate::misc::current_time;
|
||||||
pub use crate::public_key_hashable::PublicKeyHashable;
|
pub use crate::public_key_hashable::PublicKeyHashable;
|
||||||
pub use crate::trust::Trust;
|
pub use crate::trust::Trust;
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use ed25519_dalek::PublicKey;
|
use ed25519_dalek::PublicKey;
|
||||||
use crate::key_pair::KeyPair;
|
use fluence_identity::key_pair::KeyPair;
|
||||||
use crate::key_pair::Signature;
|
use fluence_identity::key_pair::Signature;
|
||||||
use crate::trust::{EXPIRATION_LEN, PK_LEN};
|
use crate::trust::{EXPIRATION_LEN, PK_LEN};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use ed25519_dalek::{PublicKey};
|
use ed25519_dalek::{PublicKey};
|
||||||
use crate::key_pair::{KeyPair, Signature};
|
use fluence_identity::key_pair::{KeyPair, Signature};
|
||||||
use derivative::Derivative;
|
use derivative::Derivative;
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
@ -279,7 +279,7 @@ impl TrustGraph {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::key_pair::KeyPair;
|
use fluence_identity::key_pair::KeyPair;
|
||||||
use crate::misc::current_time;
|
use crate::misc::current_time;
|
||||||
use crate::trust_graph_storage::InMemoryStorage;
|
use crate::trust_graph_storage::InMemoryStorage;
|
||||||
use failure::_core::time::Duration;
|
use failure::_core::time::Duration;
|
||||||
|
@ -150,7 +150,7 @@ impl TrustNode {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use crate::key_pair::KeyPair;
|
use fluence_identity::key_pair::KeyPair;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user