百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

radius-rs

> 编程语言
开源

Rust 的 RADIUS 服务器和客户端的异步/等待原生实现。

100 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

Rust 的 RADIUS 服务器和客户端的异步/等待原生实现。

radius-rs

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.

Description

This RADIUS server and client implementation use tokio to support asynchronous operations natively. This implementation satisfies basic functions that are described in RFC2865.

Usage

Simple example implementations are here:

  • server
  • client

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

Supported Dictionaries

This supports the following RFC dictionaries at the moment:

  • RFC2865
  • RFC2866
  • RFC2867
  • RFC2868
  • RFC2869
  • RFC3162
  • RFC3576
  • RFC3580
  • RFC4072
  • RFC4372
  • RFC4603
  • RFC4675
  • RFC4818
  • RFC4849
  • RFC5090
  • RFC5176
  • RFC5607
  • RFC5904
  • RFC6519
  • RFC6572
  • RFC6677
  • RFC6911
  • RFC7055
  • RFC7155

Cryptography method feature option

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:

toml
[dependencies]
radius = { version = "__version__", default-features = false, features = ["openssl"] }

Implementation guide for your RADIUS application

Common

  • Packet struct represents request packet and response one.
    • This struct has a list of AVPs.
    • You can get a specific AVP by RFC dictionary module.
      • e.g. rfc2865::lookup_user_name(packet)
        • This method returns Some(Result) if the packet contains User-Name attribute.
        • On the other hand, if the package doesn't have that attribute, it returns None.
    • You can construct a packet with RFC dictionary module.
      • e.g. rfc2865::add_user_name(&mut packet, "user")
        • This method adds a User-Name AVP to the packet.
    • Please refer to the rustdoc for each RFC dictionary module in detail.

Server

  • Must implement RequestHandler interface.
    • This interface method is the core function of the server application what you need.
  • Please refer also to the example implementation: server

Client

  • Please refer also to the example implementation: client

Roadmap

  • Support the following RFC dictionaries:
    • rfc4679
    • rfc5447
    • rfc5580
    • rfc6929
    • rfc6930
    • rfc7268
    • rfc7499
    • rfc7930
    • rfc8045
    • rfc8559

Development guide for this library

How to generate code from dictionary

bash
$ 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.

Note

The original implementation and design of this are inspired by layeh/radius.

Author

moznion ()

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustradiusrust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言