config

package
v0.3.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIG_FILE                = "/usr/local/etc/authpf-api.conf"
	RBAC_ACTIVATE_OWN_RULE     = "activate_own_rules"
	RBAC_ACTIVATE_OTHER_RULE   = "activate_other_rules"
	RBAC_DEACTIVATE_OWN_RULE   = "deactivate_own_rules"
	RBAC_DEACTIVATE_OTHER_RULE = "deactivate_other_rules"
	RBAC_GET_STATUS_OWN_RULE   = "view_own_rules"
	RBAC_GET_STATUS_OTHER_RULE = "view_other_rules"
	SESSION_REGISTER           = "activate"
	SESSION_UNREGISTER         = "deactivate"
	SESSION_VIEW               = "view"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigFile

type ConfigFile struct {
	Defaults ConfigFileDefaults `yaml:"defaults"`
	Server   ConfigFileServer   `yaml:"server"`
	AuthPF   ConfigFileAuthPF   `yaml:"authpf"`
	Rbac     ConfigFileRbac     `yaml:"rbac"`
}

func New

func New() *ConfigFile

func (*ConfigFile) LoadConfig

func (c *ConfigFile) LoadConfig(configFile string) error

type ConfigFileAuthPF

type ConfigFileAuthPF struct {
	Timeout             string   `yaml:"timeout"`
	UserRulesRootFolder string   `yaml:"userRulesRootFolder"`
	UserRulesFile       string   `yaml:"userRulesFile"`
	AnchorName          string   `yaml:"anchorName"`
	FlushFilter         []string `yaml:"flushFilter"`
	OnShutdown          string   `yaml:"onShutdown"`
	OnStartup           string   `yaml:"onStartup"`
	PfTable             string   `yaml:"pfTable"`
}

type ConfigFileDefaults

type ConfigFileDefaults struct {
	PfctlBinary string `yaml:"pfctlBinary"`
}

type ConfigFileRbac

type ConfigFileRbac struct {
	Roles map[string]ConfigFileRbacRoles `yaml:"roles"`
	Users map[string]ConfigFileRbacUsers `yaml:"users"`
}

type ConfigFileRbacRoles

type ConfigFileRbacRoles struct {
	Permissions []string `yaml:"permissions"`
}

type ConfigFileRbacUsers

type ConfigFileRbacUsers struct {
	UserRulesFile string            `yaml:"userRulesFile"`
	Password      string            `yaml:"password"`
	Role          string            `yaml:"role"`
	UserID        int               `yaml:"userId,omitempty"`
	UserIP        string            `yaml:"userIp,omitempty"`
	Macros        map[string]string `yaml:"macros"`
	PfTable       string            `yaml:"pfTable"`
}

type ConfigFileServer

type ConfigFileServer struct {
	Bind            string              `yaml:"bind"`
	Port            uint16              `yaml:"port"`
	SSL             ConfigFileServerSSL `yaml:"ssl"`
	ElevatorMode    string              `yaml:"elevatorMode"`
	Logfile         string              `yaml:"logfile"`
	JwtTokenTimeout string              `yaml:"jwtTokenTimeout"`
	JwtSecret       string              `yaml:"jwtSecret,omitempty"`
}

type ConfigFileServerSSL

type ConfigFileServerSSL struct {
	Certificate string `yaml:"certificate"`
	Key         string `yaml:"key"`
}

Jump to

Keyboard shortcuts

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