jwt

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidPrivateKey is returned when the service provided an invalid private key
	ErrInvalidPrivateKey = errors.New("An invalid private key was provided")

	// ErrEncodingToken is returned when the service encounters an error during encoding
	ErrEncodingToken = errors.New("An error occured while encoding the JWT")

	// ErrInvalidToken is returned when the token provided is not valid
	ErrInvalidToken = errors.New("An invalid token was provided")

	// ErrMissingToken is returned when no token is provided
	ErrMissingToken = errors.New("A valid JWT is required")
)

Functions

func NewAuth

func NewAuth(opts ...auth.Option) auth.Auth

NewAuth returns a new instance of the Auth service

Types

type AuthClaims

type AuthClaims struct {
	Id       string            `json:"id"`
	Roles    []*auth.Role      `json:"roles"`
	Metadata map[string]string `json:"metadata"`

	jwt.StandardClaims
}

AuthClaims to be encoded in the JWT

Jump to

Keyboard shortcuts

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