aboutsummaryrefslogtreecommitdiff
path: root/src/login/mod.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-19 12:10:48 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-19 12:10:48 +0200
commitc7f767b7d2877cdbbc06893c9cd0fae2c56b96f2 (patch)
tree0fe8afca226ff90dd0fd20985d8216fdb30c8146 /src/login/mod.rs
parent8bd59a8f836d39f89d7e064928949034bec093de (diff)
downloadaerogramme-c7f767b7d2877cdbbc06893c9cd0fae2c56b96f2.tar.gz
aerogramme-c7f767b7d2877cdbbc06893c9cd0fae2c56b96f2.zip
More construction of things
Diffstat (limited to 'src/login/mod.rs')
-rw-r--r--src/login/mod.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/login/mod.rs b/src/login/mod.rs
new file mode 100644
index 0000000..5637e8a
--- /dev/null
+++ b/src/login/mod.rs
@@ -0,0 +1,20 @@
+pub mod ldap_provider;
+pub mod static_provider;
+
+use anyhow::Result;
+use async_trait::async_trait;
+
+use crate::cryptoblob::Key as SymmetricKey;
+
+#[derive(Clone, Debug)]
+pub struct Credentials {
+ pub aws_access_key_id: String,
+ pub aws_secret_access_key: String,
+ pub bucket: String,
+ pub master_key: SymmetricKey,
+}
+
+#[async_trait]
+pub trait LoginProvider {
+ async fn login(&self, username: &str, password: &str) -> Result<Credentials>;
+}