Skip to content

agent-permissions: various repo and service cleanups#3619

Open
mschuwalow wants to merge 9 commits into
agent-permissions-14from
agent-permissions-15
Open

agent-permissions: various repo and service cleanups#3619
mschuwalow wants to merge 9 commits into
agent-permissions-14from
agent-permissions-15

Conversation

@mschuwalow

@mschuwalow mschuwalow commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Flows I tried to go for:

get by id:

  • read entity + all joined, non-deleted parent entities
  • 404 on permission denied

get by name (e.g. /envs/:env_id/components/:component_name):

  • read parent using get by id
  • 404 on parent not found (which includes denied due to the rules in get by id)
  • check permission to access child, 404 on denied
  • fetch child without joining parent data
  • project into domain model using parent data fetched in (1)

get fixed subresource (e.g. /accounts/:account_id/plan):

  • read parent using get by id
  • 404 on parent not found (which includes denied due to the rules in get by id)
  • check permission to access child, 403 on not found
  • fetch child without joining parent data
  • project into domain model using parent data fetched in (1)

list subresources (e.g. /accounts/:account_id/applications):

  • read parent using get by id
  • 404 on parent not found (which includes denied due to the rules in get by id)
  • fetch all children without joining parent data
  • filter fetched children using auth, skip filtered children
  • project into domain model using parent data fetched in (1)

There are few exceptions to this:

  • list_visible_environments breaks the usual hierarchy and is implemented by compiling a filter down to sql. That is reasonably tested and works, though I might clean up the compilation / sql later
  • the various get agent types. These pass all of our current tests, but I'm not yet 100% sure how I want to handle deleted parents / joining with parent data here. I'll do another pass on these separately and review what is should be done there

@mschuwalow mschuwalow self-assigned this Jun 6, 2026
@mschuwalow mschuwalow marked this pull request as ready for review June 8, 2026 13:27
@mschuwalow mschuwalow force-pushed the agent-permissions-14 branch from a4b82f4 to 42b228a Compare June 9, 2026 11:40
@mschuwalow mschuwalow force-pushed the agent-permissions-15 branch 2 times, most recently from 1b4a480 to 3e4ba51 Compare June 10, 2026 17:04
@mschuwalow mschuwalow force-pushed the agent-permissions-14 branch from 42b228a to 0d389e3 Compare June 10, 2026 21:39
@mschuwalow mschuwalow force-pushed the agent-permissions-15 branch from 3e4ba51 to 18b4290 Compare June 10, 2026 21:40
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.

1 participant