jwt

package
v2.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 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")
)

Errors

Functions

This section is empty.

Types

type AuthClaims

type AuthClaims struct {
	jwt.StandardClaims
}

func (*AuthClaims) VerifySubject

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

type JWTAuth

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

func NewJWTAuth

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

func (*JWTAuth) IssueJWT

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

func (*JWTAuth) Middleware

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

func (*JWTAuth) VerifyJWT

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

Jump to

Keyboard shortcuts

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