middleware

package
v0.0.0-...-bd4e710 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminApiHandler

func AdminApiHandler(rw http.ResponseWriter, r *http.Request)

func HandleCacheControl

func HandleCacheControl(next http.Handler) http.Handler

func NotFoundHandler

func NotFoundHandler(rw http.ResponseWriter, req *http.Request)

func ProtectedApiHandler

func ProtectedApiHandler(rw http.ResponseWriter, r *http.Request)

func PublicApiHandler

func PublicApiHandler(rw http.ResponseWriter, r *http.Request)

func ServerError

func ServerError(rw http.ResponseWriter, err error)

func ValidateJWT

func ValidateJWT(audience, domain string, next http.Handler) http.Handler

func ValidatePermissions

func ValidatePermissions(expectedClaims []string, next http.Handler) http.Handler

Types

type CustomClaims

type CustomClaims struct {
	Permissions []string `json:"permissions"`
}

func (CustomClaims) HasPermissions

func (c CustomClaims) HasPermissions(expectedClaims []string) bool

func (CustomClaims) Validate

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

type ErrorMessage

type ErrorMessage struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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