Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
func Serve(listenAddr net.TCPAddr, datasource *datasource.DataSource) error
Types ¶
type AuthBearerMiddleware ¶
type AuthBearerMiddleware struct { // Realm name to display to the user. Required. Realm string // Callback function that should perform the authentication of the user based on token. // Must return userID as string on success, empty string on failure. Required. // The returned userID is normally the primary key for your user record. Authenticator func(token string) string // Callback function that should perform the authorization of the authenticated user. // Must return true on success, false on failure. Optional, defaults to success. // Called only after an authentication success. Authorizer func(request *rest.Request, userID string) bool }
AuthBearerMiddleware provides a Token Auth implementation. On success, the wrapped middleware is called, and the userID is made available as request.Env["REMOTE_USER"].(string)
func (*AuthBearerMiddleware) MiddlewareFunc ¶
func (mw *AuthBearerMiddleware) MiddlewareFunc(handler rest.HandlerFunc) rest.HandlerFunc
MiddlewareFunc makes AuthBearerMiddleware implement the Middleware interface.
type ChangePassword ¶
type GroupInList ¶
type UserInList ¶
type UserInList struct { Email string `json:"email"` UIDStr string `json:"uid"` InboxAddr string `json:"inboxAddress"` Active bool `json:"active"` Admin bool `json:"admin"` EnFirstName string `json:"enFirstName"` EnLastName string `json:"enLastName"` FaFirstName string `json:"faFirstName"` FaLastName string `json:"faLastName"` }
Click to show internal directories.
Click to hide internal directories.