backendsigned

package
v0.0.0-...-581c8d3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

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 Configuration

type Configuration struct {
	*signed.OptionFactories

	// Disabled set to true to disable the middle ware.
	//
	// Path: net/signed/disabled
	Disabled cfgmodel.Bool

	// InTrailer enables to write the signature resp. hash into the HTTP trailer.
	// Note not all clients can read a trailer.
	//
	// Path: net/signed/in_trailer
	InTrailer cfgmodel.Bool

	// AllowedMethods specifies all HTTP methods which will be accepted by the
	// WithRequestSignatureValidation middleware.
	//
	// Path: net/signed/allowed_methods
	AllowedMethods cfgmodel.StringCSV

	// Key defines the symmetric key/password for the hashing algorithms. You
	// must set a type to satisfy the cfgmodel.Encryptor interface or this
	// package panics.
	//
	// Path: net/signed/key
	Key cfgmodel.Obscure

	// Algorithm defines currently supported cryptographical hashing algorithms
	//
	// Path: net/signed/algorithm
	Algorithm cfgmodel.Str

	// HTTPHeaderType sets the type of the HTTP header to either Content-HMAC or
	// Content-Signature.
	//
	// Path: net/signed/http_header_type
	HTTPHeaderType cfgmodel.Str

	// KeyID name or ID of the key which is used in the HMAC algorithm. Only usable when
	// HTTPHeaderType has been set to "signature"
	//
	// Path: net/signed/key_id
	KeyID cfgmodel.Str
}

Configuration just exported for the sake of documentation. See fields for more information. Please call the New() function for creating a new Backend object. Only the New() function will set the paths to the fields.

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() signed.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