middlewares

package
v0.6.80 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRolePresent

func CheckRolePresent(roles []string, roleToFind string) bool

func GetClientIdFromJwt

func GetClientIdFromJwt(claims jwt.MapClaims) string

func GetCurrentLoggedUserEmailFromJwt

func GetCurrentLoggedUserEmailFromJwt(claims jwt.MapClaims) string

get current logged in user email (username) from jwt

func GetCurrentLoggedUserUUIDFromJwt

func GetCurrentLoggedUserUUIDFromJwt(claims jwt.MapClaims) string

get current logged in user email (username) from jwt

func GetCustomerIdFromJwt

func GetCustomerIdFromJwt(claims jwt.MapClaims) int

get current customer_id from jwt

func GetCustomerNameFromJwt

func GetCustomerNameFromJwt(claims jwt.MapClaims) string

get current customer from jwt

func GetRolesListFromJwt

func GetRolesListFromJwt(claims jwt.MapClaims) ([]string, error)

func JwtProtected

func JwtProtected(publicKey string) fiber.Handler

JwtProtected wrap http handler functions for jwt verification

func RoleCheck

func RoleCheck(rolesToCheck []string) fiber.Handler

function needed to wrap http handlers for limit the access for specific roles, if at least one role specified is present in the jwt, it can pass, otherwise early return 401

Types

This section is empty.

Jump to

Keyboard shortcuts

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