Re: Python and return attributes in `postproxy`

2008-01-14 Thread Alan DeKok
Mike O'Connor wrote:
 It would seem as if the rlm_python does not provide the returned
 attributes from the proxy, this happens in both a patched version of
 1.1.7 and 2.0.0.

  Yes.  It appears to convert only the request attributes to a python tuple.

  Fixing it shouldn't be hard.  As always, patches are welcome.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: Python and return attributes in `postproxy`

2008-01-14 Thread Mike O'Connor

Alan DeKok wrote:

Mike O'Connor wrote:
  

It would seem as if the rlm_python does not provide the returned
attributes from the proxy, this happens in both a patched version of
1.1.7 and 2.0.0.



  Yes.  It appears to convert only the request attributes to a python tuple.

  Fixing it shouldn't be hard.  As always, patches are welcome.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
  

Hi Alan

Is there an example of how this is done in another rlm_ module which 
works in a similar way as the rlm_python code ?



Mike
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Python and return attributes in `postproxy`

2008-01-13 Thread Mike O'Connor

Hi Guys

It would seem as if the rlm_python does not provide the returned 
attributes from the proxy, this happens in both a patched version of 
1.1.7 and 2.0.0.


Code:
def postproxy(params):
   log.log('RLM_PYTHON: handling Post Proxy request...', log.VERBOSE)
   pprint.pprint(params)
   returnval = send_message('postproxy', params, False)
   return lib.radiusd.RLM_MODULE_OK

Result:
+- entering group post-proxy
2008-01-14T13:14:09.412107: Verbose: RLM_PYTHON: handling Post Proxy 
request...

(('Framed-Protocol', 'PPP'),
('User-Name', '[EMAIL PROTECTED]'),
('User-Password', 'x'),
('Service-Type', 'Framed-User'),
('NAS-IP-Address', '118.xx.xx.xx'),
('Realm', 'dsl.*'),
++[python] returns ok

Command line test:
Sending Access-Request of id 39 to 118.67.209.51 port 1812
   Framed-Protocol = PPP
   User-Name = [EMAIL PROTECTED]
   User-Password = x
   Service-Type = Framed-User
   NAS-IP-Address = 118.xx.xx.xx
rad_recv: Access-Accept packet from host 118.67.209.51 port 1812, id=39, 
length=44

   Port-Limit = 1
   Framed-Protocol = PPP
   Service-Type = Framed-User
   Framed-IP-Address = 118.xx.xx.21





-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html