public

package
v0.1.0-rc.49 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: BSD-3-Clause Imports: 50 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

package public adapts control API requests and performs request preflight. state owns the transactional authorization and lifecycle changes it requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(
	cfg Config,
	stores Stores,
	authorizationStore AuthorizationStore,
	readiness func(context.Context) error,
) (*http.ServeMux, error)

NewHandler constructs the control API.

Types

type AdminStore

AdminStore owns administrator operations.

type AuthorizationStore

type AuthorizationStore interface {
	AuthenticateAccessToken(context.Context, credentials.AccessToken, time.Time) (controlstate.ControlPrincipal, error)
	AuthorizeTeamSession(context.Context, controlstate.ControlPrincipal, string, time.Time) error
	IdentityContext(context.Context, string) (controlstate.IdentityContext, error)
}

AuthorizationStore provides current identity and team session authority.

type BrowserSessionStore

type BrowserSessionStore interface {
	CreateOIDCControlSession(context.Context, string, controlstate.OIDCIdentity, time.Duration, time.Duration, time.Time) (controlstate.ControlSession, error)
}

type CompanyBrowserStore

type CompanyBrowserStore interface {
	PrepareCompanyBrowser(context.Context, string, string, string, string, time.Time) (*controlstate.CompanyLoginIntent, error)
}

type Config

type Config struct {
	TrafficDefaults                   trafficlimits.Limits
	TrafficCeiling                    trafficlimits.Limits
	Role                              controlv1.AdminServerStatusRole
	StartedAt                         time.Time
	ManagedDomain                     string
	ManagedURLMode                    naming.ManagedURLMode
	ManagedDomainMaxMemberChildLabels int
	CustomDomainsEnabled              bool
	ControlURL                        string
	OIDCIssuer                        string
	OIDCClientID                      string
	OIDCClientSecret                  string
	OIDCVerifier                      oidc.Verifier
	WebServiceSecret                  string
	AccessTokenLifetime               time.Duration
	RefreshTokenLifetime              time.Duration
	OIDCScopes                        []string
	CertificateIssuance               bool
	ACMEDirectoryURL                  string
	ServerDomain                      string
	HTTPClient                        *http.Client
	WebhookCatalog                    *webhooks.Catalog
	DNSAutomation                     bool
	GuestDemoEnabled                  bool
	Metrics                           *observability.Metrics
	PublisherWatch                    *PublisherWatch
	Route53CredentialsReadiness       func(context.Context) error
	ControlReadiness                  func() error
	AcceptingNewWork                  func() bool
	IngressReadiness                  func() error
	RelayReadiness                    func() error
}

Config contains the public API settings derived from tnld configuration.

type DeploymentConnectStore

type DeploymentConnectStore interface {
	SelectDeploymentServiceRun(context.Context, string, string, string, string, controlstate.VisitorTokenSource, time.Time) (controlstate.ServiceSelection, error)
}

type DeploymentCredentialStore

type DeploymentCredentialStore interface {
	RegisterDeploymentCredential(context.Context, controlstate.RegisterDeploymentCredentialRequest) (controlstate.DeploymentCredential, error)
}

type DeploymentRuntimeStore

type DeploymentRuntimeStore interface {
	RedeemScopedDeploymentPublisherEnrollment(context.Context, string, ed25519.PublicKey, string, string, time.Time) (controlstate.DeploymentPublisherIdentity, error)
	AcquireDeploymentPublisherLease(context.Context, string, string, string, string, time.Time) (controlstate.DeploymentPublisherLease, error)
	VerifyDeploymentIdentity(context.Context, string, string, string, string, time.Time) (controlstate.DeploymentPublisherVerification, error)
	GetDeploymentPublisherAssignments(context.Context, string, time.Time) (controlstate.DeploymentPublisherAssignments, error)
	GetDeploymentPublisherAppAssignments(context.Context, string, time.Time) (controlstate.DeploymentPublisherAssignments, error)
	AcknowledgeDeploymentPublisherConfiguration(context.Context, string, int64, string, bool, time.Time) error
}

type GuestPublisherStore

type GuestPublisherStore interface {
	EnrollGuestPublisher(context.Context, controlstate.GuestCredential, string, ed25519.PublicKey, time.Time) (controlstate.PublisherIdentity, error)
}

type PreviewTeamAccessStore

type PreviewTeamAccessStore interface {
	SetPreviewTeamAccess(context.Context, controlstate.SetPreviewTeamAccessRequest, time.Time) (controlstate.Preview, error)
}

type ProjectServiceStore

type ProjectServiceStore interface {
	GetProjectService(context.Context, controlstate.GetProjectServiceRequest) (controlstate.ServiceRecord, error)
}

type PublisherRuntimeStore

type PublisherRuntimeStore interface {
	PublisherRuntime(context.Context, controlstate.PublisherRuntimeRequest) (controlstate.PublisherRuntimeResponse, error)
}

type PublisherWatch

type PublisherWatch struct {
	// contains filtered or unexported fields
}

