Documentation
¶
Overview ¶
Package selfprojectrequest implements the one write the tenancy virtual workspace performs on a caller's behalf: creating a project in a tenant the caller administers.
Everything else this component serves is a read of the caller's own state. This is a write, so it is worth being explicit about why it is mediated rather than delegated:
Projects live in their tenant's workspace, which is also where the Memberships that decide who may reach what live. Granting a tenant admin RBAC there to create projects would hand them the records governing their own access. The virtual workspace therefore holds the only credential into that tier, and offers exactly one operation through it — create a project — gated on the caller's own admin Membership as the directory already reports it.
The mediation is narrow on purpose: one verb, one kind, one field the caller controls. A caller cannot name a workspace, choose a cluster, or touch anything else in the tenant tier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateProjectFunc ¶
type CreateProjectFunc func(ctx context.Context, cluster string, project *tenancyv1alpha1.Project) (created bool, err error)
CreateProjectFunc creates a Project in one tenant's workspace. The server supplies it, because how the virtual workspace reaches that workspace — through the tenancy export — is a detail of the deployment rather than of the API.
type REST ¶
type REST struct {
// contains filtered or unexported fields
}
REST answers SelfProjectRequest creates.
func NewREST ¶
func NewREST(d *directory.Directory, create CreateProjectFunc) *REST
NewREST returns the storage. create may be nil, in which case the resource reports that project creation is not configured rather than pretending to work.
func (*REST) Create ¶
func (r *REST) Create(ctx context.Context, obj runtime.Object, _ rest.ValidateObjectFunc, _ *metav1.CreateOptions) (runtime.Object, error)
Create authorizes the request against the caller's own membership and, if it holds, creates the project.