config

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessConfig

type AccessConfig struct {
	// URL is the base address of the access virtual workspace, either through
	// kcp's front-proxy (https://<front-proxy>/services/access) or directly at
	// the service.
	URL string

	// CAFile verifies the access VW's serving certificate. Empty uses the
	// system pool.
	CAFile string

	// CacheTTL bounds how long a caller's workspace list is reused.
	//
	// Without it every MCP tool call costs a round trip to the access VW. With
	// it, a revoked binding stays visible for up to this long — the access graph
	// is already eventually consistent, so this adds to an existing window
	// rather than introducing a new class of staleness.
	CacheTTL time.Duration
}

AccessConfig points at the access virtual workspace, which answers "which workspaces can this caller see".

This component deliberately holds no access graph of its own. Duplicating the RBAC indexer would double the watch load on kcp and give two answers that can disagree; asking the access VW makes it the single source of truth and makes SelfClusterAccessReview earn its keep as a real API rather than an internal function call.

type KcpConfig

type KcpConfig struct {
	// Kubeconfig is the server's own credential, used as the base for
	// impersonated per-workspace requests.
	Kubeconfig string
}

KcpConfig is how this component reaches the workspaces a caller is allowed to use.

The credential is the server's own ServiceAccount, not the caller's: behind the front-proxy the caller's bearer token is consumed by the proxy and never arrives here. Per-workspace calls therefore impersonate the caller, which means this identity needs impersonate on users, groups and userextras.authentication.k8s.io.

type OAuthConfig added in v0.1.1

type OAuthConfig struct {
	AuthorizationServers []string
	Resource             string
	Scopes               []string
}

OAuthConfig is the optional RFC 9728 protected-resource surface. Setting AuthorizationServers enables it; see mcp.OAuthOptions.

type ServerConfig

type ServerConfig struct {
	Access AccessConfig
	Kcp    KcpConfig
	OAuth  OAuthConfig

	// Toolsets names the tool groups this server exposes. The selection is
	// enforced here, server-side, so it is policy rather than a client
	// preference: a toolset that is not enabled never exists for any caller.
	Toolsets []string

	// SecureServing is TLS-only on purpose: behind the front-proxy the proxy
	// verifies this server's certificate, and this server verifies the proxy's
	// via the requestheader CA.
	SecureServing *genericoptions.SecureServingOptions

	// Authentication must resolve callers to the same usernames kcp does.
	// Identity is only used to ask the access VW and to impersonate, both of
	// which compare names verbatim.
	Authentication *kubeoptions.BuiltInAuthenticationOptions
	// contains filtered or unexported fields
}

ServerConfig is the full flag surface.

func NewServerConfig

func NewServerConfig() ServerConfig

NewServerConfig returns the defaults for running behind kcp's front-proxy.

func (*ServerConfig) AddFlags

func (c *ServerConfig) AddFlags(fs *pflag.FlagSet)

AddFlags registers every flag on fs.

func (*ServerConfig) Validate

func (c *ServerConfig) Validate() error

Validate reports configuration that cannot work.

Jump to

Keyboard shortcuts

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