Documentation
¶
Index ¶
Constants ¶
View Source
const ( AuthNone = "none" AuthAPIKey = "apikey" AuthBasic = "basic" )
Variables ¶
View Source
var ( ErrMethodNotSupported = errors.New("authentication method not supported") ErrAPIKeyEmpty = errors.New("api key is empty") ErrBasicUsernameEmpty = errors.New("username is empty") ErrBasicPasswordEmpty = errors.New("password is empty") ErrRouteNotSupported = errors.New("route not supported by the control server") )
Functions ¶
Types ¶
type DebugLogger ¶
type Role ¶
type Role struct { // Name is the role name and is only used for documentation // and in the authentication middleware debug logs. Name string // Auth is the authentication method to use, which can be 'none' or 'apikey'. Auth string // APIKey is the API key to use when using the 'apikey' authentication. APIKey string // Username for HTTP Basic authentication method. Username string // Password for HTTP Basic authentication method. Password string // Routes is a list of routes that the role can access in the format // "HTTP_METHOD PATH", for example "GET /v1/vpn/status" Routes []string }
Role contains the role name, authentication method name and routes that the role can access.
type Settings ¶
type Settings struct { // Roles is a list of roles with their associated authentication // and routes. Roles []Role }
func Read ¶
Read reads the toml file specified by the filepath given. If the file does not exist, it returns empty settings and no error.
func (*Settings) SetDefaults ¶
func (s *Settings) SetDefaults()
Click to show internal directories.
Click to hide internal directories.