client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient added in v0.3.0

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

APIClient handles REST API communication with the Orion-Belt server

func NewAPIClient added in v0.3.0

func NewAPIClient(baseURL, username string, signer ssh.Signer, logger *common.Logger) (*APIClient, error)

NewAPIClient creates a new API client with authentication

func (*APIClient) ApproveAccessRequest added in v0.3.0

func (c *APIClient) ApproveAccessRequest(requestID, reviewerID string) error

ApproveAccessRequest approves an access request (admin only)

func (*APIClient) CreateAccessRequest added in v0.3.0

func (c *APIClient) CreateAccessRequest(request map[string]interface{}) (*AccessRequest, error)

CreateAccessRequest creates a new access request

func (*APIClient) GetAccessRequest added in v0.3.0

func (c *APIClient) GetAccessRequest(requestID string) (*AccessRequest, error)

GetAccessRequest retrieves an access request by ID

func (*APIClient) GetMachineByName added in v0.3.0

func (c *APIClient) GetMachineByName(name string) (*Machine, error)

GetMachineByName retrieves a machine by its name

func (*APIClient) ListMachines added in v0.3.0

func (c *APIClient) ListMachines() ([]Machine, error)

ListMachines retrieves all available machines

func (*APIClient) ListPendingAccessRequests added in v0.3.0

func (c *APIClient) ListPendingAccessRequests() ([]AccessRequest, error)

ListPendingAccessRequests retrieves all pending access requests (admin only)

func (*APIClient) RejectAccessRequest added in v0.3.0

func (c *APIClient) RejectAccessRequest(requestID, reviewerID string) error

RejectAccessRequest rejects an access request (admin only)

type AccessRequest added in v0.3.0

type AccessRequest struct {
	ID          string     `json:"id"`
	UserID      string     `json:"user_id"`
	MachineID   string     `json:"machine_id"`
	RemoteUsers []string   `json:"remote_users"`
	Reason      string     `json:"reason"`
	Duration    int        `json:"duration"`
	Status      string     `json:"status"`
	RequestedAt time.Time  `json:"requested_at"`
	ReviewedAt  *time.Time `json:"reviewed_at"`
	ReviewedBy  *string    `json:"reviewed_by"`
	ExpiresAt   *time.Time `json:"expires_at"`
}

AccessRequest represents an access request from the API

type Machine added in v0.3.0

type Machine struct {
	ID         string            `json:"id"`
	Name       string            `json:"name"`
	Hostname   string            `json:"hostname"`
	Port       int               `json:"port"`
	Tags       map[string]string `json:"tags"`
	AgentID    string            `json:"agent_id"`
	IsActive   bool              `json:"is_active"`
	LastSeenAt *time.Time        `json:"last_seen_at"`
	CreatedAt  time.Time         `json:"created_at"`
	UpdatedAt  time.Time         `json:"updated_at"`
}

Machine represents a machine from the API

type SCPClient

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

SCPClient represents an Orion-Belt SCP client

func NewSCPClient

func NewSCPClient(config *common.Config, logger *common.Logger) (*SCPClient, error)

NewSCPClient creates a new SCP client

func (*SCPClient) Copy

func (c *SCPClient) Copy(username, source, destination string, isUpload bool) error

Copy copies a file through the Orion-Belt server

type SSHClient

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

SSHClient represents an Orion-Belt SSH client

func NewSSHClient

func NewSSHClient(config *common.Config, logger *common.Logger) (*SSHClient, error)

NewSSHClient creates a new SSH client

func (*SSHClient) Connect

func (c *SSHClient) Connect(target string, username string) error

Connect connects to a target machine through the Orion-Belt server

func (*SSHClient) ListMachines

func (c *SSHClient) ListMachines() error

ListMachines lists available machines

func (*SSHClient) RequestAccess

func (c *SSHClient) RequestAccess(target, reason string, duration int) error

RequestAccess requests temporary access to a machine

Jump to

Keyboard shortcuts

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