backends

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend is an authentication backend.

func NewBackendFromBytes

func NewBackendFromBytes(name, method string, data []byte) (*Backend, error)

NewBackendFromBytes returns backend instance based on authentication method and JSON configuration data.

func NewLdapBackendFromBytes

func NewLdapBackendFromBytes(name string, data []byte) (*Backend, error)

NewLdapBackendFromBytes returns LDAP backend.

func NewLocalBackendFromBytes

func NewLocalBackendFromBytes(name string, data []byte) (*Backend, error)

NewLocalBackendFromBytes returns local backend.

func (*Backend) Authenticate

func (b *Backend) Authenticate(opts map[string]interface{}) (map[string]interface{}, error)

Authenticate performs authentication with an authentication provider.

func (*Backend) Configure

func (b *Backend) Configure(opts map[string]interface{}) error

Configure configures backend with the authentication provider settings.

func (*Backend) Do added in v1.2.9

func (b *Backend) Do(opts map[string]interface{}) error

Do performs the requested operation.

func (*Backend) GetMethod

func (b *Backend) GetMethod() string

GetMethod returns the authentication method associated with an authentication provider.

func (*Backend) GetName

func (b *Backend) GetName() string

GetName returns the name associated with an authentication provider.

func (*Backend) GetRealm

func (b *Backend) GetRealm() string

GetRealm returns realm associated with an authentication provider.

func (Backend) MarshalJSON

func (b Backend) MarshalJSON() ([]byte, error)

MarshalJSON packs configuration info JSON byte array

func (*Backend) UnmarshalJSON

func (b *Backend) UnmarshalJSON(data []byte) error

UnmarshalJSON unpacks configuration into appropriate structures.

func (*Backend) Validate

func (b *Backend) Validate() error

Validate checks whether an authentication provider is functional.

type BackendDriver

type BackendDriver interface {
	GetRealm() string
	GetName() string
	GetMethod() string
	Authenticate(map[string]interface{}) (map[string]interface{}, error)
	ConfigureLogger(*zap.Logger) error
	ConfigureTokenProvider(*jwtconfig.CommonTokenConfig) error
	ConfigureAuthenticator() error
	Validate() error
	Do(map[string]interface{}) error
}

BackendDriver is an interface to an authentication provider.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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