Clippy goodness.

This commit is contained in:
Ximon Eighteen
2020-12-30 15:46:08 +01:00
parent 8bc43d7640
commit de5fa9f9ce
4 changed files with 6 additions and 7 deletions
+2 -2
View File
@@ -168,7 +168,7 @@ impl Authorizer {
/// Submit credentials directly to the configured provider to establish a
/// login session, if supported by the configured provider.
pub fn login(&self, request: &hyper::Request<hyper::Body>) -> KrillResult<LoggedInUser> {
self.primary_provider.login(request).and_then(|user| {
self.primary_provider.login(request).map(|user| {
let visible_attributes = user
.attributes
.clone()
@@ -188,7 +188,7 @@ impl Authorizer {
info!("User logged in: {}", &user.id);
}
Ok(user)
user
})
}
-1
View File
@@ -1,6 +1,5 @@
use std::{
collections::HashMap,
io,
sync::RwLock,
time::{Duration, SystemTime, UNIX_EPOCH},
};
@@ -92,7 +92,7 @@ impl AuthProvider for ConfigFileAuthProvider {
Some(token) => {
// see if we can decode, decrypt and deserialize the users token
// into a login session structure
let session = self.session_cache.decode(token.clone(), &self.key)?;
let session = self.session_cache.decode(token, &self.key)?;
trace!("id={}, attributes={:?}", &session.id, &session.attributes);
@@ -113,11 +113,11 @@ impl AuthProvider for ConfigFileAuthProvider {
if user.password_hash == password_hash {
let api_token = self.session_cache.encode(&id, &user.attributes, &[], &self.key, None)?;
return Ok(LoggedInUser {
Ok(LoggedInUser {
token: api_token,
id: id.to_string(),
attributes: user.attributes.clone(),
});
})
} else {
Err(Error::ApiInvalidCredentials("Incorrect password".to_string()))
}
@@ -483,7 +483,7 @@ impl AuthProvider for OpenIDConnectAuthProvider {
Some(token) => {
// see if we can decode, decrypt and deserialize the users token
// into a login session structure
let session = self.session_cache.decode(token.clone(), &self.session_key)?;
let session = self.session_cache.decode(token, &self.session_key)?;
let status = session.status();