Documentation
¶
Index ¶
- type AllowAll
- type AllowAllPolicy
- type AuditEvent
- type AuditLogger
- type Authorizer
- type Builder
- func (b *Builder) Build() (*Server, error)
- func (b *Builder) Capabilities() *Capabilities
- func (b *Builder) WithAuditLog(l AuditLogger) *Builder
- func (b *Builder) WithAuthorizer(a Authorizer) *Builder
- func (b *Builder) WithEdition(edition string) *Builder
- func (b *Builder) WithIdentityProvider(idp IdentityProvider) *Builder
- func (b *Builder) WithLicense(l *LicenseInfo) *Builder
- func (b *Builder) WithPolicyEnforcer(p PolicyEnforcer) *Builder
- func (b *Builder) WithRoutes(registrars ...RouteRegistrar) *Builder
- func (b *Builder) WithScanRules(s ScanRuleProvider) *Builder
- type Capabilities
- type CapabilitiesResponse
- type Features
- type IdentityProvider
- type LicenseInfo
- type NoopAuditLogger
- type PolicyEnforcer
- type ReadyChecks
- type RouteRegistrar
- type ScanRuleProvider
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowAllPolicy ¶
type AllowAllPolicy struct{}
func (AllowAllPolicy) CheckActivation ¶
func (AllowAllPolicy) CheckActivation(_ context.Context, _, _ string) error
func (AllowAllPolicy) CheckPublish ¶
type AuditEvent ¶
type AuditLogger ¶
type AuditLogger interface {
Log(ctx context.Context, event AuditEvent) error
}
type Authorizer ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder assembles a Server from its constituent parts. The zero value is not useful — use NewBuilder. Callers chain With* methods to opt into enterprise extension points, then call Build to get a runnable Server.
func NewBuilder ¶
NewBuilder creates a Builder with OSS defaults: no extension points, no enterprise features, edition "oss".
func (*Builder) Build ¶
Build assembles all server components from the builder and returns a Server ready to serve. It creates the session manager, storage, auth stores, router, Huma API, all routes, and the embedded SPA mount. It does NOT call ListenAndServe — that's a separate method on Server so callers can inject test transports or configure TLS before starting.
func (*Builder) Capabilities ¶
func (b *Builder) Capabilities() *Capabilities
Capabilities returns the Capabilities value accumulated so far. This is primarily useful for testing — in production you call Build.
func (*Builder) WithAuditLog ¶
func (b *Builder) WithAuditLog(l AuditLogger) *Builder
WithAuditLog attaches an AuditLogger and enables the audit feature flag.
func (*Builder) WithAuthorizer ¶
func (b *Builder) WithAuthorizer(a Authorizer) *Builder
WithAuthorizer attaches an Authorizer (RBAC) and enables the rbac and teams feature flags.
func (*Builder) WithEdition ¶
WithEdition overrides the edition string (e.g. "enterprise") in capability responses.
func (*Builder) WithIdentityProvider ¶
func (b *Builder) WithIdentityProvider(idp IdentityProvider) *Builder
WithIdentityProvider attaches an IdentityProvider (SSO) and enables the sso feature flag.
func (*Builder) WithLicense ¶
func (b *Builder) WithLicense(l *LicenseInfo) *Builder
WithLicense sets the license metadata returned by the capabilities endpoint.
func (*Builder) WithPolicyEnforcer ¶
func (b *Builder) WithPolicyEnforcer(p PolicyEnforcer) *Builder
WithPolicyEnforcer attaches a PolicyEnforcer and enables the governance feature flag.
func (*Builder) WithRoutes ¶
func (b *Builder) WithRoutes(registrars ...RouteRegistrar) *Builder
WithRoutes registers additional route registrars that are called during Build after all core routes are wired. Enterprise plugins use this to inject their own endpoints.
func (*Builder) WithScanRules ¶
func (b *Builder) WithScanRules(s ScanRuleProvider) *Builder
WithScanRules attaches a ScanRuleProvider and enables the custom_scan feature flag.
type Capabilities ¶
type Capabilities struct {
// contains filtered or unexported fields
}
func NewCapabilities ¶
func NewCapabilities() *Capabilities
func (*Capabilities) EnableFeature ¶
func (c *Capabilities) EnableFeature(name string)
func (*Capabilities) Register ¶
func (c *Capabilities) Register(api huma.API)
func (*Capabilities) Response ¶
func (c *Capabilities) Response() CapabilitiesResponse
func (*Capabilities) SetEdition ¶
func (c *Capabilities) SetEdition(edition string)
func (*Capabilities) SetLicense ¶
func (c *Capabilities) SetLicense(l *LicenseInfo)
type CapabilitiesResponse ¶
type CapabilitiesResponse struct {
Edition string `json:"edition"`
Features Features `json:"features"`
License *LicenseInfo `json:"license"`
}
type IdentityProvider ¶
type LicenseInfo ¶
type NoopAuditLogger ¶
type NoopAuditLogger struct{}
func (NoopAuditLogger) Log ¶
func (NoopAuditLogger) Log(_ context.Context, _ AuditEvent) error
type PolicyEnforcer ¶
type ReadyChecks ¶ added in v0.6.0
ReadyChecks holds the per-dependency readiness status. Each field is either "ok" or "unavailable" — real errors are logged server-side and never included in the HTTP response.
type RouteRegistrar ¶
RouteRegistrar is a function that registers additional routes onto the Huma API and Chi router. Enterprise plugins use this to add their own endpoints.
type ScanRuleProvider ¶
type Server ¶
type Server struct {
// Handler is the fully assembled Chi router, ready to be passed to
// http.Server or used in tests with httptest.NewServer.
Handler http.Handler
// contains filtered or unexported fields
}
Server wraps the assembled HTTP handler and configuration needed to start listening. Build() produces a Server; ListenAndServe() runs it.
func (*Server) ListenAndServe ¶
ListenAndServe starts the HTTP server and blocks until a SIGINT or SIGTERM is received, then performs a graceful shutdown with a 10-second timeout.