Documentation
¶
Overview ¶
Package httpapi exposes the HTTP adapter for DeltaScope. input: parsed HTTP audit requests, shared metadata-preparation helpers, and public audit execution functions output: additive HTTP audit context plus offline or metadata-aware audit execution results pos: HTTP adapter glue between request-scoped metadata inputs and the public DeltaScope audit API note: if this file changes, update this header and module README.md.
Package httpapi exposes the HTTP adapter for DeltaScope. input: HTTP requests carrying SQL audit payloads plus service-level config/version wiring output: JSON audit, rule-catalog, capability, health, readiness, version, structured error responses, and structured access log lines pos: interface adapter between net/http and the public DeltaScope audit API note: if this file changes, update this header and module README.md.
Package httpapi exposes the HTTP adapter for DeltaScope. input: HTTP query-access analysis requests carrying SQL text, dialect, mode, and optional schema context output: JSON query access analysis results for the HTTP adapter pos: HTTP adapter glue between request-scoped inputs and the public DeltaScope query access API note: if this file changes, update this header and module README.md.
Package httpapi exposes the HTTP adapter for DeltaScope. input: HTTP rule-discovery requests plus shipped catalog and capability metadata output: JSON rule-list, rule-detail, and capability payloads for the HTTP adapter pos: HTTP discovery helpers above the domain rule catalog and shared JSON writers note: if this file changes, update this header and module README.md.
Package httpapi exposes the HTTP adapter for DeltaScope. input: listen addresses plus service-level config/version wiring output: ready-to-run HTTP server instances for the JSON audit service pos: long-running net/http server assembly for the HTTP interface milestone note: if this file changes, update this header and module README.md.
Index ¶
- func NewHandler(configPath, version string, opts ...HandlerOption) (http.Handler, error)
- func NewServer(addr, configPath, version string, opts ...HandlerOption) (*http.Server, error)
- type AuthConfig
- type HandlerOption
- func WithAuditFunc(fn func(context.Context, deltascope.Request) (deltascope.Result, error)) HandlerOption
- func WithAuthConfig(cfg AuthConfig) HandlerOption
- func WithMetadataConfig(cfg MetadataConfig) HandlerOption
- func WithMiddlewareConfig(cfg MiddlewareConfig) HandlerOption
- func WithSlogLogger(sl *slog.Logger) HandlerOption
- type MetadataConfig
- type MiddlewareConfig
- type RateLimitConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(configPath, version string, opts ...HandlerOption) (http.Handler, error)
NewHandler returns the JSON HTTP adapter for DeltaScope.
Types ¶
type AuthConfig ¶ added in v0.10.0
AuthConfig controls API-key authentication on the HTTP adapter.
type HandlerOption ¶ added in v0.10.0
type HandlerOption func(*handlerOptions)
HandlerOption configures NewHandler behavior.
func WithAuditFunc ¶ added in v0.10.0
func WithAuditFunc(fn func(context.Context, deltascope.Request) (deltascope.Result, error)) HandlerOption
WithAuditFunc overrides the audit execution function (primarily for tests).
func WithAuthConfig ¶ added in v0.10.0
func WithAuthConfig(cfg AuthConfig) HandlerOption
WithAuthConfig enables API-key authentication on selected routes.
func WithMetadataConfig ¶ added in v0.63.0
func WithMetadataConfig(cfg MetadataConfig) HandlerOption
WithMetadataConfig sets runtime-level metadata defaults for the HTTP adapter.
func WithMiddlewareConfig ¶ added in v0.10.0
func WithMiddlewareConfig(cfg MiddlewareConfig) HandlerOption
WithMiddlewareConfig overrides default middleware settings.
func WithSlogLogger ¶ added in v0.62.0
func WithSlogLogger(sl *slog.Logger) HandlerOption
WithSlogLogger sets the structured logger. The slog.Logger is bridged to a *log.Logger for use by existing recovery and access-log middleware. If sl is nil the option is a no-op and the default log.Default() logger is used.
type MetadataConfig ¶ added in v0.63.0
MetadataConfig carries runtime-level metadata defaults for the HTTP adapter.
type MiddlewareConfig ¶ added in v0.10.0
type MiddlewareConfig struct {
RequestTimeout time.Duration
Logger *log.Logger
RateLimit RateLimitConfig
MetricsEnabled *bool
TrustedProxies []string
}
MiddlewareConfig controls default middleware behavior.