diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 6a082938c..6d92bbab7 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -25,6 +25,7 @@ - Yuxuan Lu (leoleoasd) - h7x4 - Pi-Cla +- Sebastiano Tocci(Seba-T) ## Acknowledgements diff --git a/server/core/src/actors/v1_read.rs b/server/core/src/actors/v1_read.rs index be6853d0d..4474664a3 100644 --- a/server/core/src/actors/v1_read.rs +++ b/server/core/src/actors/v1_read.rs @@ -284,7 +284,6 @@ impl QueryServerReadV1 { uat: Option, eventid: Uuid, ) -> Result { - // TODO #62: Move this to IdmServer!!! // Begin a read let ct = duration_from_epoch_now(); let mut idms_prox_read = self.idms.proxy_read().await; @@ -301,7 +300,6 @@ impl QueryServerReadV1 { admin_error!(?e, "Invalid identity"); e })?; - let srch = SearchEvent::from_whoami_request(ident, &idms_prox_read.qs_read).map_err(|e| { admin_error!(?e, "Failed to begin whoami"); diff --git a/server/lib/src/value.rs b/server/lib/src/value.rs index 94f8ba1d6..098f53b68 100644 --- a/server/lib/src/value.rs +++ b/server/lib/src/value.rs @@ -8,9 +8,11 @@ use crate::prelude::*; use std::collections::BTreeSet; use std::convert::TryFrom; use std::fmt; +use std::fmt::Formatter; use std::str::FromStr; use std::time::Duration; +use crate::valueset::uuid_to_proto_string; #[cfg(test)] use base64::{engine::general_purpose, Engine as _}; use compact_jwt::JwsSigner; @@ -766,7 +768,7 @@ impl TryInto for SessionScope { } } -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq)] pub struct Session { pub label: String, pub expiry: Option, @@ -776,6 +778,25 @@ pub struct Session { pub scope: SessionScope, } +impl fmt::Debug for Session { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + let issuer = match self.issued_by { + IdentityId::User(u) => format!("User - {}", uuid_to_proto_string(u)), + IdentityId::Synch(u) => format!("Synch - {}", uuid_to_proto_string(u)), + IdentityId::Internal => "Internal".to_string(), + }; + let expiry = match self.expiry { + Some(e) => e.to_string(), + None => "never".to_string(), + }; + write!( + f, + "expiry: {}, issued at: {}, issued by: {}, credential id: {}, scope: {:?}", + expiry, self.issued_at, issuer, self.cred_id, self.scope + ) + } +} + #[derive(Clone, Debug, PartialEq, Eq)] pub struct Oauth2Session { pub parent: Uuid,