user

package
v0.0.0-...-8d2d31d Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const KeyID = `key-id`
View Source
const PermissionsClaim = "perm"
View Source
const PrivateKey = `` /* 226-byte string literal not displayed */

Variables

View Source
var (
	ErrNoAuthHeader      = errors.New("Authorization header is missing")
	ErrInvalidAuthHeader = errors.New("Authorization header is malformed")
	ErrClaimsInvalid     = errors.New("Provided claims do not match expected scopes")
)

Functions

func Authenticate

func Authenticate(v JWSValidator, ctx context.Context,
	input *openapi3filter.AuthenticationInput, audience string, issuer string) error

func CreateMiddleware

func CreateMiddleware(v JWSValidator, swagger *openapi3.T, audience string, issuer string) ([]echo.MiddlewareFunc, error)

func GetJWSFromRequest

func GetJWSFromRequest(req *http.Request) (string, error)

func NewAuthenticator

func NewAuthenticator(v JWSValidator, audience string, issuer string) openapi3filter.AuthenticationFunc

Types

type InstanceAuthenticator

type InstanceAuthenticator struct {
	PrivateKey *ecdsa.PrivateKey
	KeySet     jwk.Set
}

func NewInstanceAuthenticator

func NewInstanceAuthenticator() (*InstanceAuthenticator, error)

func (*InstanceAuthenticator) ValidateJWS

func (f *InstanceAuthenticator) ValidateJWS(jwsString string, audience string, issuer string) (jwt.Token, error)

type JWSValidator

type JWSValidator interface {
	ValidateJWS(jws string, audience string, issuer string) (jwt.Token, error)
}

Jump to

Keyboard shortcuts

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