Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3390947
D4656.id15069.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
738 B
Referenced Files
None
Subscribers
None
D4656.id15069.diff
View Options
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
@@ -400,6 +400,25 @@
}
}
+fn parse_string_attribute(
+ attribute_name: &'static str,
+ attribute_value: Option<AttributeValue>,
+) -> Result<String, DBItemError> {
+ match attribute_value {
+ Some(AttributeValue::S(user_id)) => Ok(user_id),
+ Some(_) => Err(DBItemError::new(
+ attribute_name,
+ attribute_value,
+ DBItemAttributeError::IncorrectType,
+ )),
+ None => Err(DBItemError::new(
+ attribute_name,
+ attribute_value,
+ DBItemAttributeError::Missing,
+ )),
+ }
+}
+
#[cfg(test)]
mod tests {
use super::*;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 1, 1:40 AM (22 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2603197
Default Alt Text
D4656.id15069.diff (738 B)
Attached To
Mode
D4656: [services] Helper function to parse userID from AttributeValue
Attached
Detach File
Event Timeline
Log In to Comment