package
0.0.0-20230101183712-202847b4b89b
Repository: https://github.com/corestoreio/csfw.git
Documentation: pkg.go.dev

# Packages

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

# Functions

MustNew same as New() but panics on error.
New creates a new authentication service to be used as a middleware or standalone.
NewOptionFactories creates a new struct and initializes the internal map for the registration of different option factories.
OptionsError helper function to be used within the backend package or other sub-packages whose functions may return an OptionFactoryFunc.
WithBasicAuth provides the basic authentication header but allows to set a custom function to compare the input data of username and password.
WithCombineTriggers setting to true forces all authentication triggers to return true.
WithDebugLog creates a new standard library based logger with debug mode enabled.
WithDefaultConfig applies the default configuration settings for a specific scope.
WithDisable disables the current service and calls the next HTTP handler.
WithErrorHandler adds a custom error handler.
WithInvalidAuth authentication will always fail.
WithLogger convenient helper function to apply a logger to the Service type.
WithMarkPartiallyApplied if set to true marks a configuration for a scope as partially applied with functional options set via source code.
WithOptionFactory applies a function which lazily loads the options from a slow backend (config.Getter) depending on the incoming scope within a request.
WithProvider sets the authentication provider function which checks if a request should be considered valid to call the next HTTP handler on err == nil or even call the next provider.
WithResourceACLs enables to define specific URL paths to be black- and/or white listed.
WithResourceRegexpACLs same as WithResourceACLs but uses the slow pre-compiled and more powerful regexes.
WithServiceErrorHandler sets the error handler on the Service object.
WithSimpleBasicAuth sets a single username/password for a scope.
WIP.
WithTrigger sets the authentication trigger function which implements a condition to check if the list of authentication providers should be called.
WithUnauthorizedHandler sets the handler which calls the interface to request data from a user after the authentication failed.
WithUnauthorizedRedirect redirects if the authorization fails.
WithValidAuth authentication will always succeed.

# Structs

OptionFactories allows to register multiple OptionFactoryFunc identified by their names.
ScopedConfig contains the configuration for a specific scope.
Service implements authentication middleware and scoped based authorization.

# Type aliases

BasicAuthFunc defines a function to validate basic auth credentials.
Option can be used as an argument in NewService to configure it with different settings.
OptionFactoryFunc a closure around a scoped configuration to figure out which options should be returned depending on the scope brought to you during a request.
ProviderFunc checks if a request is allowed to proceed.
TriggerFunc defines the condition if the ProviderFunc should be executed.