Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raises exception when attribute does not exist #90

Open
wants to merge 59 commits into
base: dev_old
Choose a base branch
from

Conversation

marzsv
Copy link
Contributor

@marzsv marzsv commented Aug 15, 2018

Raises exception (instead of a general KeyError) when attribute does not exist in dictionaries, so the error can be handled easily by the consumer (server implementation).

GIC-de and others added 30 commits February 2, 2017 14:03
Ordering doesn't matter and it's easier to implement removal this way.
select.select() has a limitation of not being able to use file descriptors
larger than FD_SETSIZE. This causes issues when trying to use pyrad.Client
in a long-running software that is keeping a large number of connections
open.

This change converts Client to use poll() instead of select() to wait for
an incoming packet.
Fix for race condition for gigabits networks due to slow time.time()
When auth_enabled is False and acct_enabled is False, we cannot start
a listener for CoA only.

Fixes: db780ca ("add coa server support")
Fixes: 40c7eab ("historics")
The coa.py example needed to be modified for every tests of CoA, Disconnect and
when a NAS-Identifier needs to be inserted.

Example of use of this new feature:

 # start the RADIUS server
pyrad/example$ ./server.py &

 # send CoA to the RADIUS server
pyrad/example$ ./coa.py coa fooId-1234
 [server] Received an coa request
 [server] Attributes:
 [server] NAS-Identifier: [u'fooId-1234']
 [server] Acct-Session-Id: [u'1337']

 [coa] {}
 [coa] 44

 # send Disconnect to the RADIUS server
pyrad/example$ ./coa.py dis fooId-1234
 [server] Received an disconnect request
 [server] Attributes:
 [server] NAS-Identifier: [u'fooId-1234']
 [server] Acct-Session-Id: [u'1337']

 [coa] {}
 [coa] 45
This small client can listen on any port. It is usefull to
test some CoA proxies/forwarders.

It requires fixes from:
  https://github.com/vjardin6WIND/pyrad/tree/dev-coa
  Id: e8feefc ("server: listen for CoAs without auth, neither acct")

pyrad/example$ ./client-coa.py 3799 &

pyrad/example$ ./coa.py coa VincentJardinID
 [client-coa] Received a coa request 43
 [client-coa]  Attributes:
 [client-coa]  NAS-Identifier: [u'VincentJardinID']
 [client-coa]  Acct-Session-Id: [u'1337']

 [coa] {}
 [coa] 44

pyrad/example$ ./coa.py dis VincentJardinID
 [client-coa] Received a disconnect request 40
 [client-coa]  Attributes:
 [client-coa]  NAS-Identifier: [u'VincentJardinID']
 [client-coa]  Acct-Session-Id: [u'1337']

 [coa] {}
 [coa] 41
First make a function to lookup all addreses with getaddinfo, which
will return the address family to use and address (v4/v6).

Then have the BindAddress function bind to all returned addresses.
Add a test for binding to an ipv6 address.
Without this, once you run tests with:
  python setup.py test

the dependency directories show up in git status, which is a tad
annoying.
rbricheno and others added 28 commits April 9, 2018 22:54
Issue 54 - Include missing LICENSE.txt in manifest
Issue 68 and 70 - Update testPktEncodeAttributes to make it pass in 3.6
Issue63 Add *.egg directories to .gitignore.
Add async Client/Server Radius
Issue 83 - Correct rtype in docstring for Client.CreateAuthPacket
DecodeIPv6Prefix and DecodeIPv6Addres function fix, ValueError zero length field name in format
Race condition fix due to slow time.time()
Closes pyradius#45: Adds support to handle packets from any host.
Fix pyrad.Client to work with more than FD_SETSIZE file descriptors
server: fix listen for CoAs without auth, neither acct , add runtime CoA+disconnect example
coa-client: emulate fake coa-client to test CoA proxies/forwarders
Issue8 - Add ipv6 bind support to the server code
- Raises exception when attribute does not exist in dictionary.
- Method to check if a dictionary contains an attribute.
- Method to check the dictionary attribute type.
@peterhoneder
Copy link

peterhoneder commented Oct 26, 2018

I think this shouldn't be an exception, but just fall into the default path of attribute handling. My approach to this is here: #101

Basically my reasoning is, that you can probably never know all attributes you are going to handle. And also if someone sends an unknown attribute, it still doesn't mean that packet handling should fail. Most times with radius packets, there are plenty attributes sent along with no specific meaning or purpose to the task at hand, so ignoring them isn't an issue.

@GIC-de
Copy link
Collaborator

GIC-de commented Jul 24, 2024

If this issue is still relevant, please rebase and resolve the conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.