1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//! The Kanidmd server library. This implements all of the internal components of the server
//! which is used to process authentication, store identities and enforce access controls.

#![recursion_limit = "512"]
#![deny(warnings)]
#![warn(unused_extern_crates)]
#![deny(clippy::unwrap_used)]
#![deny(clippy::expect_used)]
// #![deny(clippy::panic)]
#![deny(clippy::unreachable)]
#![deny(clippy::await_holding_lock)]
#![deny(clippy::needless_pass_by_value)]
#![deny(clippy::trivially_copy_pass_by_ref)]

#[cfg(all(jemallocator, test))]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

#[macro_use]
extern crate log;

#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate rusqlite;

#[macro_use]
extern crate lazy_static;

// This has to be before 'be' so the import order works
#[macro_use]
pub mod macros;

mod crypto;
pub mod utils;
#[macro_use]
pub mod audit;
pub mod be;
pub mod constants;
pub mod credential;
pub mod entry;
pub mod event;
pub mod filter;
pub mod identity;
mod interval;
pub(crate) mod ldap;
mod modify;
pub mod value;
pub mod valueset;
#[macro_use]
mod plugins;
mod access;
mod actors;
pub mod idm;
mod repl;
mod schema;
pub mod server;
mod status;

pub mod config;
pub mod core;

/// A prelude of imports that should be imported by all other Kanidm modules to
/// help make imports cleaner.
pub mod prelude {
    pub use crate::utils::duration_from_epoch_now;
    pub use kanidm_proto::v1::OperationError;
    pub use smartstring::alias::String as AttrString;
    pub use url::Url;
    pub use uuid::Uuid;

    pub use crate::constants::*;
    pub use crate::filter::{Filter, FilterInvalid};

    pub use crate::entry::{
        Entry, EntryCommitted, EntryInit, EntryInvalid, EntryInvalidCommitted, EntryNew,
        EntryReduced, EntrySealed, EntrySealedCommitted, EntryTuple, EntryValid,
    };
    pub use crate::identity::Identity;
    pub use crate::server::{
        QueryServer, QueryServerReadTransaction, QueryServerTransaction,
        QueryServerWriteTransaction,
    };
    pub use crate::value::{IndexType, PartialValue, SyntaxType, Value};
    pub use crate::valueset::ValueSet;
    pub use crate::{
        admin_error, admin_info, admin_warn, filter_error, filter_info, filter_trace, filter_warn,
        perf_trace, request_error, request_info, request_trace, request_warn, security_access,
        security_critical, security_error, security_info, spanned,
    };
}

pub mod tracing_tree;