middleware

package
v0.0.0-...-3b15a80 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware() gin.HandlerFunc

AuthMiddleware checks for a valid JWT in the Authorization header

func GenerateJWT

func GenerateJWT(userID string) (string, error)

GenerateJWT generates a JWT token for a given user ID

func ParseJWT

func ParseJWT(tokenString string) (string, error)

ParseJWT parses and validates a JWT token

func RoleMiddleware

func RoleMiddleware(requiredRole string) gin.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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