跳转到主要内容

RADIUS工具

项目描述

https://travis-ci.org/pyradius/pyrad.svg?branch=master https://coveralls.io/repos/github/pyradius/pyrad/badge.svg?branch=master https://img.shields.io/pypi/v/pyrad.svg https://img.shields.io/pypi/pyversions/pyrad.svg https://img.shields.io/pypi/dm/pyrad.svg Documentation Status https://img.shields.io/pypi/l/pyrad.svg

简介

pyrad是RFC2865中描述的RADIUS客户端/服务器的实现。它负责所有细节,例如构建RADIUS数据包、发送它们和解析响应。

以下是一个进行认证请求的示例

from __future__ import print_function
from pyrad.client import Client
from pyrad.dictionary import Dictionary
import pyrad.packet

srv = Client(server="localhost", secret=b"Kah3choteereethiejeimaeziecumi",
             dict=Dictionary("dictionary"))

# create request
req = srv.CreateAuthPacket(code=pyrad.packet.AccessRequest,
                           User_Name="wichert", NAS_Identifier="localhost")
req["User-Password"] = req.PwCrypt("password")

# send request
reply = srv.SendPacket(req)

if reply.code == pyrad.packet.AccessAccept:
    print("access accepted")
else:
    print("access denied")

print("Attributes returned by server:")
for i in reply.keys():
    print("%s: %s" % (i, reply[i]))

要求 & 安装

pyrad需要Python 2.7或Python 3.6或更高版本

安装很简单;pyrad使用Python模块的标准distutils系统进行安装

python setup.py install

项目详细信息


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

pyrad-2.4.tar.gz (28.0 kB 查看哈希)

上传时间 源代码

构建分布

pyrad-2.4-py3-none-any.whl (32.5 kB 查看哈希)

上传时间 Python 3

由...