Documentation
¶
Index ¶
Constants ¶
const SimpleProviderName = "simple"
Variables ¶
This section is empty.
Functions ¶
func RegisterProvider ¶
func RegisterProvider(desc *ProviderDescription, factoryMethod Provider)
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) }
Logsrv authentication extension
type Config ¶
type Config struct { Host string Port string LogLevel string TextLogging bool JwtSecret string JwtSecretFile 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 UserEndpoint string UserEndpointToken string UserEndpointTimeout time.Duration }
Config for the loginsrv handler
func (*Config) ConfigureFlagSet ¶
Adds all flags to the supplied flag set
func (*Config) ResolveFileReferences ¶
Resolves configuration values, which are dynamically referenced via files
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Mail login handler. It serves the login ressource and does the authentication against the backends or oauth provider.
func NewHandler ¶
Creates a login handler based on the supplied configuration
type Options ¶
Configuration structure for oauth and backend provider key is the providername, value is a options map
type Provider ¶
Factory method for creation of login backends
func GetProvider ¶
Returns a registered provider by its name The bool return parameter indicated, if there was such a provider
type ProviderDescription ¶
type ProviderDescription struct { // Name of the provider Name string // Text for the commandline option HelpText string }
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
}
Working on a map of username password pairs
func NewSimpleBackend ¶
func NewSimpleBackend(userPassword map[string]string) *SimpleBackend
Creates a new SIMPLE Backend and verifies the parameters
func (*SimpleBackend) Authenticate ¶
Authenticate the user
type UserClaims ¶
func NewUserClaims ¶
func NewUserClaims(config *Config) (UserClaims, error)