Versions in this module Expand all Collapse all v0 v0.1.0 Jun 17, 2026 Changes in this version + func Migrate(ctx context.Context, db DB) error + type ActionItem struct + Action string + ActionID string + Details map[string]any + Outcome string + Timestamp time.Time + type ActionRow struct + Action string + ActionID string + Details map[string]any + OccurredAt time.Time + Outcome string + type AgentPassportResponse struct + Capabilities []string + Description string + IssuedAt time.Time + Name string + Organization string + PassportID string + PublicKey string + Signature string + SignatureAlgorithm string + Status string + type AgentRegisterRequest struct + Capabilities []string + Description string + Name string + Organization string + type AgentRow struct + Capabilities []string + Description string + IssuedAt time.Time + Name string + Organization string + PassportID string + PublicKeyPEM string + RevokeReason string + RevokedAt *time.Time + SignatureAlgorithm string + SignatureB64 string + SignedPayload []byte + Status string + type CanonicalPayload struct + Capabilities []string + IssuedAt string + Name string + Organization string + PassportID string + type CapabilityResponse struct + BoundAt *time.Time + Capability string + Granted bool + Reason string + Scope map[string]any + type CommandTag interface + RowsAffected func() int64 + type Config struct + AdminToken string + DB DB + JWTSecret string + Logger *slog.Logger + type DB interface + Begin func(ctx context.Context) (Tx, error) + Close func() + Exec func(ctx context.Context, sql string, args ...any) (CommandTag, error) + Query func(ctx context.Context, sql string, args ...any) (Rows, error) + QueryRow func(ctx context.Context, sql string, args ...any) Row + func ConnectPostgres(ctx context.Context, databaseURL string) (DB, error) + type DeviceAuthRequest struct + DeviceCode string + type DeviceAuthResponse struct + AccessToken string + ExpiresAt time.Time + TokenType string + type DeviceRegisterRequest struct + DeviceType string + IPAddress string + Name string + type DeviceResponse struct + DeviceCode string + DeviceID string + DeviceType string + IPAddress string + IssuedAt time.Time + Name string + Status string + type DeviceRow struct + ApprovedAt *time.Time + DeviceCode string + DeviceID string + DeviceType string + IPAddress string + IssuedAt time.Time + Name string + Status string + type ListActionsResponse struct + Actions []ActionItem + type ListAgentsResponse struct + Agents []AgentPassportResponse + type LogActionRequest struct + Action string + Details map[string]any + Outcome string + type RevokeRequest struct + Reason string + type Row interface + Scan func(dest ...any) error + type Rows interface + Close func() + Err func() error + Next func() bool + Scan func(dest ...any) error + type Server struct + func New(ctx context.Context, cfg Config) (*Server, error) + func (s *Server) Handler() http.Handler + type Signer struct + func LoadOrInitSigner(ctx context.Context, db DB) (*Signer, error) + func (s *Signer) Algorithm() string + func (s *Signer) PublicKeyPEM() string + func (s *Signer) Sign(p CanonicalPayload) (sigB64 string, signedJSON []byte, err error) + func (s *Signer) Verify(signedJSON []byte, sigB64 string) bool + type Tx interface + Commit func(ctx context.Context) error + Exec func(ctx context.Context, sql string, args ...any) (CommandTag, error) + Query func(ctx context.Context, sql string, args ...any) (Rows, error) + QueryRow func(ctx context.Context, sql string, args ...any) Row + Rollback func(ctx context.Context) error + type VerifyResponse struct + Capabilities []string + IssuedAt time.Time + PassportID string + RevokedAt *time.Time + SignatureValid bool + Status string