-
-
Notifications
You must be signed in to change notification settings - Fork 89
Description
Describe the bug
Several API endpoint URLs in openwisp-users currently use <pk:str> or <str:user_pk> patterns, despite the User model (and possibly other resources) using UUID primary keys. This inconsistency means that endpoints will accept any string as a primary key, letting malformed UUIDs through to the database and view logic. This reduces input validation, increases risk of confusing 500 errors, and is inconsistent with the best practice of using <pk:uuid> patterns to validate at the routing level.
This was highlighted in the review of openwisp-radius PR #680 and is visible in the openwisp-users API docs, where all user endpoints use string-based URL parameters.
Expected behavior
All API endpoint URL patterns referencing UUID primary keys (e.g., user, organization, etc.) should use <uuid:pk> (for DRF) or <uuid:user_pk>, etc., instead of <str:pk>, so that invalid UUIDs are filtered at the routing level, triggering 404 as early as possible and ensuring consistency across openwisp modules.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status