backendauth

package
v0.0.0-...-202847b Latest Latest
Warning

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

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

Documentation

Overview

Package backendauth (TODO) defines the backend configuration options and element slices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigStructure

func NewConfigStructure() (element.Sections, error)

NewConfigStructure global configuration structure for this package. Used in frontend (to display the user all the settings) and in backend (scope checks and default values). See the source code of this function for the overall available sections, groups and fields.

Types

type ConfigIPRange

type ConfigIPRange struct {
	cfgmodel.CSV
}

ConfigIPRange defines how IP ranges are stored and handled. A valid IP range string looks like for example:

IPv4: 74.50.153.0-74.50.153.4
IPv6: ::ffff:192.0.2.128-::ffff:192.0.2.250
IPv6: 2001:0db8:85a3:0000:0000:8a2e:0370:7334-2001:0db8:85a3:0000:0000:8a2e:0370:8334

No white spaces! Multiple entries supported via \r and/or \n.

func NewConfigIPRange

func NewConfigIPRange(path string, opts ...cfgmodel.Option) ConfigIPRange

NewConfigIPRange ....

func (ConfigIPRange) Get

func (cc ConfigIPRange) Get(sg config.Scoped) (net.IPRanges, error)

Get ...

type Configuration

type Configuration struct {
	*auth.OptionFactories

	// Disabled indicates whether authentication has been enabled or not.
	// Path: net/auth/disabled
	Disabled cfgmodel.Bool

	// AllowedIP indicates which IPs are allowed.
	// Separate via line break (\n).
	//
	// Path: net/auth/allowed_ips
	AllowedIPs cfgmodel.StringCSV

	// DeniedIPs indicates which IPs are denied.
	// Separate via line break (\n).
	//
	// Path: net/auth/denied_ips
	DeniedIPs cfgmodel.StringCSV

	// AllowedIPRange indicates which IP ranges are denied.
	// Separate via line break (\n).
	//
	// Path: net/auth/denied_ips
	AllowedIPRange ConfigIPRange

	// DeniedIPRange indicates which IP ranges are denied.
	// Separate via line break (\n).
	//
	// Path: net/auth/denied_ips
	DeniedIPRange ConfigIPRange
}

Configuration just exported for the sake of documentation. See fields for more information. The PkgBackend handles the reading and writing of configuration values within this package.

func New

func New(cfgStruct element.Sections, opts ...cfgmodel.Option) *Configuration

New initializes the backend configuration models containing the cfgpath.Route variable to the appropriate entries in the storage. The argument Sections and opts will be applied to all models.

func (*Configuration) PrepareOptionFactory

func (be *Configuration) PrepareOptionFactory() auth.OptionFactoryFunc

PrepareOptionFactory creates a closure around the type Backend. The closure will be used during a scoped request to figure out the configuration depending on the incoming scope. An option array will be returned by the closure.

Jump to

Keyboard shortcuts

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