auth

package
v0.0.0-...-cfbb22e Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate() echo.MiddlewareFunc

Middleware makes JWT implement the Middleware interface. func Middleware(tokenParser TokenParser) echo.MiddlewareFunc {

func CheckAuthorization

func CheckAuthorization(db sqlx.DB, requiredRoles []string) echo.MiddlewareFunc

Types

type ProfileStruct

type ProfileStruct struct {
	RoleID   int    `db:"roleID"`
	RoleName string `db:"roleName"`
	OrgID    int    `db:"orgID"`
	UserID   int    `db:"userID"`
	ProfID   int    `db:"profileID"`
}

type TokenParser

type TokenParser interface {
	ParseToken(string) (*jwt.Token, error)
}

TokenParser represents JWT token parser

Jump to

Keyboard shortcuts

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