Documentation
¶
Index ¶
- Constants
- func DataBase()
- func GetAllowedJWT() []string
- func PutAllowedJWT(token string) error
- func RemoveAllJWT() error
- func RemoveAllowedJWT(token string) error
- type Auther
- type HookAuth
- func (a *HookAuth) Auth(r *http.Request, usr users.Store, stg *settings.Settings, srv *settings.Server) (*users.User, error)
- func (a *HookAuth) GetUser(d *users.User) *users.User
- func (a *HookAuth) GetValues(s string)
- func (a *HookAuth) LoginPage() bool
- func (a *HookAuth) RunCommand() (string, error)
- func (a *HookAuth) SaveUser() (*users.User, error)
- type JSONAuth
- type NoAuth
- type ProxyAuth
- type ReCaptcha
- type Storage
- type StorageBackend
Constants ¶
const MethodHookAuth settings.AuthMethod = "hook"
MethodHookAuth is used to identify hook auth.
const MethodJSONAuth settings.AuthMethod = "json"
MethodJSONAuth is used to identify json auth.
const MethodNoAuth settings.AuthMethod = "noauth"
MethodNoAuth is used to identify no auth.
const MethodProxyAuth settings.AuthMethod = "proxy"
MethodProxyAuth is used to identify no auth.
Variables ¶
This section is empty.
Functions ¶
func GetAllowedJWT ¶
func GetAllowedJWT() []string
func PutAllowedJWT ¶
func RemoveAllJWT ¶
func RemoveAllJWT() error
func RemoveAllowedJWT ¶
Types ¶
type Auther ¶
type Auther interface {
// Auth is called to authenticate a request.
Auth(r *http.Request, usr users.Store, stg *settings.Settings, srv *settings.Server) (*users.User, error)
// LoginPage indicates if this auther needs a login page.
LoginPage() bool
}
Auther is the authentication interface.
type HookAuth ¶
type HookAuth struct {
Users users.Store `json:"-"`
Settings *settings.Settings `json:"-"`
Server *settings.Server `json:"-"`
Cred hookCred `json:"-"`
Fields hookFields `json:"-"`
Command string `json:"command"`
}
HookAuth is a hook implementation of an Auther.
func (*HookAuth) Auth ¶
func (a *HookAuth) Auth(r *http.Request, usr users.Store, stg *settings.Settings, srv *settings.Server) (*users.User, error)
Auth authenticates the user via a json in content body.
func (*HookAuth) RunCommand ¶
RunCommand starts the hook command and returns the action
type JSONAuth ¶
type JSONAuth struct {
ReCaptcha *ReCaptcha `json:"recaptcha" yaml:"recaptcha"`
AuthenticatorToken string `json:"authenticatorToken" yaml:"authenticatorToken"`
}
JSONAuth is a json implementation of an Auther.
type NoAuth ¶
type NoAuth struct{}
NoAuth is no auth implementation of auther.
type ProxyAuth ¶
type ProxyAuth struct {
Header string `json:"header"`
}
ProxyAuth is a proxy implementation of an auther.
type ReCaptcha ¶
type ReCaptcha struct {
Host string `json:"host"`
Key string `json:"key"`
Secret string `json:"secret"`
}
ReCaptcha identifies a recaptcha connection.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is a auth storage.
func NewStorage ¶
func NewStorage(back StorageBackend, userStore *users.Storage) *Storage
NewStorage creates a auth storage from a backend.
type StorageBackend ¶
StorageBackend is a storage backend for auth storage.