Documentation
¶
Overview ¶
Package handlers contains HTTP handler functions for the codex-exec gateway. It must not import the parent codexexecgateway package to avoid import cycles; shared DTOs are imported from execmodel instead.
Index ¶
- func Connected(store InternalConnectedStore, reg Registry) http.HandlerFunc
- func DeleteBinding(store BindingStore) http.HandlerFunc
- func ListBinding(store BindingStore) http.HandlerFunc
- func PostBinding(store BindingStore) http.HandlerFunc
- func Register(store Store) http.HandlerFunc
- func RequireSharedSecret(secret string) func(http.Handler) http.Handler
- func RevokeTurn(rev RevokedAdder) http.HandlerFunc
- type BindingStore
- type InternalConnectedStore
- type Registry
- type RevokedAdder
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connected ¶
func Connected(store InternalConnectedStore, reg Registry) http.HandlerFunc
Connected returns the intersection of (workspace's bound executors) ∩ (currently-connected exe_ids). Used by codex-app-gateway when composing the per-turn manifest.
func DeleteBinding ¶
func DeleteBinding(store BindingStore) http.HandlerFunc
DeleteBinding returns an http.HandlerFunc that removes a workspace ↔ executor binding.
func ListBinding ¶
func ListBinding(store BindingStore) http.HandlerFunc
ListBinding returns an http.HandlerFunc that lists all executors bound to a workspace.
func PostBinding ¶
func PostBinding(store BindingStore) http.HandlerFunc
PostBinding returns an http.HandlerFunc that binds an executor to a workspace.
func Register ¶
func Register(store Store) http.HandlerFunc
Register returns an http.HandlerFunc that creates a new executor row and returns the freshly-minted (raw) registration token. The DB only stores the bcrypt hash — the raw token is never persisted or logged.
func RequireSharedSecret ¶
RequireSharedSecret rejects requests whose Authorization: Bearer header does not constant-time-match `secret`.
func RevokeTurn ¶
func RevokeTurn(rev RevokedAdder) http.HandlerFunc
RevokeTurn adds a turn_id to the in-memory revoked set so future bridge connect attempts presenting that turn's CODEX_EXEC_GATEWAY_TOKEN are rejected even within the token's exp window.
Types ¶
type BindingStore ¶
type BindingStore interface {
BindWorkspaceExecutor(ctx context.Context, workspaceID, exeID string, isDefault bool) error
UnbindWorkspaceExecutor(ctx context.Context, workspaceID, exeID string) error
ListWorkspaceExecutors(ctx context.Context, workspaceID string) ([]execmodel.ConnectedExecutor, error)
}
BindingStore is the subset of storage required by the workspace binding handlers.
type InternalConnectedStore ¶
type InternalConnectedStore interface {
ConnectedExecutorsForWorkspace(ctx context.Context, workspaceID string, connectedIDs []string) ([]execmodel.ConnectedExecutor, error)
}
InternalConnectedStore is the subset of storage required by Connected.
type Registry ¶
type Registry interface {
ConnectedIDs() []string
}
Registry is satisfied by *codexexecgateway.ConnRegistry.
type RevokedAdder ¶
RevokedAdder is satisfied by *codexexecgateway.RevokedSet.