[2.4, API] ipaddresses read doesn't show STATIC/AUTO ip addresses

Bug #1771457 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Medium
Unassigned

Bug Description

I have users who own machines and devices, but the 'ipaddresses' endpoint doesn't report that:

1. Scenario one - Admin user reading owned IPs: The admin user has machines & devices deployed to itself:

ubuntu@maas00:/usr/lib/python3/dist-packages$ maas admin ipaddresses read
Success.
Machine-readable output follows:
[]

2.Scenario two - Admin user reading owned IPs by a normal user who has devices owned to him:

ubuntu@maas00:/usr/lib/python3/dist-packages$ maas admin ipaddresses read owner=Test
Success.
Machine-readable output follows:
[]

3. Scenario three - Admin user reading all IP address, not only owned:
ubuntu@maas00:/usr/lib/python3/dist-packages$ maas admin ipaddresses read all=True | grep ip_address
                        "ip_address": "10.90.90.1",
                        "ip_address": "192.168.100.1",
                        "ip_address": "10.90.90.1",
                        "ip_address": "192.168.100.1",
                        "ip_address": "192.168.1.13",
                        "ip_address": "10.90.90.5",
                        "ip_address": "10.90.90.7",
                        "ip_address": "10.90.90.3",
                        "ip_address": "10.90.90.2",
                        "ip_address": "10.90.90.4",
                        "ip_address": "10.90.90.90",
                        "ip_address": "10.90.90.91",

4. Scenario four - Normal user reading IP addresses it owns for devices it has with static IPs:
ubuntu@maas00:/usr/lib/python3/dist-packages$ maas test ipaddresses read
Success.
Machine-readable output follows:
[]

Changed in maas:
importance: Undecided → High
status: New → Triaged
milestone: none → 2.4.0rc2
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Context: https://bugs.launchpad.net/maas/+bug/1629061

We should probably have a parameter that allows the user to read ip's owned by a machine/device/etc.

Changed in maas:
importance: High → Medium
summary: - [2.4, API] ipaddresses read doesn't show owned IP addresses
+ [2.4, API] ipaddresses read doesn't STATIC/AUTO ip addresses
Revision history for this message
Mike Pontillo (mpontillo) wrote : Re: [2.4, API] ipaddresses read doesn't STATIC/AUTO ip addresses

It's not really clear to me that this is a bug; it's currently working as intended (given the long history of this API endpoint, which dates back to MAAS 1.x).

See also: bug #1629061 and related merge proposal. This API was enhanced a couple of years ago to handle some other common use case scenarios.

Previously, this API was only intended to work with IP addresses reserved to the current user. Allowing more addresses to be shown by default would break backward compatibility, because users aren't allowed to work with non-user-reserved IP addresses in the same way that they can work with STATIC and/or AUTO addresses assigned to a deployed machine.

You can also pass owner=<user> to filter the list of IP addresses by a particular user, even if you're an admin. So the current API seems to allow every combination of desired behavior, unless I'm missing something?

Changed in maas:
status: Triaged → Incomplete
Revision history for this message
Andres Rodriguez (andreserl) wrote :

I've renamed the title for this bug, and comment #1 explains what the solution should be.

summary: - [2.4, API] ipaddresses read doesn't STATIC/AUTO ip addresses
+ [2.4, API] ipaddresses read doesn't show STATIC/AUTO ip addresses
Changed in maas:
status: Incomplete → Triaged
Changed in maas:
milestone: 2.4.0rc2 → 2.5.0
Changed in maas:
milestone: 2.5.0 → 2.5.x
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.