Documentation
¶
Index ¶
- func LogProxied(logger *slog.Logger, ...)
- func LogUpgradeClosed(logger *slog.Logger, workspaceID, sandboxID, kind, bindingID, path string, ...)
- func LogUpgradeOpen(logger *slog.Logger, workspaceID, sandboxID, kind, bindingID, path string)
- func NewLogger(level slog.Level) *slog.Logger
- type BindingRow
- type Config
- type SandboxInfo
- type Server
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogProxied ¶
func LogProxied(logger *slog.Logger, workspaceID, sandboxID, kind, bindingID, method, path string, status int, latencyMs int64)
LogProxied logs a completed proxy request.
func LogUpgradeClosed ¶
func LogUpgradeClosed(logger *slog.Logger, workspaceID, sandboxID, kind, bindingID, path string, durationMs, bytesIn, bytesOut int64)
LogUpgradeClosed logs the end of an upgrade connection.
func LogUpgradeOpen ¶
LogUpgradeOpen logs the start of an upgrade (SPDY/WebSocket) connection.
Types ¶
type BindingRow ¶
type BindingRow struct {
ID string
WorkspaceID string
Kind string
DisplayName string
ServerURL string
PublicMeta json.RawMessage
AuthType string
AuthBlob []byte
IsDefault bool
}
BindingRow represents a credential binding row from the database.
type Config ¶
type Config struct {
Port string
DatabaseURL string
AgentserverURL string
EncryptionKey []byte
LogLevel slog.Level
UpstreamTimeout time.Duration
AllowPrivateUpstreams bool
}
Config holds all configuration for the credential proxy.
func LoadConfigFromEnv ¶
LoadConfigFromEnv reads configuration from environment variables.
type SandboxInfo ¶
type SandboxInfo struct {
SandboxID string `json:"sandbox_id"`
WorkspaceID string `json:"workspace_id"`
}
SandboxInfo holds the identity returned by proxy token validation.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the credential proxy HTTP server.
func (*Server) ValidateProxyToken ¶
ValidateProxyToken calls the agentserver internal API to validate a sandbox proxy token. Returns nil (not error) if the token is invalid.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides read-only access to credential_bindings.
func NewStore ¶
NewStore connects to PostgreSQL. No migrations are run (agentserver owns the schema).
func (*Store) GetBinding ¶
func (s *Store) GetBinding(workspaceID, kind, bindingID string) (*BindingRow, error)
GetBinding fetches a single binding by (workspace_id, kind, id).
func (*Store) ListBindings ¶
func (s *Store) ListBindings(workspaceID, kind string) ([]*BindingRow, error)
ListBindings returns all bindings for a (workspace, kind) pair.