Documentation
¶
Overview ¶
Package sessionmanager implements the session manager forwarding endpoint.
This package enables "small-cluster mode": a Proxy B instance that accepts pre-built SessionSettings from a trusted upstream Proxy A and creates sessions without needing any local secrets (agentapi-settings-*, GitHub secrets, etc.).
All requests to /api/v1/sessions must carry an HMAC-SHA256 signature in the X-Hub-Signature-256 header and the Unix timestamp in the X-Timestamp header. The signature covers "METHOD\nPATH?QUERY\nTIMESTAMP\nBODY", preventing both request forgery and replay attacks. The shared secret is configured via SESSION_MANAGER_HMAC_SECRET (or config file).
Index ¶
- type CreateSessionResponse
- type Handlers
- func (h *Handlers) CreateSession(c echo.Context) error
- func (h *Handlers) DeleteSession(c echo.Context) error
- func (h *Handlers) GetName() string
- func (h *Handlers) GetSession(c echo.Context) error
- func (h *Handlers) ListSessions(c echo.Context) error
- func (h *Handlers) RegisterRoutes(e *echo.Echo, _ *app.Server) error
- type ListSessionsResponse
- type SessionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateSessionResponse ¶
type CreateSessionResponse struct {
SessionID string `json:"session_id"`
}
CreateSessionResponse is returned after successful session creation.
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers implements app.CustomHandler for the session manager forwarding endpoint.
func NewHandlers ¶
func NewHandlers(sessionManager repositories.SessionManager, hmacSecret string) *Handlers
NewHandlers creates a new Handlers instance. hmacSecret must be non-empty; if it is empty, RegisterRoutes will refuse to register.
func (*Handlers) CreateSession ¶
CreateSession handles POST /api/v1/sessions.
Body: sessionsettings.SessionSettings JSON (pre-built by upstream Proxy A). The settings are used verbatim as the provision payload; no local secrets are resolved on Proxy B.
func (*Handlers) DeleteSession ¶
DeleteSession handles DELETE /api/v1/sessions/:sessionId.
func (*Handlers) GetSession ¶
GetSession handles GET /api/v1/sessions/:sessionId.
func (*Handlers) ListSessions ¶
ListSessions handles GET /api/v1/sessions.
Optional query parameters:
- user_id : filter by user ID
- scope : "user" or "team"
- team_id : filter by team ID (e.g., "org/team-slug")
- status : filter by session status (e.g., "running", "stopped")
type ListSessionsResponse ¶
type ListSessionsResponse struct {
Sessions []SessionInfo `json:"sessions"`
}
ListSessionsResponse wraps the list of sessions.