Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// BindAddress is the TCP address the HTTP server listens on (e.g. ":8080").
BindAddress string
// KeyStore is the API key store used for authentication.
KeyStore apikey.KeyStore
// AdminKeyManager validates the shared admin key. When nil, admin-key
// authentication is disabled (dev mode).
AdminKeyManager *apikey.AdminKeyManager
// IAMService resolves team/user identities to Kubernetes namespaces and
// handles JWT-based authentication issued by the BFF.
IAMService service.IAMService
// JWTSecret is the HS256 secret used to verify IAM JWT tokens issued by the BFF.
// When empty, JWT-based authentication is disabled.
JWTSecret string
// RestConfig is the Kubernetes REST config, used for WebSocket exec (terminal).
// When nil, the terminal endpoint is disabled.
RestConfig *rest.Config
// SyncToken is the shared secret used to authenticate ws-proxy connections on
// /v1/ws/sync. When empty, the sync endpoint is disabled.
SyncToken string
// ClusterConfigSink is called whenever a cluster_config_sync frame arrives from
// ws-proxy. Typically a cluster.ConfigMapWriter that persists the routing table
// so ExtProc can read it. May be nil when cluster config sync is not required.
ClusterConfigSink service.ClusterConfigSink
// Forwarder is the cross-cluster forwarder. When nil, cross-cluster requests
// will be rejected. Typically constructed from cluster store + localClusterID.
// The forwarder already carries the local cluster ID internally.
Forwarder *service.CrossClusterForwarder
// ClusterStore is the shared in-memory catalog of known clusters. It is
// surfaced through GET /v1/clusters so SDK/CLI callers can discover valid
// cross-cluster prefixes. May be nil in single-cluster deployments.
ClusterStore *cluster.Store
// LocalClusterID identifies the cluster serving this API server. Used to mark
// the `local: true` entry in the /v1/clusters response. Empty in
// single-cluster deployments where cross-cluster routing is disabled.
LocalClusterID string
// QuotaProvider selects the quota backend exposed by GET /v1/quotas and
// inspected by the /v1/feature-gates endpoint. When nil, a Noop provider
// is used (feature disabled).
QuotaProvider quotaplugin.Provider
// ServerVersion is the build-time version string stamped on every response
// via X-AgentBox-Server-Version. Set from pkg/version.Version in app.go.
ServerVersion string
}
Config holds the configuration for the API server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the HTTP API server.
func New ¶
func New(cfg Config, k8sClient client.Client, clientset kubernetes.Interface, sandboxStore store.SandboxStore, pluginManager *plugins.PluginManager, envoyGatewayBaseURL string, sandboxSvc service.SandboxService) *Server
New creates and configures the HTTP server with all service layers wired up. pluginManager may be nil (disables lifecycle plugins — open-source mode). sandboxSvc may be nil; when nil a default service is constructed internally. Pass a non-nil sandboxSvc to share the service with other components (e.g. SandboxPoolReconciler for idle-pod notifications).
Directories
¶
| Path | Synopsis |
|---|---|
|
Package gen provides primitives to interact with the openapi HTTP API.
|
Package gen provides primitives to interact with the openapi HTTP API. |
|
Package handlers implements the StrictServerInterface generated from the OpenAPI spec.
|
Package handlers implements the StrictServerInterface generated from the OpenAPI spec. |
Click to show internal directories.
Click to hide internal directories.