mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 12:37:00 +01:00
making the internals of kanidmclientconfig public for other users (#2895)
* making the internals of kanidmclientconfig public for other users * clippyisms
This commit is contained in:
parent
bf73332088
commit
eddec88429
|
@ -109,11 +109,13 @@ pub struct KanidmClientConfigInstance {
|
||||||
/// 3. All of these may be overridden by setting environment variables.
|
/// 3. All of these may be overridden by setting environment variables.
|
||||||
///
|
///
|
||||||
pub struct KanidmClientConfig {
|
pub struct KanidmClientConfig {
|
||||||
|
// future editors, please leave this public so others can parse the config!
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
default: KanidmClientConfigInstance,
|
pub default: KanidmClientConfigInstance,
|
||||||
|
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
instances: BTreeMap<String, KanidmClientConfigInstance>,
|
// future editors, please leave this public so others can parse the config!
|
||||||
|
pub instances: BTreeMap<String, KanidmClientConfigInstance>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default)]
|
#[derive(Debug, Clone, Default)]
|
||||||
|
|
|
@ -1481,7 +1481,7 @@ impl AuthSession {
|
||||||
) {
|
) {
|
||||||
CredState::Success { auth_type, cred_id } => {
|
CredState::Success { auth_type, cred_id } => {
|
||||||
// Issue the uat based on a set of factors.
|
// 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| {
|
let jwt = Jws::into_json(&uat).map_err(|e| {
|
||||||
admin_error!(?e, "Failed to serialise into Jws");
|
admin_error!(?e, "Failed to serialise into Jws");
|
||||||
|
@ -1546,7 +1546,7 @@ impl AuthSession {
|
||||||
|
|
||||||
fn issue_uat(
|
fn issue_uat(
|
||||||
&mut self,
|
&mut self,
|
||||||
auth_type: &AuthType,
|
auth_type: AuthType,
|
||||||
time: Duration,
|
time: Duration,
|
||||||
async_tx: &Sender<DelayedAction>,
|
async_tx: &Sender<DelayedAction>,
|
||||||
cred_id: Uuid,
|
cred_id: Uuid,
|
||||||
|
@ -1614,7 +1614,7 @@ impl AuthSession {
|
||||||
issued_at: uat.issued_at,
|
issued_at: uat.issued_at,
|
||||||
issued_by: IdentityId::User(self.account.uuid),
|
issued_by: IdentityId::User(self.account.uuid),
|
||||||
scope,
|
scope,
|
||||||
type_: *auth_type,
|
type_: auth_type,
|
||||||
}))
|
}))
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
debug!(?e, "queue failure");
|
debug!(?e, "queue failure");
|
||||||
|
|
|
@ -112,7 +112,7 @@ impl ValueSetSession {
|
||||||
type_,
|
type_,
|
||||||
} => {
|
} => {
|
||||||
// Convert things.
|
// 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(|odt| odt.to_offset(time::UtcOffset::UTC))
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
admin_error!(
|
admin_error!(
|
||||||
|
@ -125,7 +125,7 @@ impl ValueSetSession {
|
||||||
|
|
||||||
let state = match state {
|
let state = match state {
|
||||||
DbValueSessionStateV1::ExpiresAt(e_inner) => {
|
DbValueSessionStateV1::ExpiresAt(e_inner) => {
|
||||||
OffsetDateTime::parse(&e_inner, &Rfc3339)
|
OffsetDateTime::parse(e_inner, &Rfc3339)
|
||||||
.map(|odt| odt.to_offset(time::UtcOffset::UTC))
|
.map(|odt| odt.to_offset(time::UtcOffset::UTC))
|
||||||
.map(SessionState::ExpiresAt)
|
.map(SessionState::ExpiresAt)
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
|
|
|
@ -139,6 +139,7 @@ pub enum AuthCacheAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub trait IdProvider {
|
pub trait IdProvider {
|
||||||
async fn configure_hsm_keys(
|
async fn configure_hsm_keys(
|
||||||
&self,
|
&self,
|
||||||
|
|
Loading…
Reference in a new issue