Documentation
¶
Overview ¶
Package execendpoints owns the operator-facing CRUD + test of per-agent SSH exec endpoints (declared by the agent via RegisterExecEndpoint, configured by the operator here).
Index ¶
- Variables
- type ConfigureRequest
- type Dialer
- type Pool
- type Service
- func (s *Service) Configure(ctx context.Context, p authz.Principal, agentID uuid.UUID, slug string, ...) (dbq.AgentExecEndpoint, error)
- func (s *Service) List(ctx context.Context, p authz.Principal, agentID uuid.UUID) ([]dbq.ListExecNeedsByAgentRow, error)
- func (s *Service) RotateKeypair(ctx context.Context, p authz.Principal, agentID uuid.UUID, slug string) (dbq.AgentExecEndpoint, error)
- func (s *Service) Test(ctx context.Context, p authz.Principal, agentID uuid.UUID, slug string) (TestResult, error)
- func (s *Service) UnpinHostKey(ctx context.Context, p authz.Principal, agentID uuid.UUID, slug string) error
- type TestResult
Constants ¶
This section is empty.
Variables ¶
var ErrKeypairAfterConfigure = errors.New("configured but keypair generation failed")
ErrKeypairAfterConfigure marks the specific 500 condition where the row was written but follow-up keypair gen failed.
Functions ¶
This section is empty.
Types ¶
type ConfigureRequest ¶
type ConfigureRequest struct {
Host string
Port int32
SSHUser string
DisplayName string
CreateNew bool
}
ConfigureRequest is the input for Configure. Port=0 defaults to 22.
type Dialer ¶
type Dialer interface {
Exec(ctx context.Context, ep *dbq.AgentExecEndpoint, req execproxy.ExecRequest, w http.ResponseWriter) error
EvictCache(id uuid.UUID)
}
Dialer is the subset of execproxy.SSHDialer the service uses.
type Pool ¶
Pool is the minimal subset of *pgxpool.Pool dbq.New accepts. Kept generic so the constructor matches the existing handler-side pattern.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Configure ¶
func (s *Service) Configure(ctx context.Context, p authz.Principal, agentID uuid.UUID, slug string, req ConfigureRequest) (dbq.AgentExecEndpoint, error)
Configure persists host/port/user for a declared endpoint and generates a keypair on first configure. The exec-endpoint resource is created (owned by the configuring principal) and bound to the agent's need on first configure. ErrInvalidInput for bad input, ErrNotFound when the slug wasn't declared.
func (*Service) List ¶
func (s *Service) List(ctx context.Context, p authz.Principal, agentID uuid.UUID) ([]dbq.ListExecNeedsByAgentRow, error)
List returns every exec-endpoint need the agent declares, joined to its bound resource (if configured) — keyed by the agent's need slug.
func (*Service) RotateKeypair ¶
func (s *Service) RotateKeypair(ctx context.Context, p authz.Principal, agentID uuid.UUID, slug string) (dbq.AgentExecEndpoint, error)
RotateKeypair mints a new ED25519 keypair, replaces the secrets-store ref, and evicts the cached SSH client.