An async/await native implementation of the RADIUS server and client for Rust.
MIT License
An async/await native implementation of the RADIUS server and client for Rust. And this also can be used for parsing/constructing (i.e. decoding/encoding) purposes as a RADIUS library.
This RADIUS server and client implementation use tokio to support asynchronous operations natively. This implementation satisfies basic functions that are described in RFC2865.
Simple example implementations are here:
Those examples implement a quite simple Access-Request
processor. You can try those with the following commands.
$ RUST_LOG=debug cargo run --example server
$ RUST_LOG=debug cargo run --example client # in another shell
This supports the following RFC dictionaries at the moment:
By default, this library uses MD5 for authentication. Starting from version v0.4.0, it also supports OpenSSL.
If you prefer to use OpenSSL, please add the following lines to your Cargo.toml:
[dependencies]
radius = { version = "__version__", default-features = false, features = ["openssl"] }
Packet
struct represents request packet and response one.
rfc2865::lookup_user_name(packet)
Some(Result<String, AVPError>)
if the packet contains User-Name
attribute.None
.rfc2865::add_user_name(&mut packet, "user")
User-Name
AVP to the packet.RequestHandler<T, E>
interface.
$ make gen
code-generator
sub project has the responsibility to generate the Rust code according to
given RFC dictionary files. The dictionary files are in dicts
directory.
The format of the dictionary files respect the FreeRADIUS project's ones.
The original implementation and design of this are inspired by layeh/radius.
moznion ([email protected])