controlplane

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditEvent

type AuditEvent struct {
	ID          string            `json:"id"`
	At          time.Time         `json:"at"`
	TenantID    string            `json:"tenantId"`
	Subject     string            `json:"subject"`
	SessionID   string            `json:"sessionId"`
	Transport   string            `json:"transport,omitempty"`
	Tool        string            `json:"tool,omitempty"`
	Action      string            `json:"action"`
	Outcome     string            `json:"outcome"`
	Reason      string            `json:"reason,omitempty"`
	ResourceIDs map[string]string `json:"resourceIds,omitempty"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

type CredentialRef

type CredentialRef struct {
	ID         string            `json:"id"`
	Backend    string            `json:"backend"`
	Reference  string            `json:"reference"`
	Workspace  string            `json:"workspaceId,omitempty"`
	BaseURL    string            `json:"baseUrl,omitempty"`
	Metadata   map[string]string `json:"metadata,omitempty"`
	ModifiedAt time.Time         `json:"modifiedAt,omitempty"`
}

type SessionRecord

type SessionRecord struct {
	ID                string    `json:"id"`
	TenantID          string    `json:"tenantId"`
	Subject           string    `json:"subject"`
	Transport         string    `json:"transport"`
	ProtocolVersion   string    `json:"protocolVersion,omitempty"`
	ClientName        string    `json:"clientName,omitempty"`
	ClientVersion     string    `json:"clientVersion,omitempty"`
	CreatedAt         time.Time `json:"createdAt"`
	ExpiresAt         time.Time `json:"expiresAt"`
	LastSeenAt        time.Time `json:"lastSeenAt"`
	WorkspaceID       string    `json:"workspaceId,omitempty"`
	ClockifyBaseURL   string    `json:"clockifyBaseUrl,omitempty"`
	SessionAffinityID string    `json:"sessionAffinityId,omitempty"`
}

type State

type State struct {
	Tenants        map[string]TenantRecord  `json:"tenants"`
	CredentialRefs map[string]CredentialRef `json:"credential_refs"`
	Sessions       map[string]SessionRecord `json:"sessions"`
	AuditEvents    []AuditEvent             `json:"audit_events"`
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func Open

func Open(dsn string) (*Store, error)

func (*Store) AppendAuditEvent

func (s *Store) AppendAuditEvent(event AuditEvent) error

func (*Store) CredentialRef

func (s *Store) CredentialRef(id string) (CredentialRef, bool)

func (*Store) DeleteSession

func (s *Store) DeleteSession(id string) error

func (*Store) PutCredentialRef

func (s *Store) PutCredentialRef(record CredentialRef) error

func (*Store) PutSession

func (s *Store) PutSession(record SessionRecord) error

func (*Store) PutTenant

func (s *Store) PutTenant(record TenantRecord) error

func (*Store) Session

func (s *Store) Session(id string) (SessionRecord, bool)

func (*Store) Tenant

func (s *Store) Tenant(id string) (TenantRecord, bool)

type TenantRecord

type TenantRecord struct {
	ID              string            `json:"id"`
	CredentialRefID string            `json:"credentialRefId"`
	WorkspaceID     string            `json:"workspaceId,omitempty"`
	BaseURL         string            `json:"baseUrl,omitempty"`
	Timezone        string            `json:"timezone,omitempty"`
	PolicyMode      string            `json:"policyMode,omitempty"`
	DenyTools       []string          `json:"denyTools,omitempty"`
	DenyGroups      []string          `json:"denyGroups,omitempty"`
	AllowGroups     []string          `json:"allowGroups,omitempty"`
	Metadata        map[string]string `json:"metadata,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL