type
HandlerOptions
type HandlerOptions struct {
developmentReadiness bool
allowUnverifiableReadiness bool
// AdminAssets overrides the framework's embedded admin asset filesystem.
AdminAssets fs.FS
// MaxBodyBytes limits decoded request bodies. Zero uses the framework default.
MaxBodyBytes int64
// SecureCookies restricts auth cookies to HTTPS requests.
SecureCookies bool
// AllowedOrigins lists browser origins permitted by CORS.
AllowedOrigins []string
// AllowedRequestHeaders appends application-owned CORS request headers to
// Ridu's SDK headers. Invalid HTTP token names are ignored.
AllowedRequestHeaders []string
// AllowedHosts restricts the HTTP Host header. Entries are exact hostnames
// with an optional port; an entry without a port accepts any port. Empty
// accepts every syntactically valid host for development. Production
// deployments should set their public hostnames.
AllowedHosts []string
// TrustedProxyCIDRs lists proxies whose forwarded client addresses are trusted.
TrustedProxyCIDRs []string
// AuthRateLimit is the maximum auth attempts per identity and client window.
AuthRateLimit int
// AuthRateWindow is the duration over which AuthRateLimit is enforced.
AuthRateWindow time.Duration
// Audit receives security-relevant application events.
Audit func(AuditEvent)
// Observe receives timing and status metadata for completed requests.
Observe func(RequestObservation)
// RequestError receives trusted diagnostic detail for internal failures and
// recovered panics. The HTTP response remains redacted.
RequestError func(RequestErrorEvent)
// RequestTimeout limits request execution. Zero uses the framework default;
// a negative duration disables the handler deadline for streaming plugins.
RequestTimeout time.Duration
// ReadinessChecks add application/plugin dependencies to /readyz. Checks
// must be read-only, repeatable, and honor Context cancellation.
ReadinessChecks []ReadinessCheck
// ReadinessTimeout bounds the complete database, storage, and custom
// readiness probe. Zero uses five seconds; a negative duration disables it.
ReadinessTimeout time.Duration
// ContentSecurityPolicy overrides the framework admin policy. Empty uses a
// conservative default compatible with live-preview frames.
ContentSecurityPolicy string
// DisableContentSecurityPolicy explicitly disables the admin CSP when an
// upstream gateway owns it.
DisableContentSecurityPolicy bool
// StrictTransportSecurity is emitted verbatim when non-empty. Configure it
// only when every public request is HTTPS, normally at the TLS terminator.
StrictTransportSecurity string
// TaskInterval controls how often the durable task queues are polled. Zero
// uses the framework default.
TaskInterval time.Duration
// TaskBatch limits durable task leases claimed during one polling cycle.
TaskBatch int
// TaskQueues optionally restricts this process to named queues. An empty
// list consumes every queue, including unknown task slugs so they can be
// moved to a stable terminal failure.
TaskQueues []string
// TaskLeaseDuration is extended by heartbeats while a handler is running.
TaskLeaseDuration time.Duration
// TaskHeartbeatInterval must remain shorter than TaskLeaseDuration.
TaskHeartbeatInterval time.Duration
// TaskPruneBatch bounds terminal records removed after their retention.
TaskPruneBatch int
// AuthPruneBatch bounds expired sessions and API keys removed from each
// durable credential family during one background maintenance cycle.
AuthPruneBatch int
// JobError receives failures from scheduled background work.
JobError func(error)
}HTTP API, embedded admin, observability, security, and worker configuration.
Pass this value to App.Handler when embedding Ridu, or install it with WithHandlerOptions when Execute owns the server.
Related types
AuditEventSecurity-relevant application event metadata.
RequestObservationTransport timing and response metadata for one completed request.
RequestErrorEventTrusted internal diagnostics for a failed request or recovered panic.
ReadinessCheckOne repeatable required-dependency readiness check.