middleware

package
v0.0.0-...-eca8d62 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureValidToken

func EnsureValidToken() func(next http.Handler) http.Handler

EnsureValidToken is a middleware that will check the validity of our JWT.

Types

type CustomClaims

type CustomClaims struct {
	Scope string `json:"scope"`
}

CustomClaims contains custom data we want from the token.

func (CustomClaims) HasScope

func (c CustomClaims) HasScope(expectedScope string) bool

HasScope checks whether our claims have a specific scope.

func (CustomClaims) Validate

func (c CustomClaims) Validate(ctx context.Context) error

Validate does nothing for this example, but we need it to satisfy validator.CustomClaims interface.

Jump to

Keyboard shortcuts

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