types

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigurationRequestType RequestType = "ConfigurationRequest"
	CommandRequestType       RequestType = "CommandRequest"
	CommandStatusRequestType RequestType = "CommandStatusRequest"
	KeysRequestType          RequestType = "KeysRequest"
	FileRequestType          RequestType = "FileRequest"
	FileToServerType         RequestType = "FileToServer"

	ConfigurationResponseType      ResponseType = "ConfigurationResponse"
	CommandResponseType            ResponseType = "CommandResponse"
	CommandStatusResponseType      ResponseType = "CommandStatusResponse"
	KeysResponseType               ResponseType = "KeysResponse"
	FileResponseType               ResponseType = "FileResponse"
	FileTransferStatusResponseType ResponseType = "FileTransferStatusResponse"
)

Constants for request and response types

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentCommands

type AgentCommands struct {
	Uuid        string `json:"uuid"`
	CommandType string `json:"commandtype"`
	Command     string `json:"command"`
	CommandUUID string `json:"commanduuid"`
	Output      string `json:"output"`
}

type AgentMetrics added in v1.3.3

type AgentMetrics struct {
	OnlineCount  string `json:"onlineCount"`
	OfflineCount string `json:"offlineCount"`
}

type BuildConfig

type BuildConfig struct {
	Type         string   `json:"type"`
	Description  string   `json:"description"`
	CodePath     string   `json:"code_path"`
	Flags        string   `json:"flags"`
	Environment  string   `json:"environment"`
	FileSuffix   string   `json:"file_suffix"`
	Dependencies []string `json:"dependencies"`
}

type CommandRequest

type CommandRequest struct {
	AgentID string `json:"uuid"`
}

CommandRequest is sent by agent to check for commands

type CommandResponse

type CommandResponse struct {
	AgentID     string `json:"uuid"`
	CommandType string `json:"commandtype"`
	CommandID   string `json:"commandid"`
	Command     string `json:"command"`
}

CommandResponse is sent back to the agent after a CommandRequest

type CommandStatusRequest

type CommandStatusRequest struct {
	AgentID       string `json:"uuid"`
	CommandID     string `json:"commandid"`
	CommandResult string `json:"result"`
	CommandOutput string `json:"output"`
}

CommandStatusRequest is sent by agent to tell the server the command outcome

type CommandStatusResponse

type CommandStatusResponse struct {
	AgentID string `json:"uuid"`
}

type ConfigurationRequest

type ConfigurationRequest struct {
	AgentID           string    `json:"uuid"`
	Username          string    `json:"username"`
	Hostname          string    `json:"hostname"`
	OSType            string    `json:"ostype"`
	OSArch            string    `json:"arch"`
	OSBuild           string    `json:"osbuild"`
	CPUS              string    `json:"cpus"`
	MEMORY            string    `json:"memory"`
	AgentIP           string    `json:"agentip"`
	ServerIP          string    `json:"serverip"`
	ServerPort        string    `json:"serverport"`
	CallbackFrequency string    `json:"callbackfrequency"`
	CallbackJitter    string    `json:"callbackjitter"`
	MasterKey         string    `json:"masterkey"`
	Status            string    `json:"status"`
	Tags              []Tag     `json:"tags"`
	NextCallback      time.Time `json:"nextcallback"`
}

ConfigurationRequest is sent by agent to start a callback

type ConfigurationResponse

type ConfigurationResponse struct {
	AgentID           string `json:"uuid"`
	ServerIP          string `json:"serverip"`
	ServerPort        string `json:"serverport"`
	CallbackFrequency string `json:"callbackfrequency"`
	CallbackJitter    string `json:"callbackjitter"`
}

ConfigurationResponse is sent back to agent after a ConfigurationRequest

type FileRequest

type FileRequest struct {
	AgentID string `json:"uuid"`
}

FileRequest is sent by agent to check for files

type FileResponse

type FileResponse struct {
	FileID  string `json:"fileid"`
	AgentID string `json:"uuid"`
	Type    string `json:"transfertype"`
	Path    string `json:"filepath"`
	Chunk   []byte `json:"chunk"`
}

FileResponse is sent back to the agent after a FileRequest. Prepares the agent for a transfer

type FileToServer

type FileToServer struct {
	FileID  string `json:"fileid"`
	AgentID string `json:"uuid"`
	Type    string `json:"transfertype"`
	Path    string `json:"path"`
	Status  string `json:"status"`
	Chunk   []byte `json:"chunk"`
}

This manages success messages if Type = download. Otherwise, send data to server

type FileTransferStatusResponse

type FileTransferStatusResponse struct {
	FileID  string `json:"fileid"`
	AgentID string `json:"uuid"`
}

type JWTClaim

type JWTClaim struct {
	Username string `json:"username"`
	Role     string `json:"role"`
	jwt.StandardClaims
}

type KeysRequest

type KeysRequest struct {
	AgentID string `json:"uuid"`
	Keys    string `json:"keys"`
}

type KeysResponse

type KeysResponse struct {
	AgentID string `json:"uuid"`
}

type Note

type Note struct {
	NoteID int    `json:"noteid"`
	Note   string `json:"note"`
}

type Payload

type Payload struct {
	PayloadID         string `json:"payloadid"`
	Uuid              string `json:"uuid"`
	Name              string `json:"name"`
	Description       string `json:"description"`
	ServerIP          string `json:"serverip"`
	ServerPort        string `json:"serverport"`
	CallbackFrequency string `json:"callbackfrequency"`
	CallbackJitter    string `json:"callbackjitter"`
	Concat            string `json:"concat"`
}

type PayloadConfigurations

type PayloadConfigurations map[string]BuildConfig

type Redirector

type Redirector struct {
	RedirectorID string `json:"id" binding:"required"`
	Name         string `json:"name" binding:"required"`
	Description  string `json:"description" binding:"required"`
	ForwardIP    string `json:"forwardip"`
	ForwardPort  string `json:"forwardport"`
	ListenIP     string `json:"listenip" binding:"required"`
	ListenPort   string `json:"listenport" binding:"required"`
	Status       string `json:"status" binding:"required"`
}

type RedirectorTemplateData added in v1.3.2

type RedirectorTemplateData struct {
	LinkingKey     string
	ApiIP          string
	ApiPort        string
	RedirectorPort string
	ExternalPort   string
	ForwardIP      string
	ForwardPort    string
}

type Request

type Request struct {
	Type    RequestType
	Payload interface{}
}

General Request struct with typed payload

type RequestType

type RequestType string

Defining request and response types

type Response

type Response struct {
	Type    ResponseType
	Payload interface{}
}

General Response struct with typed payload

type ResponseType

type ResponseType string

type Tag

type Tag struct {
	TagID int    `json:"tagid"`
	Key   string `json:"key"`
	Value string `json:"value"`
}

type TagKeyValues added in v1.3.3

type TagKeyValues struct {
	Key    string   `json:"key"`
	Values []string `json:"values"`
}

type UpdateUserRequest

type UpdateUserRequest struct {
	NewPassword *string `json:"newPassword,omitempty"`
	NewRole     *string `json:"newRole,omitempty"`
}

type User

type User struct {
	ID           int    `db:"id"`
	Username     string `db:"username"`
	PasswordHash string `db:"password_hash"`
	Role         string `db:"role"`
}

func (*User) CheckPassword added in v1.3.3

func (u *User) CheckPassword(password string) error

func (*User) SetPassword added in v1.3.3

func (u *User) SetPassword(password string) error

type UserCreationRequest

type UserCreationRequest struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
	Role     string `json:"role" binding:"required"`
}

Jump to

Keyboard shortcuts

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