jwtmiddleware

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TokenClaimsKey is the key for the token claims in the fiber context.
	TokenClaimsKey = "user"
)

Variables

This section is empty.

Functions

func AllOfPermissions

func AllOfPermissions(contract common.Address, tokenIDParam string, permissions []string) fiber.Handler

AllOfPermissions creates a middleware that checks if the token contains all the required. This middleware also checks if the token is for the correct contract and token ID.

func AllOfPermissionsAddress

func AllOfPermissionsAddress(addressParam string, permissions []string) fiber.Handler

AllOfPermissionsAddress creates a middleware that checks if the token contains all the required. This middleware also checks if the token is for the correct contract and token ID.

func GetTokenClaim

func GetTokenClaim(ctx *fiber.Ctx) (*tokenclaims.Token, error)

GetTokenClaim gets the token claim from the fiber context.

func NewJWTMiddleware

func NewJWTMiddleware(jwkSetURLs ...string) fiber.Handler

NewJWTMiddleware creates a new JWT token middleware that validates the token and stores the claims in the fiber context.

func OneOfPermissions

func OneOfPermissions(contract common.Address, tokenIDParam string, permissions []string) fiber.Handler

OneOfPermissions creates a middleware that checks if the token contains any of the required. This middleware also checks if the token is for the correct contract and token ID.

func OneOfPermissionsAddress

func OneOfPermissionsAddress(addressParam string, permissions []string) fiber.Handler

OneOfPermissionsAddress creates a middleware that checks if the token contains any of the required. This middleware also checks if the token is for the correct contract and token ID.

Types

This section is empty.

Jump to

Keyboard shortcuts

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