Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32603787
D8675.1767437329.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8675.1767437329.diff
View Options
diff --git a/services/identity/src/constants.rs b/services/identity/src/constants.rs
--- a/services/identity/src/constants.rs
+++ b/services/identity/src/constants.rs
@@ -85,6 +85,16 @@
pub const RESERVED_USERNAMES_TABLE: &str = "identity-reserved-usernames";
pub const RESERVED_USERNAMES_TABLE_PARTITION_KEY: &str = "username";
+// One time keys table, which need to exist in their own table to ensure
+// atomicity of additions and removals
+pub mod one_time_keys_table {
+ pub const NAME: &'static str = "identity-one-time-keys";
+ pub const PARTITION_KEY: &'static str = "deviceID";
+ pub const DEVICE_ID: &'static str = PARTITION_KEY;
+ pub const SORT_KEY: &'static str = "oneTimeKey";
+ pub const ONE_TIME_KEY: &'static str = SORT_KEY;
+}
+
// Tokio
pub const MPSC_CHANNEL_BUFFER_CAPACITY: usize = 1;
diff --git a/services/terraform/modules/shared/dynamodb.tf b/services/terraform/modules/shared/dynamodb.tf
--- a/services/terraform/modules/shared/dynamodb.tf
+++ b/services/terraform/modules/shared/dynamodb.tf
@@ -254,6 +254,23 @@
}
}
+resource "aws_dynamodb_table" "identity-onetime-keys" {
+ name = "identity-onetime-keys"
+ hash_key = "deviceID"
+ range_key = "oneTimeKey"
+ billing_mode = "PAY_PER_REQUEST"
+
+ attribute {
+ name = "deviceID"
+ type = "S"
+ }
+
+ attribute {
+ name = "oneTimeKey"
+ type = "S"
+ }
+}
+
resource "aws_dynamodb_table" "feature-flags" {
name = "feature-flags"
hash_key = "platform"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 3, 10:48 AM (2 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5887967
Default Alt Text
D8675.1767437329.diff (1 KB)
Attached To
Mode
D8675: [Identity] Add DDB table for one-time-keys
Attached
Detach File
Event Timeline
Log In to Comment