Documentation
¶
Index ¶
- Constants
- func AllOfPermissions(contract common.Address, tokenIDParam string, permissions []string) fiber.Handler
- func AllOfPermissionsAddress(addressParam string, permissions []string) fiber.Handler
- func GetTokenClaim(ctx *fiber.Ctx) (*tokenclaims.Token, error)
- func NewJWTMiddleware(jwkSetURLs ...string) fiber.Handler
- func OneOfPermissions(contract common.Address, tokenIDParam string, permissions []string) fiber.Handler
- func OneOfPermissionsAddress(addressParam string, permissions []string) fiber.Handler
Constants ¶
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 ¶
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 ¶
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.
Types ¶
This section is empty.