-
Notifications
You must be signed in to change notification settings - Fork 62
Description
Problem
It's not clear if a given route is scoped to a silo or fleet level
Context
A route naming question came up in #1329 that highlighted some current confusion in Nexus' public API. The crux of the issue is that it isn't clear if a top level route is scoped to the context of a silo or the context of a fleet.
/organizations is well understood to be scoped to a silo. Based on this section in RFD 234 it's intentional that silo scoped resources don't have a silo prefix in the URL.
Identities for users, groups, and service accounts are always scoped to a particular Silo. As a result, there’s no need for Silos to appear in the API URL for Organizations, Projects, etc. This is an important isolation measure: there’s no way for users to even ask about resources in other Silos — they don’t have a way to refer to them.
So we've stated that we do want isolation, i.e. silo routes at the top level. In the operator API discussion 🔒 it was stated that we don't want a separate openapi spec for public but non-silo scoped routes. That matches with the state we're in today, but still leaves confusion about how top level resources are scoped.
For example:
- GET
/policy... fleet or scoped to a silo? There'ssilos/{silo}/policywhich from a particular silo. - GET
/ip-poolsfleet or scoped to a silo? - GET
/imagesscoped to the fleet
Suggested solution
I believe we should settle on a finite amount of consistent top level routes that can be specifically denoted as being outside the context of a silo. Ideally the route prefix would be an indication of their scope (and we can enhance this with tags, extra docs, etc).
Here's a starting suggestion of some top level route prefixes:
/fleet/- Anything fleet wide/silos/- Anything spanning/targeting a specific silo/rack/- Anything isolated to a single rack
The current changes would be something like /images -> /fleet/images.
Note
As conversations below suggest, these are likely the wrong top level endpoints. As @rmustacc pointed out, it might be better to add user context scoping like/ops/. Regardless of the top level endpoints chosen, the idea still remains that anything outside the scope of a silo would be grouped in a finite set of top level endpoints.
My hope is that this will increase clarity around scoping, be more intuitive to customers, ease documentation burdens, and (maybe) even simplify permissions or permission testing.
See also