Documentation
¶
Index ¶
- func AdminHandler(shared *Shared, r chi.Router)
- func AutoHandler(shared *Shared, r chi.Router)
- func AutoRouteHandler(s *Shared, r chi.Router)
- func CacheHandler(shared *Shared, r chi.Router)
- func CertsHandler(s *Shared, r chi.Router)
- func ClusterHandler(s *Shared, r chi.Router)
- func FirewallHandler(s *Shared, r chi.Router)
- func HostHandler(s *Shared, r chi.Router)
- func KVHandler(s *Shared, r chi.Router)
- func KeeperHandler(s *Shared, r chi.Router)
- func RevokeHandler(s *Shared, r chi.Router)
- func RouterHandler(s *Shared, r chi.Router)
- func SecretsHandler(s *Shared, r chi.Router)
- func SystemHandler(s *Shared, r chi.Router)
- func TOTPHandler(s *Shared, r chi.Router)
- func ValidateDomainParam(next http.Handler) http.Handler
- func ValidateKeyParam(next http.Handler) http.Handler
- type ActiveState
- type AutoRoute
- type Certs
- type Cluster
- type Firewall
- type Host
- type KV
- type Keeper
- type Revoke
- type Route
- type Secrets
- type Shared
- type System
- type SystemInfo
- type TOTP
- type UpdateChecker
- type UpdateInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminHandler ¶ added in v0.1.0
func AutoHandler ¶ added in v0.1.0
func AutoRouteHandler ¶ added in v0.1.0
AutoRouteHandler registers the service self-registration routes under /auto/v1. Unlike RouterHandler (admin), these routes scope DELETE to the calling service's own identity — a service may only deregister routes it registered itself.
func CacheHandler ¶ added in v0.1.2
CacheHandler registers CDN cache management endpoints under /cache. Mirrors the FirewallHandler pattern exactly.
func CertsHandler ¶ added in v0.1.0
CertsHandler registers all certificate management API endpoints under /certs. Caller must apply authentication middleware before mounting.
func ClusterHandler ¶ added in v0.1.0
ClusterHandler registers all cluster API routes directly on the provided chi.Router. It wires HTTP methods to dedicated handler functions on the Cluster instance.
func FirewallHandler ¶ added in v0.1.0
FirewallHandler registers all firewall management API endpoints under the /firewall prefix on the provided chi.Router. Caller should apply authentication middleware via r.Use() before or within the route group.
func HostHandler ¶ added in v0.1.0
HostHandler registers all host management API endpoints under the /discovery prefix on the provided chi.Router. Caller should apply authentication middleware via r.Use() before or within the route group.
func KVHandler ¶ added in v0.1.0
KVHandler registers in-memory KV endpoints under /api/v1/kv. Data is lost on server restart - this is intentional for temporary state.
func KeeperHandler ¶ added in v0.1.0
KeeperHandler registers all keeper API endpoints under /keeper. POST /keeper/unlock and GET /keeper/status are public — no auth required. All other routes must be protected by the caller's auth middleware.
func RevokeHandler ¶ added in v0.1.0
func RouterHandler ¶ added in v0.1.0
RouterHandler registers all route management API endpoints directly on the provided chi.Router. It wires POST and DELETE methods to dedicated handlers on the Route instance.
func SecretsHandler ¶ added in v0.1.0
func SystemHandler ¶ added in v0.1.0
func TOTPHandler ¶ added in v0.1.0
TOTPHandler registers all TOTP API endpoints under /totp.
func ValidateDomainParam ¶ added in v0.1.0
ValidateDomainParam is chi middleware that rejects path-traversal attempts in {domain} route parameters. It validates the domain segment before handler execution and returns 400 for unsafe values.
Types ¶
type ActiveState ¶ added in v0.1.0
type AutoRoute ¶ added in v0.1.0
type AutoRoute struct {
// contains filtered or unexported fields
}
func NewAutoRoute ¶ added in v0.1.0
type Certs ¶ added in v0.1.0
type Certs struct {
// contains filtered or unexported fields
}
Certs provides HTTP handlers for listing, uploading, and deleting TLS certificates.
type Cluster ¶ added in v0.1.0
type Cluster struct {
// contains filtered or unexported fields
}
Cluster provides HTTP handlers for cluster route management operations. It encapsulates dependencies for logging, security, and cluster coordination.
func NewCluster ¶ added in v0.1.0
NewCluster initializes a Cluster instance with shared application dependencies. It configures the logger namespace and prepares middleware for request handling.
type Firewall ¶ added in v0.1.0
type Firewall struct {
// contains filtered or unexported fields
}
Firewall provides HTTP handlers for IP blocking, unblocking, and rule listing operations. It encapsulates the firewall ppk and logger for administrative control.
func NewFirewall ¶ added in v0.1.0
NewFirewall initializes a Firewall instance with shared application dependencies. It configures the logger namespace and prepares the handler for firewall operations.
type Host ¶ added in v0.1.0
type Host struct {
// contains filtered or unexported fields
}
Host provides HTTP handlers for host configuration CRUD operations with HCL/JSON support. It encapsulates the discovery host ppk, storage directory, and logger for host operations.
type KV ¶ added in v0.1.0
type KV struct {
// contains filtered or unexported fields
}
KV provides HTTP handlers for in-memory key-value storage. Uses mappo.Cache for high-performance, TTL-capable caching with automatic eviction.
type Route ¶ added in v0.1.0
type Route struct {
// contains filtered or unexported fields
}
Route provides HTTP handlers for dynamic route registration and expiration management. It interacts with the cluster store to persist route metadata with optional TTL.
type Secrets ¶ added in v0.1.0
type Secrets struct {
// contains filtered or unexported fields
}
func NewSecrets ¶ added in v0.1.0
type Shared ¶ added in v0.1.0
type Shared struct {
// Used by CacheHandler for purge-by-tag and clear-all operations.
CacheStore stash.Store
// contains filtered or unexported fields
}
func (*Shared) State ¶ added in v0.1.0
func (s *Shared) State() *ActiveState
func (*Shared) UpdateState ¶ added in v0.1.0
func (s *Shared) UpdateState(newState *ActiveState)
type SystemInfo ¶ added in v0.1.0
type TOTP ¶ added in v0.1.0
type TOTP struct {
// contains filtered or unexported fields
}
TOTP handles TOTP secret generation, QR provisioning, and code verification.
func (*TOTP) VerifyCode ¶ added in v0.1.0
VerifyCode checks a TOTP code for a user against the current admin config.
Secret resolution order (all handled transparently by expect.Value.ResolveErr): Plain base32 literal in HCL: secret = "JBSWY3DPEHPK3PXP" Keeper reference in HCL: secret = "vault://admin/totp/alice" Environment variable in HCL: secret = "env.ALICE_TOTP_SECRET"
Returns false when TOTP is disabled, the user is not found, or the code is wrong.