jwt

package
v0.0.0-...-693bad3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HS256JWTStrategy

type HS256JWTStrategy struct {
	Key []byte
}

HS256JWTStrategy is responsible for generating and validating JWT challenges

func (*HS256JWTStrategy) Decode

func (j *HS256JWTStrategy) Decode(ctx context.Context, token string) (*jwt.Token, error)

Decode will decode a JWT token

func (*HS256JWTStrategy) Generate

func (j *HS256JWTStrategy) Generate(ctx context.Context, claims jwt.Claims, header jwt_.Mapper) (string, string, error)

Generate generates a new authorize code or returns an error. set secret

func (*HS256JWTStrategy) GetSignature

func (j *HS256JWTStrategy) GetSignature(ctx context.Context, token string) (string, error)

GetSignature will return the signature of a token

func (*HS256JWTStrategy) GetSigningMethodLength

func (j *HS256JWTStrategy) GetSigningMethodLength() int

GetSigningMethodLength will return the length of the signing method

func (*HS256JWTStrategy) Hash

func (j *HS256JWTStrategy) Hash(ctx context.Context, in []byte) ([]byte, error)

Hash will return a given hash based on the byte input or an error upon fail

func (*HS256JWTStrategy) Validate

func (j *HS256JWTStrategy) Validate(ctx context.Context, token string) (string, error)

Validate validates a token and returns its signature or an error if the token is not valid.

Jump to

Keyboard shortcuts

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