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: 0

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