Discover Packages
github.com/jpurdie/authapi
pkg
utl
middleware
auth
package
Version:
v0.0.0-...-cfbb22e
Opens a new window with list of versions in this module.
Published: Mar 9, 2021
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
func Authenticate() echo.MiddlewareFunc
Middleware makes JWT implement the Middleware interface.
func Middleware(tokenParser TokenParser) echo.MiddlewareFunc {
func CheckAuthorization(db sqlx .DB , requiredRoles []string ) echo.MiddlewareFunc
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 interface {
ParseToken(string ) (*jwt.Token, error )
}
TokenParser represents JWT token parser
Source Files
¶
Click to show internal directories.
Click to hide internal directories.