selfprojectrequest

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

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

Create authorizes the request against the caller's own membership and, if it holds, creates the project.

func (*REST) Destroy

func (r *REST) Destroy()

func (*REST) GetSingularName

func (r *REST) GetSingularName() string

func (*REST) NamespaceScoped

func (r *REST) NamespaceScoped() bool

func (*REST) New

func (r *REST) New() runtime.Object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL