From eddec88429ac6307fa8dab87771b4edd52d1c905 Mon Sep 17 00:00:00 2001 From: James Hodgkinson Date: Mon, 15 Jul 2024 03:28:23 -0700 Subject: [PATCH] making the internals of kanidmclientconfig public for other users (#2895) * making the internals of kanidmclientconfig public for other users * clippyisms --- libs/client/src/lib.rs | 6 ++++-- server/lib/src/idm/authsession.rs | 6 +++--- server/lib/src/valueset/session.rs | 4 ++-- unix_integration/resolver/src/idprovider/interface.rs | 1 + 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/libs/client/src/lib.rs b/libs/client/src/lib.rs index 9452b90b2..7f7d17aaa 100644 --- a/libs/client/src/lib.rs +++ b/libs/client/src/lib.rs @@ -109,11 +109,13 @@ pub struct KanidmClientConfigInstance { /// 3. All of these may be overridden by setting environment variables. /// pub struct KanidmClientConfig { + // future editors, please leave this public so others can parse the config! #[serde(flatten)] - default: KanidmClientConfigInstance, + pub default: KanidmClientConfigInstance, #[serde(flatten)] - instances: BTreeMap, + // future editors, please leave this public so others can parse the config! + pub instances: BTreeMap, } #[derive(Debug, Clone, Default)] diff --git a/server/lib/src/idm/authsession.rs b/server/lib/src/idm/authsession.rs index 88a4e8f8c..546eb6b66 100644 --- a/server/lib/src/idm/authsession.rs +++ b/server/lib/src/idm/authsession.rs @@ -1481,7 +1481,7 @@ impl AuthSession { ) { CredState::Success { auth_type, cred_id } => { // Issue the uat based on a set of factors. - let uat = self.issue_uat(&auth_type, time, async_tx, cred_id)?; + let uat = self.issue_uat(auth_type, time, async_tx, cred_id)?; let jwt = Jws::into_json(&uat).map_err(|e| { admin_error!(?e, "Failed to serialise into Jws"); @@ -1546,7 +1546,7 @@ impl AuthSession { fn issue_uat( &mut self, - auth_type: &AuthType, + auth_type: AuthType, time: Duration, async_tx: &Sender, cred_id: Uuid, @@ -1614,7 +1614,7 @@ impl AuthSession { issued_at: uat.issued_at, issued_by: IdentityId::User(self.account.uuid), scope, - type_: *auth_type, + type_: auth_type, })) .map_err(|e| { debug!(?e, "queue failure"); diff --git a/server/lib/src/valueset/session.rs b/server/lib/src/valueset/session.rs index 06a158d2e..679c19bd8 100644 --- a/server/lib/src/valueset/session.rs +++ b/server/lib/src/valueset/session.rs @@ -112,7 +112,7 @@ impl ValueSetSession { type_, } => { // Convert things. - let issued_at = OffsetDateTime::parse(&issued_at, &Rfc3339) + let issued_at = OffsetDateTime::parse(issued_at, &Rfc3339) .map(|odt| odt.to_offset(time::UtcOffset::UTC)) .map_err(|e| { admin_error!( @@ -125,7 +125,7 @@ impl ValueSetSession { let state = match state { DbValueSessionStateV1::ExpiresAt(e_inner) => { - OffsetDateTime::parse(&e_inner, &Rfc3339) + OffsetDateTime::parse(e_inner, &Rfc3339) .map(|odt| odt.to_offset(time::UtcOffset::UTC)) .map(SessionState::ExpiresAt) .map_err(|e| { diff --git a/unix_integration/resolver/src/idprovider/interface.rs b/unix_integration/resolver/src/idprovider/interface.rs index d10b601e0..b95648efd 100644 --- a/unix_integration/resolver/src/idprovider/interface.rs +++ b/unix_integration/resolver/src/idprovider/interface.rs @@ -139,6 +139,7 @@ pub enum AuthCacheAction { } #[async_trait] +#[allow(clippy::too_many_arguments)] pub trait IdProvider { async fn configure_hsm_keys( &self,