Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3113788
D3945.id12353.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3945.id12353.diff
View Options
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<DateTime<Utc>>,
+ pub auth_type: Option<AuthType>,
+ pub valid: Option<bool>,
+}
+
pub struct DatabaseClient {
client: DynamoDbClient,
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 1, 7:17 PM (20 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2400550
Default Alt Text
D3945.id12353.diff (1 KB)
Attached To
Mode
D3945: [Identity] Add new types to handle tokens
Attached
Detach File
Event Timeline
Log In to Comment