PublisherWatch batches the control process's authorized waits. it owns no grants or database connections; waits release their own reservations.

func NewPublisherWatch

func NewPublisherWatch(store PublisherWatchStore) *PublisherWatch

func (*PublisherWatch) Run

func (watch *PublisherWatch) Run(ctx context.Context) error

Run is owned and joined once by the control process.

type PublisherWatchStore

type PublisherWatchStore interface {
	AuthorizeConnectorPeerWatch(context.Context, string, string, int64, string, time.Time) error
	CompareConnectorPeerWatchVersions(context.Context, []controlstate.ConnectorPeerWatchVersion) ([]controlstate.ConnectorPeerWatchVersion, error)
}

type ServiceAuditStore

type ServiceAuditStore interface {
	IngestServiceRunObservations(context.Context, string, string, string, int64, serviceaudit.Batch, time.Time) (controlstate.ServiceObservationResult, error)
	// contains filtered or unexported methods
}

type ServiceClientCertificateStore

type ServiceClientCertificateStore interface {
	IssueServiceClientCertificate(context.Context, string, string, string, []byte, time.Time) (controlstate.ServiceClientCertificate, error)
	AuthorizeServiceClientCertificate(context.Context, string, string, string, string, int64, netip.Addr, int, []byte, time.Time) (controlstate.ServiceVisitorValidity, error)
}

type ServiceHTTPStore

type ServiceHTTPStore interface {
	ListServiceHTTPGrants(context.Context, string, string, time.Time) ([]controlv1.ServiceHTTPGrantSummary, error)
	RefreshServiceBrowserSession(context.Context, string, string, time.Time, func(context.Context, string) (controlstate.BrowserTokenRotation, error), ...string) (controlstate.BrowserAccessSession, error)
	// contains filtered or unexported methods
}

type ServiceRunStore

type ServiceRunStore interface {
	StartServiceRun(context.Context, string, string, int64, controlstate.PublisherIdentity, time.Time) (controlstate.ServiceRunState, error)
	// contains filtered or unexported methods
}

type ServiceStore

type ServiceStore interface {
	GetServiceForPublisher(context.Context, string, controlstate.PublisherIdentity, time.Time) (controlstate.ServiceRecord, error)
	// contains filtered or unexported methods
}

type ShareAccessStore

type ShareAccessStore interface {
	RedeemShare(context.Context, controlstate.ServiceHTTPRun, string, []byte, []byte, time.Time) (controlstate.ShareRedemption, error)
}

type Stores

type Stores struct {
	Admin                     AdminStore
	Previews                  PreviewStore
	PreviewTeamAccess         PreviewTeamAccessStore
	BrowserAccess             BrowserAccessStore
	Shares                    ShareStore
	ShareAccess               ShareAccessStore
	Feedback                  FeedbackStore
	Guests                    GuestStore
	GuestPublishers           GuestPublisherStore
	PublisherIdentities       PublisherIdentityStore
	DeploymentRuntime         DeploymentRuntimeStore
	PublisherRuntime          PublisherRuntimeStore
	ProjectConfiguration      ProjectConfigurationStore
	Deployments               DeploymentStore
	DeploymentPublishers      DeploymentPublisherStore
	DeploymentCredentials     DeploymentCredentialStore
	DeploymentConnect         DeploymentConnectStore
	DeploymentPublication     DeploymentPublicationStore
	ProjectServices           ProjectServiceStore
	LocalProjects             LocalProjectStore
	Services                  ServiceStore
	ServiceRuns               ServiceRunStore
	ServiceCertificates       managedCertificateStore
	ServiceClientCertificates ServiceClientCertificateStore
	ServiceHTTP               ServiceHTTPStore
	ServiceAudit              ServiceAuditStore
	ConnectorPeerPairs        ConnectorPeerPairStore
	VisitorPolicy             publisherVisitorPolicyStore
	VisitorTokens             visitorTokenIssuer
	CompanyBrowser            CompanyBrowserStore
	BrowserSessions           BrowserSessionStore
	Workloads                 WorkloadVisitorStore
}

Stores declares each API capability explicitly. nil optional stores retain their existing unavailable responses; methods on another store never enable them.

func DatabaseStores

func DatabaseStores(database *controlstate.Database) Stores

DatabaseStores binds the built-in database at compile time, without runtime capability discovery. daemon composition and real database fixtures share it.

type WorkloadVisitorStore

type WorkloadVisitorStore interface {
	ListWorkloadServices(context.Context, string, time.Time) ([]controlstate.WorkloadService, error)
	CheckWorkloadService(context.Context, string, string, time.Time) (controlstate.WorkloadServiceAuthorization, error)
	IssueWorkloadServiceClientCertificate(context.Context, string, string, []byte, time.Time) (controlstate.ServiceClientCertificate, error)
	SelectWorkloadServiceRun(context.Context, string, string, time.Time) (controlstate.ServiceSelection, error)
}

Jump to

Keyboard shortcuts

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