Skip to content

fix: let resource readers read its status - #133

Merged
scotwells merged 1 commit into
mainfrom
fix/status-read-permissions
Oct 16, 2026
Merged

scotwells merged 1 commit into
mainfrom
fix/status-read-permissions

Conversation

@scotwells

Copy link
Copy Markdown
Contributor

People who can view IP address management are refused the status of their pools, claims and allocations, because the platform now checks a separate permission for status reads and the IPAM viewer role does not grant it. Status is where IPAM reports the allocated range and pool utilization, so readers lose exactly what they came for. This grants status read alongside every existing read, so viewing an IPAM resource includes viewing its status again. Status writes stay with the server.

Changes

  • IPAM Viewer gains status.get for pools, classes, claims and allocations, each placed directly after the matching get.
  • Consumer, Provider and Admin pick these up through inheritance.
  • The manifest test now counts subresource permissions as declared; it previously read only top-level verbs and would have rejected the new grants.
  • A new test fails if any role grants a status update or patch, so status writes stay server-only.

User-facing effect

A project member with IPAM Viewer now gets the object back instead of a 403:

GET /apis/ipam.miloapis.com/v1alpha1/namespaces/default/ipclaims/web/status

Before:

User "alice@example.com" cannot get resource "ipclaims/status" in API group "ipam.miloapis.com"

PUT or PATCH on the same /status path is still denied.

Test plan

  • go test ./internal/iamconfig/ passes; adding a status patch to a role makes the new guard fail
  • kustomize build config/milo renders
  • After staging rolls, an IPAM Viewer can GET a claim's and a pool's /status
  • After staging rolls, a status PATCH by the same user is still denied

Milo now authorizes subresource requests on their own permission, with no
fallback to the parent resource's get. IPAM Viewer never granted status.get,
so anyone who could read a pool, class, claim or allocation was refused that
object's status endpoint, even though a plain get already returns the same
status.

Key changes:
- grant status.get next to each get in IPAM Viewer; consumer, provider and
  admin inherit it
- count subresource permissions as declared in the manifest test, which only
  read top-level verbs and would have rejected the new grants
- add a guard that no role grants a status write, so status update and
  patch stay server-only
@scotwells
scotwells marked this pull request as ready for review October 15, 2026 18:57
@scotwells
scotwells merged commit 8db6a41 into main Oct 16, 2026
11 checks passed
@scotwells
scotwells deleted the fix/status-read-permissions branch October 16, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants