[RADIATOR] Getting attributes in hooks

Frank Danielson FDanielson at csky.com
Mon Aug 19 12:44:34 UTC 2019


The UserName is initialized from the RADIUS User-Name attribute and is then subject to rewriting rules. Depending on your config and which hook is in use the value of getUserName may not be the same as the value in the attribute. If you want to know the UserName currently in use for the request use getUserName.

Frank Danielson
S.V.P. Engineering
ClearSky Technologies, Inc.
fdanielson at csky.com<mailto:fdanielson at csky.com>


On Aug 16, 2019, at 4:10 PM, David Rose <rosed at iit.edu<mailto:rosed at iit.edu>> wrote:

Looking at cleaning up some of our hook processing and was looking through some of the example hooks provided with Radiator. While doing so I noticed there are a number of ways to get attributes and was wondering why certain methods were used in different example hooks.

For example I found these for getting user names:

- $p->getUserName
- $p->get_attr('User-Name')
- $p->getAttrByNum($Radius::Radius::USER_NAME)

All seem to be capable of doing the same thing. Even in our hooks there are differences in which is used and I would prefer to change this so that our hooks are at least consistent (unless there is reason not to do so).

Are there reasons to use one over the other? For example, do some have better performance or take up fewer resources? Perhaps there are specific use cases when one should be used over another? Or maybe some are decprecated and should be avoided?

I just want to make sure that I make the best choices while cleaning up our own code and couldn't find anything documenting the differences. Thank you in advance for any information you provide.

--
David Rose
Sr. Network Engineer
Office of Technology Services
Illinois Institute of Technology
(O) 312.567.3249<tel:312.567.3249>
(F) 312.567.5968<tel:312.567.5968>
rosed at iit.edu<mailto:rosed at iit.edu>
_______________________________________________
radiator mailing list
radiator at lists.open.com.au<mailto:radiator at lists.open.com.au>
https://lists.open.com.au/mailman/listinfo/radiator

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.open.com.au/pipermail/radiator/attachments/20190819/d9c616fb/attachment.html>


More information about the radiator mailing list