auth

package module
v0.0.0-...-31ecf3b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminAuth

type AdminAuth struct {
	Users    *users.UserManager
	Sessions *sessions.SessionManager
}

AdminAuth to handle authentication for admin

func CreateAdminAuth

func CreateAdminAuth(opts ...AuthOption) *AdminAuth

CreateAdminAuth to initialize the Admin handlers struct

func (*AdminAuth) HandlerAuthCheck

func (a *AdminAuth) HandlerAuthCheck(h http.Handler) http.Handler

Handler to check access to a resource based on the authentication enabled

func (*AdminAuth) LevelPermissions

func (a *AdminAuth) LevelPermissions(user users.AdminUser) string

LevelPermissions to convert permissions for a user to a level for context

type AuthOption

type AuthOption func(*AdminAuth)

func WithSessions

func WithSessions(sessions *sessions.SessionManager) AuthOption

func WithUsers

func WithUsers(users *users.UserManager) AuthOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL