pyrad 0.9 review

Download
by rbytes.net on

pyrad is a Python RADIUS client. pyrad contains several modules: pyrad.client RADIUS client class

License: BSD License
File size: 17K
Developer: Wichert Akkerman
0 stars award from rbytes.net

pyrad is a Python RADIUS client.

pyrad contains several modules:

pyrad.client
RADIUS client class.
pyrad.dictionary
RADIUS dictionary support. Supports standard radiusd dictionaries and has preliminary support for the freeradius octets and abinary extensions.
pyrad.packet
A packet with a RADIUS request or reply. A packet object takes care of all the necessary data conversion allowing the programmer to only use standard python data types and RADIUS attribute names.
pyrad.server
Basic RADIUS server and proxy classes.
pyrad.tools
Utility functions, mostly used internally for data conversion

Simple example

Below is a simple example of how to use pyrad; it shows how to do an authentication request.

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

srv=Client(server="radius.my.domain", secret="s3cr3t",
dict=Dictionary("dicts/dictionary", "dictionary.acc"))

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

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])

Requirements:
Python

What's New in This Release:
Start using trac as issue tracker
Fix handling of packets with an id of 0
Fix handling of file descriptor parameters in the server code and example.
Fix wrong variable name in exception raised when encountering an overly long packet.
Fix error message in parse error for dictionaries.
Packet.CreateAuthenticator is now a static method.

pyrad 0.9 keywords