inertia: github.com/ubclaunchpad/inertia/daemon/inertiad/auth Index | Files

package auth

import "github.com/ubclaunchpad/inertia/daemon/inertiad/auth"

Package auth provides the Inertia daemon's authentication and security framework

Index

Package Files

doc.go permissions.go sessions.go users.go

type PermissionsHandler Uses

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 Uses

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. It also serves as the primary server for the Inertia daemon.

func (*PermissionsHandler) AttachAdminRestrictedHandlerFunc Uses

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 Uses

func (h *PermissionsHandler) AttachPublicHandler(path string, handler http.Handler)

AttachPublicHandler attaches given path and handler and makes it publicly available

func (*PermissionsHandler) AttachPublicHandlerFunc Uses

func (h *PermissionsHandler) AttachPublicHandlerFunc(
    path string,
    handler http.HandlerFunc,
    methods ...string,
)

AttachPublicHandlerFunc attaches given path and handler and makes it publicly available

func (*PermissionsHandler) AttachUserRestrictedHandlerFunc Uses

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 Uses

func (h *PermissionsHandler) Close() error

Close releases resources held by the PermissionsHandler

func (*PermissionsHandler) ServeHTTP Uses

func (h *PermissionsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

nolint: gocyclo

Package auth imports 19 packages (graph) and is imported by 1 packages. Updated 2021-01-28. Refresh now. Tools for package owners.