Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3347493
D4279.id.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
D4279.id.diff
View Options
diff --git a/services/identity/src/config.rs b/services/identity/src/config.rs
--- a/services/identity/src/config.rs
+++ b/services/identity/src/config.rs
@@ -31,5 +31,5 @@
fn get_key_from_file<P: AsRef<Path>>(path: P) -> Result<Key, Error> {
let bytes = fs::read(path)?;
- Key::from_bytes(&bytes).map_err(|e| Error::Pake(e))
+ Key::from_bytes(&bytes).map_err(Error::Pake)
}
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
@@ -134,12 +134,12 @@
let valid = parse_valid_attribute(item.remove("valid"))?;
let token = parse_token_attribute(item.remove("token"))?;
Ok(Some(AccessToken {
- user_id: user_id,
- device_id: device_id,
- token: token,
- created: created,
- auth_type: auth_type,
- valid: valid,
+ user_id,
+ device_id,
+ token,
+ created,
+ auth_type,
+ valid,
}))
}
Ok(_) => {
@@ -272,7 +272,7 @@
s: Some(created), ..
}) = attribute
{
- created.parse().map_err(|e| Error::InvalidTimestamp(e))
+ created.parse().map_err(Error::InvalidTimestamp)
} else {
Err(Error::MissingAttribute)
}
diff --git a/services/identity/src/token.rs b/services/identity/src/token.rs
--- a/services/identity/src/token.rs
+++ b/services/identity/src/token.rs
@@ -26,11 +26,11 @@
rng: &mut (impl Rng + CryptoRng),
) -> Self {
AccessToken {
- user_id: user_id,
- device_id: device_id,
+ user_id,
+ device_id,
token: Alphanumeric.sample_string(rng, 512),
created: Utc::now(),
- auth_type: auth_type,
+ auth_type,
valid: true,
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 12:27 PM (18 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2570550
Default Alt Text
D4279.id.diff (1 KB)
Attached To
Mode
D4279: [services][identity] clean up some redundancies
Attached
Detach File
Event Timeline
Log In to Comment