Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthMiddleware ¶
type AuthMiddleware struct {
// contains filtered or unexported fields
}
AuthMiddleware validates agent identity on intercepted HTTP API calls.
Agents include X-Agent-ID and X-Agent-Signature headers so shield-agent can verify who is making the outbound API call before forwarding it upstream.
mode "closed": reject requests with invalid or missing signatures (HTTP 401). mode "open": log failures but pass all requests through.
func NewAuthMiddleware ¶
func NewAuthMiddleware(store auth.KeyStore, mode string, logger *slog.Logger, onAuth func(string)) *AuthMiddleware
NewAuthMiddleware creates an AuthMiddleware. onAuth is called with "verified", "failed", or "unsigned" for each request.
func (*AuthMiddleware) WrapHandler ¶
func (a *AuthMiddleware) WrapHandler(next http.Handler) http.Handler
WrapHandler returns an http.Handler that authenticates agent HTTP API calls.
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain applies a list of Middlewares in order (first = outermost wrapper).
func NewChain ¶
func NewChain(items ...Middleware) *Chain
NewChain creates a new Chain from the provided middlewares.
type LogMiddleware ¶
type LogMiddleware struct {
// contains filtered or unexported fields
}
LogMiddleware records agent→HTTP API request/response pairs to the database.
func NewLogMiddleware ¶
NewLogMiddleware creates a LogMiddleware and starts its background writer. recorder may be nil to disable telemetry forwarding.
func (*LogMiddleware) Close ¶
func (lm *LogMiddleware) Close()
Close shuts down the background writer.
func (*LogMiddleware) WrapHandler ¶
func (lm *LogMiddleware) WrapHandler(next http.Handler) http.Handler
WrapHandler returns an http.Handler that logs agent→API request/response pairs.
type Middleware ¶
Middleware wraps an http.Handler to intercept agent→HTTP API calls.