server

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeDashboardRead    = "dashboard:read"
	ScopeOperatorMutate   = "operator:mutate"
	ScopeEnrollmentAdmin  = "enrollment:admin"
	ScopeActionsExecute   = "actions:execute"
	ScopeActionsAuthorize = "actions:authorize"
	ScopeAgentIngest      = "agent:ingest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Credential

type Credential struct {
	Token         string
	PrincipalID   string
	Scopes        []string
	NodeID        string
	ApplicationID string
	ExpiresAt     time.Time
	RequireMTLS   bool
}

Credential configures one independently revocable calling identity. Tokens are hashed during server construction and are never retained in plaintext.

type Options

type Options struct {
	Config            config.Config
	Database          *storage.DB
	Events            *events.Store
	Audit             *audit.Service
	Enrollment        *enrollment.Service
	PolicyCompiler    *policy.Compiler
	PostureEngine     *posture.Engine
	Findings          *findings.Service
	Scrambler         *scrambler.Planner
	NanoRegistry      *nano.Registry
	NanoRunInterval   time.Duration
	NanoRunProgramIDs []string
	DeploymentID      string
	Credentials       []Credential
	AuthorizationKey  []byte
	NodeClientCAs     *x509.CertPool
	Version           string
	Clock             func() time.Time
}

type Server

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

Server exposes the authenticated REST and live-projection surface. It owns no database or key material and can therefore be shut down before the composition root closes those dependencies.

func New

func New(options Options) (*Server, error)

func (*Server) Handler

func (server *Server) Handler() http.Handler

func (*Server) Serve

func (server *Server) Serve(ctx context.Context) error

Serve listens according to the already-validated config and drains active requests on cancellation. Long-lived SSE and action-wait handlers inherit a base context that is cancelled before Shutdown begins.

Jump to

Keyboard shortcuts

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