util

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IssuerName    = "supermq.auth"
	TokenType     = "type"
	RoleField     = "role"
	VerifiedField = "verified"
	PatPrefix     = "pat"
)

Variables

View Source
var (
	// ErrInvalidIssuer represents an invalid token issuer value.
	ErrInvalidIssuer = errors.New("invalid token issuer value")

	// ErrJSONHandle indicates an error in handling JSON.
	ErrJSONHandle = errors.New("failed to perform operation JSON")

	// ErrJWTExpiryKey indicates that the "exp" claim in the JWT token is not satisfied.
	ErrJWTExpiryKey = errors.New(`"exp" not satisfied`)
)

Functions

func BuildToken

func BuildToken(key auth.Key) (jwt.Token, error)

func ToKey

func ToKey(tkn jwt.Token) (auth.Key, error)

ToKey converts a JWT token to an auth.Key by extracting claims.

Types

This section is empty.

Jump to

Keyboard shortcuts

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