Skip to content

Commit

Permalink
Merge branch 'master' into Issues/550-failure-on-importing-utf-16-files
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier authored Nov 26, 2024
2 parents e02605d + 1eaf3ac commit 0dc7459
Show file tree
Hide file tree
Showing 24 changed files with 568 additions and 50 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish Python Package to Pypi.org

on:
release:
types: [published]

permissions:
id-token: write

jobs:
pypi-publish:
name: Release Python Package on Pypi.org
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/openwisp-radius
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -U pip
pip install build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/[email protected]
107 changes: 105 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,113 @@
Change log
==========

Version 1.1.0 [Unreleased]
Version 1.1.0 [2024-11-21]
--------------------------

Unreleased (Work in progress)
Features
~~~~~~~~

- Added integration with `OpenWISP Monitoring
<https://openwisp.io/docs/dev/radius/user/radius_monitoring.html>`_ to
collect and visualize metrics for user-signups and RADIUS traffic.
- Added support for `Change of Authorization (CoA)
<https://openwisp.io/docs/dev/radius/user/change_of_authorization.html>`_.
- Added `MonthlyTrafficCounter
<https://openwisp.io/docs/dev/radius/user/enforcing_limits.html#monthlytrafficcounter>`_
and `MonthlySubscriptionTrafficCounter
<https://openwisp.io/docs/dev/radius/user/enforcing_limits.html#monthlysubscriptiontrafficcounter>`_.
- Added API endpoint to fetch user's latest PhoneToken status.
- Added `OPENWISP_RADIUS_SMS_COOLDOWN
<https://openwisp.io/docs/dev/radius/user/settings.html#openwisp-radius-sms-cooldown>`_
to configure cooldown time for requesting a new PhoneToken.
- Extended ``OPENWISP_USERS_EXPORT_USERS_COMMAND_CONFIG`` to include
registration method and verification status.
- Added MAC address authentication for roaming users.
- Added `OPENWISP_RADIUS_SMS_MESSAGE_TEMPLATE
<https://openwisp.io/docs/dev/radius/user/settings.html#openwisp-radius-sms-message-template>`_
setting to customize SMS messages.
- Added `OPENWISP_RADIUS_USER_ADMIN_RADIUSTOKEN_INLINE
<https://openwisp.io/docs/dev/radius/user/settings.html#openwisp-radius-user-admin-radiustoken-inline>`_
setting to display RadiusTokenInline in UserAdmin.
- Added `OPENWISP_RADIUS_UNVERIFY_INACTIVE_USERS
<https://openwisp.io/docs/dev/radius/user/settings.html#openwisp-radius-unverify-inactive-users>`_
setting to unverify users after a defined period of inactivity.
- Added `OPENWISP_RADIUS_DELETE_INACTIVE_USERS
<https://openwisp.io/docs/dev/radius/user/settings.html#openwisp-radius-delete-inactive-users>`_
setting to delete inactive users after a specified period.
- Added API endpoint to return user's RADIUS usage.
- Supported password expiration feature from openwisp-users.
- Added initial support for Gigaword RADIUS attributes.
- Added ``LoginAdditionalInfoView`` to collection additional user details
in SAML sign-up flow.
- Added autocomplete support for filters in the admin interface.

Changes
~~~~~~~

Backward incompatible changes
+++++++++++++++++++++++++++++

- Renamed ``delete_old_users`` command to
``delete_old_radiusbatch_users``.
- The `OPENWISP_RADIUS_BATCH_DELETE_EXPIRED
<https://openwisp.io/docs/dev/radius/user/settings.html#openwisp-radius-batch-delete-expired>`_
setting now expects days instead of months.

Deprecation warnings
++++++++++++++++++++

- Using the ``default`` key in ``OPENWISP_RADIUS_PASSWORD_RESET_URLS`` is
deprecated. Use ``__all__`` instead.
- Using organization slugs for key in
``OPENWISP_RADIUS_CALLED_STATION_IDS`` are deprecated. Use organization
IDs instead.
- In ``delete_old_radiusbatch_users`` management command, the
``--older-than-months`` option is deprecated. Use ``--older-than-days``
instead.

Dependencies
++++++++++++

- Bumped ``weasyprint~=59.0``.
- Bumped ``pydyf~=0.10.0``.
- Bumped ``dj-rest-auth~=6.0.0``.
- Bumped ``openwisp-utils[rest,celery]~=1.1.1``.
- Bumped ``openwisp-users~=1.1.0``.
- Bumped ``django-private-storage~=3.1.0``.
- Bumped ``django-ipware~=5.0.0``.
- Bumped ``djangosaml2~=1.9.2``.
- Added support for Django ``4.1.x`` and ``4.2.x``.
- Added support for Python ``3.10``.
- Dropped support for Python ``3.7``.
- Dropped support for Django ``3.0.x`` and ``3.1.x``.

Other changes
+++++++++++++

