diff --git a/services/identity/Cargo.lock b/services/identity/Cargo.lock --- a/services/identity/Cargo.lock +++ b/services/identity/Cargo.lock @@ -171,6 +171,7 @@ "num-integer", "num-traits", "serde", + "time", "winapi", ] @@ -685,6 +686,7 @@ version = "0.1.0" dependencies = [ "argon2", + "chrono", "clap", "curve25519-dalek", "derive_more", @@ -1521,6 +1523,16 @@ "once_cell", ] +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "tokio" version = "1.18.1" diff --git a/services/identity/Cargo.toml b/services/identity/Cargo.toml --- a/services/identity/Cargo.toml +++ b/services/identity/Cargo.toml @@ -19,6 +19,7 @@ rusoto_dynamodb = "0.47.0" tracing = "0.1" tracing-subscriber = "0.3" +chrono = "0.4.19" [build-dependencies] tonic-build = "0.6" diff --git a/services/identity/src/database.rs b/services/identity/src/database.rs --- a/services/identity/src/database.rs +++ b/services/identity/src/database.rs @@ -1,5 +1,6 @@ use std::collections::HashMap; +use chrono::{DateTime, Utc}; use opaque_ke::{errors::ProtocolError, ServerRegistration}; use rusoto_core::{Region, RusotoError}; use rusoto_dynamodb::{ @@ -10,6 +11,18 @@ use crate::opaque::Cipher; +pub enum AuthType { + Password, + Wallet, +} + +pub struct Token { + pub token: String, + pub created: Option>, + pub auth_type: Option, + pub valid: Option, +} + pub struct DatabaseClient { client: DynamoDbClient, }