Documentation
¶
Overview ¶
Package membership serves the grants of the tenants a caller administers, so RBAC can be managed without entering the workspace the grants live in.
Memberships live inside their tenant's workspace, which is closed to the tenant's own members — including its admins — precisely because it holds the records that decide their access. That makes it the one part of the model a tenant admin cannot administer directly, which is not a gap to leave open: someone has to be able to add a colleague.
So this is mediated the same way project creation is. The caller's own admin Membership, as the directory already reports it, is the authorization; the server's credential performs the write; and what is offered through it is only ever a Membership in a tenant the caller already administers. A caller cannot name a workspace or a cluster, and cannot reach a tenant they do not administer — not even to discover that it exists.
Listing here is deliberately wider than a self-review: it reports what OTHER people hold, which is the point of administering access, and is why every path checks for admin rather than for mere membership.
Index ¶
- type CreateFunc
- type DeleteFunc
- type Options
- type REST
- func (r *REST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error)
- func (r *REST) Create(ctx context.Context, obj runtime.Object, _ rest.ValidateObjectFunc, ...) (runtime.Object, error)
- func (r *REST) Delete(ctx context.Context, name string, _ rest.ValidateObjectFunc, ...) (runtime.Object, bool, error)
- func (r *REST) Destroy()
- func (r *REST) Get(ctx context.Context, name string, _ *metav1.GetOptions) (runtime.Object, error)
- func (r *REST) GetSingularName() string
- func (r *REST) List(ctx context.Context, _ *metainternalversion.ListOptions) (runtime.Object, error)
- func (r *REST) NamespaceScoped() bool
- func (r *REST) New() runtime.Object
- func (r *REST) NewList() runtime.Object
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateFunc ¶
type CreateFunc func(ctx context.Context, cluster string, m *tenancyv1alpha1.Membership) (created bool, err error)
CreateFunc upserts a Membership in one tenant's workspace. The server supplies it, because how the virtual workspace reaches that workspace is a detail of the deployment rather than of the API.
type DeleteFunc ¶
DeleteFunc removes a Membership from one tenant's workspace.
type Options ¶
type Options struct {
Create CreateFunc
Delete DeleteFunc
}
Options carries the write side. Both funcs may be nil, in which case the resource stays readable and says plainly that changing grants is not configured rather than appearing to work.
type REST ¶
type REST struct {
// contains filtered or unexported fields
}
REST serves memberships for the tenants the caller administers.
func (*REST) ConvertToTable ¶
func (*REST) Create ¶
func (r *REST) Create(ctx context.Context, obj runtime.Object, _ rest.ValidateObjectFunc, _ *metav1.CreateOptions) (runtime.Object, error)
Create grants access in a tenant the caller administers.
The object's name is derived from what is being granted to whom, not taken from the request: two requests saying the same thing are the same grant, so re-granting changes the role in place instead of leaving two objects disagreeing about it.
func (*REST) Delete ¶
func (r *REST) Delete(ctx context.Context, name string, _ rest.ValidateObjectFunc, _ *metav1.DeleteOptions) (runtime.Object, bool, error)
Delete revokes a grant in a tenant the caller administers.
func (*REST) GetSingularName ¶
func (*REST) List ¶
func (r *REST) List(ctx context.Context, _ *metainternalversion.ListOptions) (runtime.Object, error)
List returns every grant in every tenant the caller administers.
There is no scoping parameter: the answer is the caller's whole administrative surface, and a client that cares about one tenant filters on spec.tenant. That keeps the authorization rule here a single sentence, which is worth more than saving the client a loop.