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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//! Rust bindings to libkadm5
//!
//! This is a safe, idiomatic Rust interface to libkadm5.
//!
//! This library does not link against libkadm5, but instead loads it at runtime to be able to
//! support multiple variants.
//!
//! It provides four features, all enabled by default, for the supported variants of libkadm5:
//!
//! - `mit_client`
//! - `mit_server`
//! - `heimdal_client`
//! - `heimdal_server`
//!
//! For remote operations:
//!
//! ```no_run
//! use kadmin::{KAdm5Variant, KAdmin, KAdminImpl};
//!
//! let princ = "user/admin@EXAMPLE.ORG";
//! let password = "vErYsEcUrE";
//!
//! let kadmin = KAdmin::builder(KAdm5Variant::MitClient)
//! .with_password(&princ, &password)
//! .unwrap();
//!
//! dbg!("{}", kadmin.list_principals(None).unwrap());
//! ```
//!
//! For local operations:
//!
//! ```no_run
//! use kadmin::{KAdm5Variant, KAdmin, KAdminImpl};
//!
//! let kadmin = KAdmin::builder(KAdm5Variant::MitServer)
//! .with_local()
//! .unwrap();
//!
//! dbg!("{}", kadmin.list_principals(None).unwrap());
//! ```
//!
//! # About compilation
//!
//! During compilation, all the enabled variants will be discovered and bindings will be generated
//! from the discovered variants. If a variant cannot be discovered, it will not be available for
//! use. The following environment variables are available to override that discovery process:
//!
//! To override the directories in which the `kadm5/admin.h` header will be searched for:
//!
//! - `KADMIN_MIT_CLIENT_INCLUDES`
//! - `KADMIN_MIT_SERVER_INCLUDES`
//! - `KADMIN_HEIMDAL_CLIENT_INCLUDES`
//! - `KADMIN_HEIMDAL_SERVER_INCLUDES`
//!
//! To override the path to the `krb5-config` binary:
//!
//! - `KADM5_MIT_CLIENT_KRB5_CONFIG`
//! - `KADM5_MIT_SERVER_KRB5_CONFIG`
//! - `KADM5_HEIMDAL_CLIENT_KRB5_CONFIG`
//! - `KADM5_HEIMDAL_SERVER_KRB5_CONFIG`
//!
//! Library paths will also be looked for, and forwarded so that at runtime, the library can be
//! loaded. If it cannot find any, it will try to load a generic library from the system library
//! paths. You can override the path the library is loaded from with [`sys::Library::from_path`].
//!
//! # About thread safety
//!
//! As far as I can tell, libkadm5 APIs are **not** thread safe. As such, the types provided by this
//! crate are neither `Send` nor `Sync`. You _must not_ use those with threads. You can either
//! create a `KAdmin` instance per thread, or use the `kadmin::sync::KAdmin` interface that spawns a
//! thread and sends the various commands to it. The API is not exactly the same as the
//! non-thread-safe one, but should be close enough that switching between one or the other is
//! easy enough.
pub use Error;
pub use Context;
pub use Params;
pub use DbArgs;
pub use ;
pub use ;
pub use ;
pub use Policy;
pub use Principal;
pub use KAdm5Variant;