Documentation
¶
Overview ¶
package public adapts control API requests and performs request preflight. state owns the transactional authorization and lifecycle changes it requests.
Index ¶
- func NewHandler(cfg Config, stores Stores, authorizationStore AuthorizationStore, ...) (*http.ServeMux, error)
- type AdminStore
- type AuthorizationStore
- type BrowserAccessStore
- type BrowserSessionStore
- type CompanyBrowserStore
- type Config
- type ConnectorPeerPairStore
- type DeploymentConnectStore
- type DeploymentCredentialStore
- type DeploymentPublicationStore
- type DeploymentPublisherStore
- type DeploymentRuntimeStore
- type DeploymentStore
- type FeedbackStore
- type GuestPublisherStore
- type GuestStore
- type LocalProjectStore
- type PreviewStore
- type PreviewTeamAccessStore
- type ProjectConfigurationStore
- type ProjectServiceStore
- type PublisherIdentityStore
- type PublisherRuntimeStore
- type PublisherWatch
- type PublisherWatchStore
- type ServiceAuditStore
- type ServiceClientCertificateStore
- type ServiceHTTPStore
- type ServiceRunStore
- type ServiceStore
- type ShareAccessStore
- type ShareStore
- type Stores
- type WorkloadVisitorStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdminStore ¶
type AdminStore interface {
AdminRuntimeCounts(context.Context, time.Time) (controlstate.AdminRuntimeCounts, error)
ListAdminRelayLeases(context.Context, string, time.Time) (controlstate.AdminRelayPage, error)
BeginAdminRelayDrain(context.Context, controlstate.RelayLeaseIdentity, string, string, time.Time, time.Time) (controlstate.RelayLease, error)
ListMaintenanceControls(context.Context) ([]controlstate.MaintenanceControl, error)
SetMaintenanceControl(context.Context, controlstate.MaintenanceControlName, bool, string, string, time.Time) (controlstate.MaintenanceControl, error)
}
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 BrowserAccessStore ¶
type BrowserAccessStore interface {
ConsumeBrowserLogin(context.Context, string, []byte, time.Time) (controlstate.BrowserLoginAttempt, error)
IssueBrowserHandoff(context.Context, controlstate.BrowserLoginAttempt, controlstate.BrowserAccessSession, time.Time) (controlstate.BrowserHandoff, error)
}
type BrowserSessionStore ¶
type BrowserSessionStore interface {
CreateOIDCControlSession(context.Context, string, controlstate.OIDCIdentity, time.Duration, time.Duration, time.Time) (controlstate.ControlSession, error)
}
type CompanyBrowserStore ¶
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 ConnectorPeerPairStore ¶
type ConnectorPeerPairStore interface {
RetireConnectorPeerPair(context.Context, string, string, controlstate.ConnectorPeerPairRetireRequest, time.Time) (controlstate.ConnectorPeerPairRetirement, error)
RebindConnectorPeerPair(context.Context, string, string, controlstate.ConnectorPeerPairRebindRequest, time.Time) (controlstate.ConnectorPeerPairRebindState, error)
ListConnectorPeerPairs(context.Context, string, string, string, string, time.Time) (controlstate.ConnectorPeerPairCandidates, error)
ConfirmConnectorPeerPairPrepared(context.Context, string, string, string, string, controlstate.ConnectorPeerPairPrepared, time.Time) error
DeliverConnectorPeerPair(context.Context, string, string, string, int64, string, time.Time) (controlstate.ConnectorPeerPairDelivery, error)
// contains filtered or unexported methods
}
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 DeploymentPublicationStore ¶
type DeploymentPublicationStore interface {
GetDeploymentPublication(context.Context, controlstate.DeploymentScope, string, string, time.Time) (controlstate.ServiceRecord, error)
AllocateDeploymentPublication(context.Context, controlstate.AllocateDeploymentPublicationRequest) (controlstate.ServiceRecord, error)
}
type DeploymentPublisherStore ¶
type DeploymentPublisherStore interface {
CreateDeploymentPublisherEnrollment(context.Context, controlstate.CreateDeploymentPublisherEnrollmentRequest) (controlstate.DeploymentPublisherEnrollment, error)
ListDeploymentPublishers(context.Context, controlstate.DeploymentScope, string, string, int) ([]controlstate.DeploymentPublisher, error)
GetDeploymentPublisher(context.Context, controlstate.DeploymentScope, string, string) (controlstate.DeploymentPublisher, error)
RevokeDeploymentPublisher(context.Context, controlstate.DeploymentScope, string, string, time.Time) 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 DeploymentStore ¶
type DeploymentStore interface {
RenameDeploymentNamespace(context.Context, controlstate.RenameDeploymentNamespaceRequest) (controlstate.AppliedProjectConfiguration, error)
RenameDeployment(context.Context, string, string, string, string, string, int64, time.Time) (controlstate.AppliedProjectConfiguration, error)
CreateDeployment(context.Context, controlstate.CreateDeploymentRequest) (controlstate.Deployment, error)
UpdateDeployment(context.Context, controlstate.UpdateDeploymentRequest) (controlstate.Deployment, error)
GetDeployment(context.Context, controlstate.DeploymentScope, string) (controlstate.Deployment, error)
ListDeployments(context.Context, controlstate.DeploymentScope, string, int) ([]controlstate.Deployment, error)
DeleteDeployment(context.Context, controlstate.DeploymentScope, string, int64, time.Time) error
}
type FeedbackStore ¶
type FeedbackStore interface {
CreateServiceRunPreview(context.Context, controlstate.ServiceHTTPRun, time.Time) (controlstate.Preview, error)
AuthorizeReviewerFeedback(context.Context, controlstate.ServiceHTTPRun, string, string, controlstate.FeedbackActor, time.Time) (controlv1.FeedbackAuthorization, error)
AuthorizeImplementerFeedback(context.Context, string, string, string, string, time.Time) (controlv1.FeedbackAuthorization, error)
}
type GuestPublisherStore ¶
type GuestPublisherStore interface {
EnrollGuestPublisher(context.Context, controlstate.GuestCredential, string, ed25519.PublicKey, time.Time) (controlstate.PublisherIdentity, error)
}
type GuestStore ¶
type GuestStore interface {
CreateGuestTrial(context.Context, controlstate.NewGuestTrial, string, time.Time) (controlstate.GuestTrial, error)
GuestTrialByAccessToken(context.Context, credentials.AccessToken) (controlstate.GuestTrial, error)
AllocateGuestDemoService(context.Context, controlstate.AllocateGuestDemoServiceRequest) (controlstate.ServiceRecord, error)
GuestIssuanceAllowed(context.Context, netip.Addr, time.Time) error
}
type LocalProjectStore ¶
type LocalProjectStore interface {
GetLocalProjectService(context.Context, controlstate.GetLocalProjectServiceRequest) (controlstate.LocalProjectService, error)
RealizeLocalProjectService(context.Context, controlstate.RealizeLocalProjectServiceRequest) (controlstate.LocalProjectService, error)
GetProjectPublicMetadata(context.Context, string, string, string, time.Time) (controlstate.ProjectPublicMetadata, error)
}
type PreviewStore ¶
type PreviewStore interface {
ListPreviews(context.Context, string, string, string) (controlstate.PreviewPage, error)
CreatePreview(context.Context, string, string, string, time.Time) (controlstate.Preview, error)
GetPreview(context.Context, string) (controlstate.Preview, error)
AddPreviewService(context.Context, controlstate.AddPreviewServiceRequest, time.Time) (controlstate.Preview, error)
}
type PreviewTeamAccessStore ¶
type PreviewTeamAccessStore interface {
SetPreviewTeamAccess(context.Context, controlstate.SetPreviewTeamAccessRequest, time.Time) (controlstate.Preview, error)
}
type ProjectConfigurationStore ¶
type ProjectConfigurationStore interface {
RetireProject(context.Context, string, string, string, int64, time.Time) (controlstate.AppliedProjectConfiguration, error)
GetProjectStatus(context.Context, string, string, string, string, time.Time) (controlstate.ProjectStatus, error)
ListProjects(context.Context, string, string, string) (controlstate.ProjectPage, error)
ApplyProjectConfiguration(context.Context, controlstate.ApplyProjectConfigurationRequest) (controlstate.AppliedProjectConfiguration, error)
GetProjectConfiguration(context.Context, string, string, string, string) (controlstate.AppliedProjectConfiguration, error)
}
type ProjectServiceStore ¶
type ProjectServiceStore interface {
GetProjectService(context.Context, controlstate.GetProjectServiceRequest) (controlstate.ServiceRecord, error)
}
type PublisherIdentityStore ¶
type PublisherIdentityStore interface {
IdentityContext(context.Context, string) (controlstate.IdentityContext, error)
IssuePublisherEnrollment(context.Context, controlstate.CreatePublisherEnrollmentRequest) (controlstate.PublisherEnrollment, error)
CreatePublisherGrant(context.Context, controlstate.CreatePublisherGrantRequest) (string, error)
ListPublisherIdentities(context.Context, string, string) (controlstate.PublisherIdentityPage, error)
PublisherIdentityRecord(context.Context, string, string) (controlstate.PublisherRecord, error)
AuthorizePublisherManagement(context.Context, string, string, string) error
RevokePublisherIdentity(context.Context, string, string, string, time.Time) error
RevokePublisherGrant(context.Context, string, string, string, string, time.Time) error
AuthenticatePublisherAccess(context.Context, string, string, time.Time) (controlstate.PublisherIdentity, error)
AllocatePublisherService(context.Context, controlstate.PublisherIdentity, controlstate.AllocateServiceRequest, time.Time) (controlstate.ServiceRecord, error)
DeletePublisherService(context.Context, controlstate.PublisherIdentity, string, time.Time) 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
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 {
}
type ShareStore ¶
type ShareStore interface {
}
type Stores ¶
type Stores struct {
Admin AdminStore
Previews PreviewStore
PreviewTeamAccess PreviewTeamAccessStore
BrowserAccess BrowserAccessStore
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)
}
Source Files
¶
- admin.go
- admission.go
- applied_service_lookup.go
- authentication.go
- authorizer.go
- browser_access.go
- connector_peer_pairs.go
- connector_peer_rebind.go
- connector_peer_retirement.go
- cors.go
- demo_feedback.go
- deployment_connect.go
- deployment_credentials.go
- deployment_publication.go
- deployment_publishers.go
- deployment_runtime.go
- deployments.go
- feedback_owner.go
- feedback_permission_errors.go
- feedback_reviewer.go
- guest_dispatch.go
- guest_publisher.go
- guests.go
- handler.go
- local_project_services.go
- preview_team_access.go
- previews.go
- problems.go
- project_configuration.go
- publisher_identities.go
- publisher_namespace.go
- publisher_request.go
- publisher_runtime.go
- publisher_watch.go
- service_audit.go
- service_certificates.go
- service_client_certificates.go
- service_enabled.go
- service_http.go
- service_runs.go
- services.go
- share_access.go
- shares.go
- stores.go
- traffic.go
- visitor_policy.go
- visitor_source.go
- visitor_tokens.go
- webhook_provider_sources.go
- workloads.go