auth

package
v4.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(h http.Handler, f ...Checker) http.Handler

Handler returns a http.Handler that gates access to the passed Handler behind the passed Checker.

Types

type Checker

type Checker interface {
	Check(context.Context, *http.Request) bool
}

Checker is an interface that reports whether the passed request should be allowed to continue.

type PSK

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

PSK implements the AuthCheck interface.

When Check is called the JWT on the incoming http request will be validated against a pre-shared-key.

func NewPSK

func NewPSK(key []byte, issuer []string) (*PSK, error)

NewPSK returns an instance of a PSK

func (*PSK) Check

func (p *PSK) Check(_ context.Context, r *http.Request) bool

Check implements AuthCheck

Jump to

Keyboard shortcuts

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