jwt

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 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")
)

Errors

Functions

This section is empty.

Types

type AuthClaims

type AuthClaims struct {
	jwt.StandardClaims
	Dashboard bool `json:"dashboard"`
	API       bool `json:"api"`
}

func (*AuthClaims) VerifySubject

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

type JWTAuth added in v1.2.2

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

func NewJWTAuth added in v1.2.2

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

func (*JWTAuth) IssueJWT added in v1.2.2

func (j *JWTAuth) IssueJWT(api bool, dashboard bool) (string, error)

func (*JWTAuth) Middleware added in v1.2.2

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

func (*JWTAuth) VerifyJWT added in v1.2.2

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