openwisp / openwisp/openwisp-controller

[change] VpnClient objects should block modifications

Open
#1,428 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue
Dominant language
Python
Stars
773
Forks
315
Avg merge
2d 16h
Merged PRs (30d)
14

Description

Describe the bug
Currently, VpnClient objects allow direct modification of their fields. This is problematic because it can lead to inconsistent state and data integrity issues. The expected behavior is that VpnClient objects should be immutable after creation, and any configuration changes should require re-creating the object instead of modifying existing fields.

Expected behavior
VpnClient objects should not allow direct field modifications. Instead, users should be required to delete the existing VpnClient object and create a new one (by re-applying template) with the desired configuration. This ensures data consistency and makes the object lifecycle management explicit and predictable.

We shall add model validation to disallow any changes to the VpnClient fields post creation.

System Informatioon:

  • OS: [e.g. Ubuntu 24.04 LTS]
  • Python Version: [e.g. Python 3.11.2]
  • Django Version: [e.g. Django 4.2.5]
  • Browser and Browser Version (if applicable): [e.g. Chromium v126.0.6478.126]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the VpnClient model and its relevant tests, then inspect how field changes are currently validated and persisted. Done means post-creation field modifications are rejected while deleting and re-creating the object remains possible, with tests covering both behaviors.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.