Skip to content

Commit 3db7588

Browse files
committed
Merge branch '5.15.x'
2 parents 5f688f7 + 9ba8d5c commit 3db7588

File tree

6 files changed

+38
-3
lines changed

6 files changed

+38
-3
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang
1111

1212
<!-- towncrier release notes start -->
1313

14+
## [5.15.1] - 2025-11-17
15+
16+
### Fixed
17+
18+
- Fixed crash reports being sent by unauthenticated clients accessing the API
19+
([#3650](https://github.com/Uninett/nav/issues/3650))
20+
- Fixed non-working port overviews for devices that contain modules with
21+
slashes in their name. A broken interfaces API endpoint caused both
22+
*ipdevinfo* and *interface browser* port lists to malfunction.
23+
([#3652](https://github.com/Uninett/nav/issues/3652))
24+
25+
1426
## [5.15.0] - 2025-10-30
1527

1628
### Security

python/nav/django/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
REST_FRAMEWORK = {
246246
'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',),
247247
'DEFAULT_PAGINATION_CLASS': 'nav.web.api.v1.NavPageNumberPagination',
248-
'UNAUTHENTICATED_USER': 'nav.django.utils.default_account',
248+
'UNAUTHENTICATED_USER': 'nav.web.auth.utils.default_account',
249249
}
250250

251251
# Classes that implement a search engine for the web navbar

python/nav/web/api/v1/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757

5858
urlpatterns = [
59-
path('', views.api_root),
59+
path('', views.api_root, name="root"),
6060
path('token/', views.get_or_create_token, name="token"),
6161
path('version/', views.get_nav_version, name="version"),
6262
path('prefix/routed/', views.RoutedPrefixList.as_view(), name="prefix-routed-list"),

python/nav/web/ipdevinfo/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
),
4949
# Module details
5050
path(
51-
'<str:netbox_sysname>/module=<str:module_name>/',
51+
'<str:netbox_sysname>/module=<path:module_name>/',
5252
views.module_details,
5353
name='ipdevinfo-module-details',
5454
),

tests/integration/api_test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ def test_allowed_endpoints(db, api_client, token, serializer_models, name, url):
6969
assert response.status_code == 200
7070

7171

72+
def test_unauthenticated_user_can_access_api_root(db):
73+
from rest_framework.test import APIClient
74+
75+
client = APIClient()
76+
77+
url = reverse("api:1:root")
78+
79+
response = client.get(url)
80+
assert response.status_code == 200
81+
82+
7283
@pytest.mark.parametrize("endpoint", ['account', 'location', 'room', 'vlan'])
7384
def test_delete(db, api_client, token, endpoint):
7485
create_token_endpoint(token, endpoint)

tests/integration/web/ipdevinfo_test.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ def test_bad_name_should_not_crash_ipdevinfo(client, badname):
9191
assert badname in smart_str(response.content)
9292

9393

94+
def test_when_module_name_contains_slash_then_module_details_should_not_crash(
95+
client, netbox
96+
):
97+
module = netbox.modules.first()
98+
module.name = "1/A"
99+
module.save()
100+
url = reverse('ipdevinfo-module-details', args=(netbox.sysname, "1/A"))
101+
response = client.get(url)
102+
assert netbox.sysname in smart_str(response.content)
103+
assert module.name in smart_str(response.content)
104+
105+
94106
class TestRefreshIpdevinfoJob:
95107
def test_given_netbox_and_job_posts_refresh_event(db, client, netbox):
96108
now = datetime.now()

0 commit comments

Comments
 (0)