jwt

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrJWTInvalidClaims = echo.NewHTTPError(http.StatusUnauthorized, "invalid jwt claims")
)

Functions

This section is empty.

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func NewAuth

func NewAuth(subject string, sessionTimeout time.Duration, nodeID string, secret crypto.PrivKey) (*Auth, error)

func (*Auth) IssueJWT

func (j *Auth) IssueJWT() (string, error)

func (*Auth) Middleware

func (j *Auth) Middleware(skipper middleware.Skipper, allow func(c echo.Context, subject string, claims *AuthClaims) bool) echo.MiddlewareFunc

func (*Auth) VerifyJWT

func (j *Auth) VerifyJWT(token string, allow func(claims *AuthClaims) bool) bool

type AuthClaims

type AuthClaims struct {
	jwt.StandardClaims
}

func (*AuthClaims) VerifySubject

func (c *AuthClaims) VerifySubject(expected string) bool

Jump to

Keyboard shortcuts

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