Documentation ¶
Index ¶
Constants ¶
const SimpleProviderName = "simple"
SimpleProviderName const with the providers name
Variables ¶
This section is empty.
Functions ¶
func ProviderList ¶
func ProviderList() []string
ProviderList returns the names of all registered provider
func RegisterProvider ¶
func RegisterProvider(desc *ProviderDescription, factoryMethod Provider)
RegisterProvider registers a factory method by the provider name.
Types ¶
type Backend ¶
type Backend interface { // Authenticate checks the username/password against the backend. // On success it returns true and a UserInfo object which has at least the username set. // If the credentials do not match, false is returned. // The error parameter is nil, unless a communication error with the backend occurred. Authenticate(username, password string) (bool, model.UserInfo, error) }
Backend is an loginsrv authentication extension
type Config ¶
type Config struct { Host string Port string LogLevel string TextLogging bool JwtSecret string JwtAlgo string JwtExpiry time.Duration JwtRefreshes int SuccessURL string Redirect bool RedirectQueryParameter string RedirectCheckReferer bool RedirectHostFile string LogoutURL string Template string LoginPath string CookieName string CookieExpiry time.Duration CookieDomain string CookieHTTPOnly bool CookieSecure bool Backends Options Oauth Options GracePeriod time.Duration UserFile string }
Config for the loginsrv handler
func (*Config) ConfigureFlagSet ¶
ConfigureFlagSet adds all flags to the supplied flag set
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is the mail login handler. It serves the login ressource and does the authentication against the backends or oauth provider.
func NewHandler ¶
NewHandler creates a login handler based on the supplied configuration.
type Options ¶
Options is the configuration structure for oauth and backend provider key is the providername, value is a options map.
type Provider ¶
Provider is a factory method for creation of login backends.
func GetProvider ¶
GetProvider returns a registered provider by its name. The bool return parameter indicated, if there was such a provider.
type ProviderDescription ¶
type ProviderDescription struct { // the name of the provider Name string // the text for the commandline option HelpText string }
ProviderDescription holds the provider metadata for the help message.
func GetProviderDescription ¶
func GetProviderDescription(providerName string) (*ProviderDescription, bool)
GetProviderDescription returns the metainfo for a provider
type SimpleBackend ¶
type SimpleBackend struct {
// contains filtered or unexported fields
}
SimpleBackend working on a map of username password pairs
func NewSimpleBackend ¶
func NewSimpleBackend(userPassword map[string]string) *SimpleBackend
NewSimpleBackend creates a new SIMPLE Backend and verifies the parameters.
func (*SimpleBackend) Authenticate ¶
Authenticate the user
type UserClaims ¶ added in v1.2.4
type UserClaims struct {
// contains filtered or unexported fields
}
func NewUserClaims ¶ added in v1.2.4
func NewUserClaims(config *Config) (*UserClaims, error)