Repository navigation
[fix] Skipped allocated IPs across the subnet hierarchy #275 #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pandafy
wants to merge
5
commits into
master
Choose a base branch
from
issues/275-related-subnet-ip-allocation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
aa7c7de
[fix] Skipped allocated IPs across the subnet hierarchy #275
pandafy 50d8577
[chores] Addressed review feedback
pandafy 9795021
[chores] Addressed review feedback
pandafy a63f079
[chores] Addressed review feedback
pandafy 2de40c9
[chores] Addressed review feedback
pandafy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2 · Prevent private allocations from becoming a shared-subnet oracle
The next-available-IP endpoint calls this method for shared subnets accessible to organization managers. Since this query includes every descendant, a manager can see the returned address change when another organization allocates the first address in its private child subnet. The hosts and allocation endpoints already filter those private descendants. Keep the global check for actual allocation, but prevent this endpoint from revealing another organization's allocation state, for example by restricting the response when it cannot be disclosed safely.
I ran the following regression in
TestMultitenantApiwith./runtests openwisp_ipam.tests.test_multitenant.TestMultitenantApi.test_shared_next_ip_hides_other_org_allocation. It fails because the responses change from10.0.0.1to10.0.0.2. If access is restricted instead, adapt the assertions to verify the restricted response.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified on 2de40c9: an organization manager receives a 404 for another organization’s private child, but the shared parent next-IP response changes from 10.0.0.1 to 10.0.0.2 after that child allocates the first address. At base 7ffe5d5 the GET response does not change. The shared-parent request-IP endpoint also returns the globally selected address, so restricting only the preview would leave another way to infer allocation state. Filtering the preview alone would instead advertise an address that actual allocation cannot use. Restricting both operations for non-superusers on shared parents would prevent this path but would also remove a workflow described in issue #275. Under
openwisp-iterate-review, "Scope and Complexity", this API and access-policy tradeoff needs a maintainer decision before changing behavior. I am pausing this review stage while seeking that decision; no code has been changed.