aboutsummaryrefslogtreecommitdiff
path: root/lockchain-core/src/users/userstore.rs
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2018-09-16 11:03:38 +0100
committerKatharina Fey <kookie@spacekookie.de>2018-09-16 11:03:38 +0100
commit39a9b4ab3f1ab8a4c79962e1de78204faaf10abe (patch)
tree9cec5f02cc8d227eeb0a2c81b3d6761ffd6aed65 /lockchain-core/src/users/userstore.rs
parentb257bdaefe633ebb72590aac2b7f504af51ba23e (diff)
Only relying on the `UserStore` `AutoEncoder` impl for serialisation
Diffstat (limited to 'lockchain-core/src/users/userstore.rs')
-rw-r--r--lockchain-core/src/users/userstore.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/lockchain-core/src/users/userstore.rs b/lockchain-core/src/users/userstore.rs
index 483c4ee..5355cdb 100644
--- a/lockchain-core/src/users/userstore.rs
+++ b/lockchain-core/src/users/userstore.rs
@@ -3,20 +3,26 @@
use super::rights::Access;
use crypto::Key;
use std::collections::HashMap;
+use traits::AutoEncoder;
/// A thin user UserStore
///
/// It's implementation can manage multiple keys per user, of various
/// types and constrained for limited access rights.
+#[derive(Serialize, Deserialize)]
pub struct UserStore {
store: HashMap<String, StoreUser>,
}
-struct StoreUser {
+/// Internal store user structure
+#[derive(Serialize, Deserialize)]
+pub struct StoreUser {
name: String,
keys: HashMap<Access, Key>,
}
+impl AutoEncoder for UserStore {}
+
impl UserStore {
/// Create a new, empty UserStore
///