Documentation ¶
Overview ¶
Package auth provides the Inertia daemon's authentication and security framework
Index ¶
- type PermissionsHandler
- func (h *PermissionsHandler) AttachAdminRestrictedHandlerFunc(path string, handler http.HandlerFunc, methods ...string)
- func (h *PermissionsHandler) AttachPublicHandler(path string, handler http.Handler)
- func (h *PermissionsHandler) AttachPublicHandlerFunc(path string, handler http.HandlerFunc)
- func (h *PermissionsHandler) AttachUserRestrictedHandlerFunc(path string, handler http.HandlerFunc, methods ...string)
- func (h *PermissionsHandler) Close() error
- func (h *PermissionsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PermissionsHandler ¶
type PermissionsHandler struct {
// contains filtered or unexported fields
}
PermissionsHandler handles users, permissions, and sessions on top of an http.ServeMux. It is used for Inertia Web.
func NewPermissionsHandler ¶
func NewPermissionsHandler( dbPath, hostDomain string, timeout int, keyLookup ...func(*jwt.Token) (interface{}, error), ) (*PermissionsHandler, error)
NewPermissionsHandler returns a new handler for authenticating users and handling user administration. Param userlandPath is used to set cookie domain.
func (*PermissionsHandler) AttachAdminRestrictedHandlerFunc ¶
func (h *PermissionsHandler) AttachAdminRestrictedHandlerFunc(path string, handler http.HandlerFunc, methods ...string)
AttachAdminRestrictedHandlerFunc attaches and restricts given path and handler to logged in admins.
func (*PermissionsHandler) AttachPublicHandler ¶
func (h *PermissionsHandler) AttachPublicHandler(path string, handler http.Handler)
AttachPublicHandler attaches given path and handler and makes it publicly available
func (*PermissionsHandler) AttachPublicHandlerFunc ¶
func (h *PermissionsHandler) AttachPublicHandlerFunc(path string, handler http.HandlerFunc)
AttachPublicHandlerFunc attaches given path and handler and makes it publicly available
func (*PermissionsHandler) AttachUserRestrictedHandlerFunc ¶
func (h *PermissionsHandler) AttachUserRestrictedHandlerFunc(path string, handler http.HandlerFunc, methods ...string)
AttachUserRestrictedHandlerFunc attaches and restricts given path and handler to logged in users.
func (*PermissionsHandler) Close ¶
func (h *PermissionsHandler) Close() error
Close releases resources held by the PermissionsHandler
func (*PermissionsHandler) ServeHTTP ¶
func (h *PermissionsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
nolint: gocyclo