Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3538421
D12909.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
991 B
Referenced Files
None
Subscribers
None
D12909.diff
View Options
diff --git a/services/tunnelbroker/src/database/mod.rs b/services/tunnelbroker/src/database/mod.rs
--- a/services/tunnelbroker/src/database/mod.rs
+++ b/services/tunnelbroker/src/database/mod.rs
@@ -257,4 +257,33 @@
Ok(())
}
+
+ pub async fn mark_device_token_as_invalid(
+ &self,
+ device_id: &str,
+ ) -> Result<(), Error> {
+ let update_expression =
+ format!("SET {0} = :val", device_tokens::TOKEN_INVALID);
+
+ self
+ .client
+ .update_item()
+ .table_name(device_tokens::TABLE_NAME)
+ .key(
+ device_tokens::DEVICE_ID,
+ AttributeValue::S(device_id.to_string()),
+ )
+ .update_expression(update_expression)
+ .expression_attribute_values(":val", AttributeValue::Bool(true))
+ .send()
+ .await
+ .map_err(|e| {
+ error!(
+ "DynamoDB client failed to mark device token as invalid {:?}",
+ e
+ );
+ Error::AwsSdk(e.into())
+ })?;
+ Ok(())
+ }
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 10:53 PM (9 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2709317
Default Alt Text
D12909.diff (991 B)
Attached To
Mode
D12909: [Tunnelbroker] implement marking device token ad invalid
Attached
Detach File
Event Timeline
Log In to Comment