auth

package
v4.1.1-0...-07afa25 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 14 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

type QuayKeyserver

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

QuayKeyserver implements the AuthCheck interface.

When Check is called the JWT on the incoming http request will be validated against the Quay Keyserver

It follows the algorithm outlined here: https://github.com/quay/jwtproxy/tree/master/jwt/keyserver/keyregistry#verifier

func NewQuayKeyserver

func NewQuayKeyserver(api string) (*QuayKeyserver, error)

NewQuayKeyserver returns an instance of a QuayKeyserver

func (*QuayKeyserver) Check

func (s *QuayKeyserver) Check(ctx 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