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/main.rs b/services/identity/src/main.rs --- a/services/identity/src/main.rs +++ b/services/identity/src/main.rs @@ -9,6 +9,7 @@ mod keygen; mod opaque; mod service; +mod token; use config::Config; use keygen::generate_and_persist_keypair; diff --git a/services/identity/src/token.rs b/services/identity/src/token.rs new file mode 100644 --- /dev/null +++ b/services/identity/src/token.rs @@ -0,0 +1,13 @@ +use chrono::{DateTime, Utc}; + +pub enum AuthType { + Password, + Wallet, +} + +pub struct AccessToken { + pub token: Option, + pub created: Option>, + pub auth_type: Option, + pub valid: Option, +}