verify

package
v0.0.0-...-347cd60 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PermissionAdmin = "admin"
View Source
const PermissionUseServices = "use_services"

Permission names

Variables

View Source
var Permissions = map[string]int16{
	"use_services": 10,
	"admin":        100,
}

Permissions

Functions

func AuthMiddleware

func AuthMiddleware() func(c *fiber.Ctx) error

A middleware that checks the jwt token and then also loads all of the session information into the locals

Types

type SessionInformation

type SessionInformation struct {
	// contains filtered or unexported fields
}

func GetSessionInfo

func GetSessionInfo(c *fiber.Ctx) (*SessionInformation, error)

func InfoLocals

func InfoLocals(c *fiber.Ctx) *SessionInformation

Get the session information from the locals (just makes the process a little easier)

func (*SessionInformation) GetAccount

func (i *SessionInformation) GetAccount() string

func (*SessionInformation) GetAccountUUID

func (i *SessionInformation) GetAccountUUID() (uuid.UUID, error)

func (*SessionInformation) GetPermissionLevel

func (i *SessionInformation) GetPermissionLevel() int16

func (*SessionInformation) GetSession

func (i *SessionInformation) GetSession() string

func (*SessionInformation) GetSessionUUID

func (i *SessionInformation) GetSessionUUID() (uuid.UUID, error)

func (*SessionInformation) HasPermission

func (i *SessionInformation) HasPermission(perm string) bool

Check if the current user has a specific permission

func (*SessionInformation) IsValid

func (i *SessionInformation) IsValid() bool

Jump to

Keyboard shortcuts

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