Update all modules to use registry - part 3
This commit is contained in:
@@ -8,17 +8,16 @@ use crate::{
|
||||
Directories,
|
||||
backend::{ldap::LdapDirectory, oidc::OpenIdDirectory, sql::SqlDirectory},
|
||||
};
|
||||
use ahash::AHashMap;
|
||||
use registry::schema::{
|
||||
prelude::Object,
|
||||
structs::{self, Authentication},
|
||||
};
|
||||
use std::sync::Arc;
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
use store::registry::bootstrap::Bootstrap;
|
||||
|
||||
impl Directories {
|
||||
pub async fn build(bp: &mut Bootstrap) -> Self {
|
||||
let mut directories = AHashMap::new();
|
||||
let mut directories = HashMap::default();
|
||||
|
||||
for directory in bp.list_infallible::<structs::Directory>().await {
|
||||
let id = directory.id;
|
||||
@@ -32,7 +31,7 @@ impl Directories {
|
||||
|
||||
match result {
|
||||
Ok(directory) => {
|
||||
directories.insert(id, Arc::new(directory));
|
||||
directories.insert(id.id() as u32, Arc::new(directory));
|
||||
}
|
||||
Err(err) => {
|
||||
bp.build_error(id, err);
|
||||
|
||||
@@ -7,12 +7,10 @@
|
||||
#![warn(clippy::large_futures)]
|
||||
|
||||
use crate::backend::oidc::OpenIdDirectory;
|
||||
use ahash::AHashMap;
|
||||
use backend::{ldap::LdapDirectory, sql::SqlDirectory};
|
||||
use deadpool::managed::PoolError;
|
||||
use ldap3::LdapError;
|
||||
use registry::types::id::Id;
|
||||
use std::{fmt::Debug, sync::Arc};
|
||||
use std::{collections::HashMap, fmt::Debug, sync::Arc};
|
||||
|
||||
pub mod backend;
|
||||
pub mod core;
|
||||
@@ -57,10 +55,10 @@ pub struct Group {
|
||||
pub description: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Directories {
|
||||
pub default_directory: Option<Arc<Directory>>,
|
||||
pub directories: AHashMap<Id, Arc<Directory>>,
|
||||
pub directories: HashMap<u32, Arc<Directory>, nohash_hasher::BuildNoHashHasher<u32>>,
|
||||
}
|
||||
|
||||
impl Debug for Directory {
|
||||
|
||||
Reference in New Issue
Block a user