diff options
author | Katharina Fey <kookie@spacekookie.de> | 2018-07-02 00:02:22 +0200 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2018-07-02 00:02:22 +0200 |
commit | 99ff8f0ebae37069de690936f79c4d599851f952 (patch) | |
tree | 06d33db20cdd065e74334fef20096806a5b4f5d9 /lockchain-http | |
parent | d99d8bb4d9fb695f15256a8fe9a85136959e556b (diff) |
Big code change & refactoring commit
Move `token` into user module for lockchain-core. Start work on
a PAM authentication module which replaces the second layer
UserStore in API layer state (http being the only one for now).
This brings the `nix` and `pam-auth` dependencies, which unfortunately
currently don't work :(
Diffstat (limited to 'lockchain-http')
-rw-r--r-- | lockchain-http/src/state.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lockchain-http/src/state.rs b/lockchain-http/src/state.rs index 9a5b4ba..650660f 100644 --- a/lockchain-http/src/state.rs +++ b/lockchain-http/src/state.rs @@ -1,5 +1,4 @@ use lockchain::traits::{AutoEncoder, Body, FileIO, Vault}; -use lockchain::users::{User, UserStore}; use std::collections::HashMap; use std::marker::PhantomData; @@ -34,14 +33,14 @@ where #[doc(hidden)] pub vaults: HashMap<String, Option<V>>, #[doc(hidden)] - pub users: UserStore, - #[doc(hidden)] pub _phantom: PhantomData<B>, /// Signal if the API handlers are allowed outside their working dir pub bound_scope: bool, /// Provide a working directory pub working_dir: PathBuf, + /// Completely disabe administrative actions + pub administrative: bool, } impl<B, V> ApiState<B, V> @@ -88,7 +87,7 @@ where _phantom: PhantomData, bound_scope: true, vaults: HashMap::new(), - users: Default::default(), + administrative: false, ..Default::default() } } @@ -97,7 +96,6 @@ where #[derive(Serialize, Deserialize)] struct SerializedState { vaults: Vec<String>, - users: Vec<User>, } impl AutoEncoder for SerializedState {} @@ -112,7 +110,6 @@ where fn from(me: &'state ApiState<B, V>) -> Self { Self { vaults: me.vaults.iter().map(|(k, _)| k.clone()).collect(), - users: me.users.get_all().iter().map(|(_, v)| v.clone()).collect(), } } } |