jwt

package
v2.1.1-0...-182a82a Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(reader Reader, newClaims func() Claims) functions.Intermediate

New creates custom function to validate JWT with provided validator.

Types

type Claims

type Claims interface {
	jwt.Claims

	Subject() string
}

Claims interface.

type Reader

type Reader interface {
	Read(token string, recv Claims) error
}

Reader is a claims reader interface.

type ReaderFunc

type ReaderFunc func(string, jwt.Claims) error

ReaderFunc allows regular function with a proper signature to be used as a Reader.

func HMAC

func HMAC(secretString string) ReaderFunc

HMAC creates simple JWT validator with provided secret string.

func RSA

func RSA(publicKey *rsa.PublicKey) ReaderFunc

RSA creates a JWT validator with provided public key.

func (ReaderFunc) Read

func (fn ReaderFunc) Read(token string, recv Claims) error

Jump to

Keyboard shortcuts

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