Python interface to the Kerberos administration interface (kadm5)
Actively maintained. Last release 6 weeks ago, commits in 17 of the last 26 weeks. A safe choice.
pip install python-kadmin-rsRust and Python bindings for the Kerberos administration interface (kadm5)
This repository contains both a work-in-progress safe, idiomatic Rust bindings for libkadm5, the library to administrate a Kerberos realm that supports the Kerberos administration interface (mainly Heimdal and MIT Kerberos 5).
It also contains a Python API to those bindings.
kadmin
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_clientmit_serverheimdal_clientheimdal_server
For remote operations:
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:
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_INCLUDESKADMIN_MIT_SERVER_INCLUDESKADMIN_HEIMDAL_CLIENT_INCLUDESKADMIN_HEIMDAL_SERVER_INCLUDES
To override the path to the krb5-config binary:
KADM5_MIT_CLIENT_KRB5_CONFIGKADM5_MIT_SERVER_KRB5_CONFIGKADM5_HEIMDAL_CLIENT_KRB5_CONFIG