OpenWISP

[django-freeradius] Automatically determine groupname

The radius accounting table has a groupname field which cannot be sent by freeradius in the accounting query, it has to be determined in another way.

There are different way to do this, but we should use the Django ORM so this feature can be handled automatically by the API. To implement this feature we should do the following:

  • when saving a new accounting, the system can figure out the groupname related to the user by selecting the related RadiusUserGroup with the highest priority (1 being highest)
  • a few words describing this feature should be spent in the API
  • this feature can be turned off with a setting if needed, the setting must be documented in the available settings page and link the related API section
  • a test case which saves an accounting instance and expects the groupname to be filled automatically should be written
  • a test case which saves an accounting via the API and expects the groupname to be filled automatically should also be written
  • a test case which tests this feature when disabled should also be written, to implement how this is done you can take a look at django_freeradius.tests.base.test_api.BaseTestApiReject

Don't forget to start and fork the github repository linked in this task, this will help us for the reason described in our page Help us to grow.

Task tags

  • python
  • API
  • django-rest-framework
  • django
  • freeradius

Students who completed this task

mrcreator

Task type

  • code Code
close

2018