config

package
v0.0.0-...-d0dcc93 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	ListeningProtocol      string `json:"protocol" validate:"required"`                                             //The protocol the agent uses to communicate to users
	ListeningAddress       string `json:"address" validate:"required,ipv4"`                                         //Address to listen on (127.0.0.1, 0.0.0.0, etc.)
	ListeningPort          string `json:"port" validate:"required,number,gt=0,lt=65536"`                            //Port to listen on
	ForbiddenPagePath      string `json:"forbiddenPagePath" validate:"required"`                                    //Forbidden page location
	BlacklistUserAgentPath string `json:"blacklistUserAgentPath" validate:"required"`                               //Path to the wordlist of banned User-Agents
	ForwardServerProtocol  string `json:"forwardServerProtocol" validate:"required"`                                //Protocol used when forwarding request to webserver
	ForwardServerAddress   string `json:"forwardServerAddress" validate:"required,ipv4"`                            //Address of the webserver to send the request to
	ForwardServerPort      string `json:"forwardServerPort" validate:"required,number,gt=0,lt=65536"`               //Port to forward the request to
	APIProtocol            string `json:"apiProtocol"`                                                              //API protocol
	APIIpAddress           string `json:"apiIpAddress"`                                                             //API ip address
	APIPort                string `json:"apiPort"`                                                                  //API port
	UUID                   string `json:"uuid"`                                                                     //The UUID of the agent, received after registration to the API
	RulesDirectory         string `json:"rulesDirectory"`                                                           //The directory where rules can be found
	OperationMode          string `json:"operationMode" validate:"required,oneof_insensitive=testing waf adaptive"` //The mode the agent will operate on (can be testing, waf, adaptive) - case insensitive

}

Structure that will hold the configuration parameters of the proxy

func (*Configuration) FromJSON

func (conf *Configuration) FromJSON(r io.Reader) error

Convert from json into the configuration structure

func (*Configuration) LoadConfigurationFromFile

func (conf *Configuration) LoadConfigurationFromFile(filePath string) error

Load the configuration from a file

func (*Configuration) ToJSON

func (conf *Configuration) ToJSON(w io.Writer) error

Convert to json the configuration structure

Jump to

Keyboard shortcuts

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