toughradius.radiusd.adapters.free 源代码

#!/usr/bin/env python
#coding:utf-8

from .base import BasicAdapter
from toughradius.common import tools
from hashlib import md5
import urllib2
import json

[文档]class RestError(BaseException):pass
[文档]class FreeAdapter(BasicAdapter): """Free auth mode"""
[文档] def getClients(self): nas = dict(status=1, nasid='toughac', name='toughac', vendor=0, ipaddr='127.0.0.1', secret='testing123', coaport=3799) return { 'toughac' : nas, '127.0.0.1' : nas}
[文档] def processAuth(self,req): return dict(code=0, msg='ok')
[文档] def processAcct(self,req): return dict(code=0, msg='ok')
adapter = FreeAdapter