server

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: 40 Imported by: 0

Documentation

Overview

Package server wires the tenancy virtual workspace binary together: the directory, the provider that fills it from tenant workspaces, and a virtual-workspace root apiserver serving SelfTenancyReview at /services/tenancy behind kcp's front-proxy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, o *Options) error

Run starts the directory provider and serves the tenancy virtual workspace until ctx is cancelled.

Types

type Options

type Options struct {
	// SecureServing configures TLS serving. The VW must serve TLS: behind
	// kcp's front-proxy the proxy verifies the VW's serving cert, and the
	// VW verifies the proxy's client cert via the requestheader CA.
	SecureServing *genericoptions.SecureServingOptions

	// Authentication identifies callers the same way the access VW does —
	// JWT, forwarded request-header identity, client certificates. The
	// configuration must match kcp's: the directory compares usernames and
	// groups verbatim against Membership subjects.
	Authentication *accessserver.Authentication

	// Authorization is the virtual-workspace-framework authorizer setup.
	Authorization *vwoptions.Authorization

	// Kubeconfig is the path to the kubeconfig for the target kcp, used by
	// the directory provider.
	Kubeconfig string

	// EndpointBase is the front-proxy URL prefix used to construct
	// workspace endpoints in review answers.
	EndpointBase string

	// SelfServiceTenants lets a caller with no membership request a tenant
	// and become its admin. SelfServiceTenantGroups narrows who may.
	SelfServiceTenants      bool
	SelfServiceTenantGroups []string
	// StoreWorkspace is where Tenant records live; a requested tenant is
	// created there.
	StoreWorkspace string

	// PlatformSlice and TenancySlice are the endpoint slices the directory
	// is fed from: Tenants come from the platform tier, Projects and
	// Memberships from inside each tenant's workspace.
	PlatformSlice string
	TenancySlice  string

	// WorkspacePath retargets the kubeconfig to the workspace holding the
	// endpoint slice, for kubeconfigs that point elsewhere (for example an
	// operator-minted admin kubeconfig pointing at root). Empty means use
	// the kubeconfig as-is.
	WorkspacePath string
}

Options configures the tenancy virtual workspace server.

func NewOptions

func NewOptions() *Options

NewOptions returns options with defaults suitable for running behind kcp's front-proxy.

func (*Options) AddFlags

func (o *Options) AddFlags(fs *pflag.FlagSet)

AddFlags registers all flags on the given flag set.

func (*Options) Complete

func (o *Options) Complete() error

Complete fills in derived defaults.

func (*Options) Validate

func (o *Options) Validate() error

Validate checks flag consistency, reporting every problem it finds rather than only the first.

Jump to

Keyboard shortcuts

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