- The ``cleanup_stale_radacct`` management command now uses the session's
``update_time`` to determine staleness, falling back to ``start_time``
if ``update_time`` is unavailable.
- Stopped sending login email notifications when accounting framed
protocol is ``PPP``.
- Send login emails only to users with verified email addresses.
- Grouped SMS features in the organization admin.
- Allowed counter's check method to return ``None`` to prevent adding a
reply to the response.
- The email received from the IdP in SAML registration will be flagged as
verified.

Bugfixes
~~~~~~~~

- Fixed validation for organization's password reset URLs.
- Fixed saving ``RadiusCheck`` / ``RadiusReply`` objects without an
organization returning a 500 HTTP response.
- Fixed handling of accounting stop requests with empty octets.
- Prevented user registration with landline numbers.
- Ignored `IntegrityError` on duplicate accounting start requests.
- Removed default values from fallback fields.
- User need to have required model permissions to perform admin actions.

Version 1.0.2 [2022-12-05]
--------------------------
Expand Down
14 changes: 12 additions & 2 deletions docs/user/management_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,23 @@ date set.

This command deletes users created using batch operation that have expired
(and should have been deactivated by ``deactivate_expired_users``) for
more than the specified ``<duration_in_months>``.
more than the specified ``<duration_in_days>``.

.. code-block:: shell
./manage.py delete_old_radiusbatch_users --older-than-days <duration_in_days>
Note that the default duration is set to **540 days** (18 months).

For backward compatibility, the command also accepts the argument
``--older-than-months``:

.. code-block:: shell
./manage.py delete_old_radiusbatch_users --older-than-months <duration_in_months>
Note that the default duration is set to **18 months**.
If both ``--older-than-days`` and ``--older-than-months`` are provided,
preference is given to ``--older-than-days``.

``delete_unverified_users``
---------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/user/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ addition of users from the csv.
``OPENWISP_RADIUS_BATCH_DELETE_EXPIRED``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Default**: ``18``
**Default**: ``540`` (18 months)

It is the number of months after which the expired users are deleted.
It is the number of days after which the expired users are deleted.

``OPENWISP_RADIUS_BATCH_PDF_TEMPLATE``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion openwisp_radius/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = (1, 1, 0, 'alpha')
VERSION = (1, 1, 0, 'final')
__version__ = VERSION # alias


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "admin/config/device/change_form.html" %}
{% extends "admin/monitoring/device/change_form.html" %}
{% load i18n %}

{% block inline_field_sets %}
Expand Down
24 changes: 24 additions & 0 deletions openwisp_radius/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,27 @@ msgstr "Session verwalten"
#: openwisp_radius/tasks.py: 80
msgid "New WiFi session started"
msgstr "Neue Session WiFi gestartet"

#: templates/djangosaml2/login_additional_info.html:5
msgid "Add Your Email to Complete Your Account Setup"
msgstr "Fügen Sie Ihre E-Mail hinzu, um die Einrichtung Ihres Kontos abzuschließen"

#: templates/djangosaml2/login_additional_info.html:6
msgid ""
"It looks like we didn't receive your email from your identity provider."
msgstr ""
"Es scheint, dass wir Ihre E-Mail-Adresse von Ihrem Identitätsanbieter nicht erhalten haben."

#: templates/djangosaml2/login_additional_info.html:7
msgid ""
"Please enter your email address below to complete setting up your account."
msgstr ""
"Bitte geben Sie unten Ihre E-Mail-Adresse ein, um die Einrichtung Ihres Kontos abzuschließen."

#: templates/djangosaml2/login_additional_info.html:10
msgid "Save Email Address and Continue"
msgstr "E-Mail-Adresse speichern und fortfahren"

#: templates/djangosaml2/login_additional_info.html:12
msgid "Logout"
msgstr "Abmelden"
24 changes: 24 additions & 0 deletions openwisp_radius/locale/fur/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,27 @@ msgstr "Gjestìs session"
#: openwisp_radius/tasks.py:80
msgid "New WiFi session started"
msgstr "Gnove session WiFi scomençade"

#: templates/djangosaml2/login_additional_info.html:5
msgid "Add Your Email to Complete Your Account Setup"
msgstr "Zonte il vuestri indirìs di email par completâ la configurazion dal conto"

#: templates/djangosaml2/login_additional_info.html:6
msgid ""
"It looks like we didn't receive your email from your identity provider."
msgstr ""
"Al somee che no vin rivât il vuestri indirìs di email dal vuestri fornitôr di identitât."

#: templates/djangosaml2/login_additional_info.html:7
msgid ""
"Please enter your email address below to complete setting up your account."
msgstr ""
"Par plasê, inserì il vuestri indirìs di email chi sot par completâ la configurazion dal conto."

#: templates/djangosaml2/login_additional_info.html:10
msgid "Save Email Address and Continue"
msgstr "Salve il indirìs di email e continúe"

#: templates/djangosaml2/login_additional_info.html:12
msgid "Logout"
msgstr "Jesî"
24 changes: 24 additions & 0 deletions openwisp_radius/locale/it/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,27 @@ msgstr "Gestisci sessione"
#: openwisp_radius/tasks.py:80
msgid "New WiFi session started"
msgstr "Nuova sessione WiFi iniziata"

#: templates/djangosaml2/login_additional_info.html:5
msgid "Add Your Email to Complete Your Account Setup"
msgstr "Aggiungi la tua email per completare la configurazione del tuo account"

#: templates/djangosaml2/login_additional_info.html:6
msgid ""
"It looks like we didn't receive your email from your identity provider."
msgstr ""
"Sembra che non abbiamo ricevuto il tuo indirizzo email dal tuo provider di identità."

#: templates/djangosaml2/login_additional_info.html:7
msgid ""
"Please enter your email address below to complete setting up your account."
msgstr ""
"Per favore, inserisci il tuo indirizzo email qui sotto per completare la configurazione del tuo account."

#: templates/djangosaml2/login_additional_info.html:10
msgid "Save Email Address and Continue"
msgstr "Salva l'indirizzo email e continua"

#: templates/djangosaml2/login_additional_info.html:12
msgid "Logout"
msgstr "Esci"
24 changes: 24 additions & 0 deletions openwisp_radius/locale/ru/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,27 @@ msgstr "Управление сессией"
#: openwisp_radius/tasks.py:80
msgid "New WiFi session started"
msgstr "Начала новая сессия WiFi"

#: templates/djangosaml2/login_additional_info.html:5
msgid "Add Your Email to Complete Your Account Setup"
msgstr "Добавьте свой адрес электронной почты, чтобы завершить настройку учетной записи"

#: templates/djangosaml2/login_additional_info.html:6
msgid ""
"It looks like we didn't receive your email from your identity provider."
msgstr ""
"Похоже, мы не получили ваш адрес электронной почты от вашего поставщика удостоверений."

#: templates/djangosaml2/login_additional_info.html:7
msgid ""
"Please enter your email address below to complete setting up your account."
msgstr ""
"Пожалуйста, введите ваш адрес электронной почты ниже, чтобы завершить настройку вашей учетной записи."

#: templates/djangosaml2/login_additional_info.html:10
msgid "Save Email Address and Continue"
msgstr "Сохранить адрес электронной почты и продолжить"

#: templates/djangosaml2/login_additional_info.html:12
msgid "Logout"
msgstr "Выйти"
24 changes: 24 additions & 0 deletions openwisp_radius/locale/sl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,27 @@ msgstr "Upravljanje seje"
#: openwisp_radius/tasks.py:80
msgid "New WiFi session started"
msgstr "Začetek nove seje WiFi"

#: templates/djangosaml2/login_additional_info.html:5
msgid "Add Your Email to Complete Your Account Setup"
msgstr "Dodajte svoj e-poštni naslov, da dokončate nastavitev računa"

#: templates/djangosaml2/login_additional_info.html:6
msgid ""
"It looks like we didn't receive your email from your identity provider."
msgstr ""
"Videti je, da nismo prejeli vašega e-poštnega naslova od vašega ponudnika identitete."

#: templates/djangosaml2/login_additional_info.html:7
msgid ""
"Please enter your email address below to complete setting up your account."
msgstr ""
"Prosimo, vnesite svoj e-poštni naslov spodaj, da dokončate nastavitev računa."

#: templates/djangosaml2/login_additional_info.html:10
msgid "Save Email Address and Continue"
msgstr "Shrani e-poštni naslov in nadaljuj"

#: templates/djangosaml2/login_additional_info.html:12
msgid "Logout"
msgstr "Odjava"
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,31 @@ class BaseDeleteOldRadiusBatchUsersCommand(BaseCommand):
help = 'Deactivating users added in batches which have expired'

def add_arguments(self, parser):
parser.add_argument(
'--older-than-days',
action='store',
type=int,
help='Delete RADIUS batch users that are older than days provided',
)
parser.add_argument(
'--older-than-months',
action='store',
default=BATCH_DELETE_EXPIRED,
help='delete users which have expired before this time',
type=int,
help='Delete RADIUS batch users that are older than months provided',
)

def handle(self, *args, **options):
months = now() - timedelta(days=30 * int(options['older_than_months']))
batches = RadiusBatch.objects.filter(expiration_date__lt=months)
if options.get('older_than_days'):
days = options['older_than_days']
elif options.get('older_than_months'):
days = 30 * options['older_than_months']
else:
days = BATCH_DELETE_EXPIRED
threshold_date = now() - timedelta(days=days)

batches = RadiusBatch.objects.filter(expiration_date__lt=threshold_date)
time_period = threshold_date.strftime('%Y-%m-%d %H:%M:%S')

for b in batches:
b.delete()
self.stdout.write(
f'Deleted accounts older than {options["older_than_months"]} months'
)
self.stdout.write(f'Deleted accounts older than {time_period}')
5 changes: 5 additions & 0 deletions openwisp_radius/saml/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ def get_saml_urls(saml_views=None):
saml_views.AssertionConsumerServiceView.as_view(),
name='saml2_acs',
),
path(
'additional-info/',
saml_views.LoginAdditionalInfoView.as_view(),
name='saml2_additional_info',
),
path(
'logout/',
saml_views.LogoutInitView.as_view(),
Expand Down
Loading

0 comments on commit 0dc7459

Please sign in to comment.