auth

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMiddleware

func NewMiddleware(authn Authenticator, whitelist ...string) goa.Middleware

NewMiddleware creates a static auth middleware.

Types

type Authenticator

type Authenticator interface {
	Validate(req *http.Request, res http.ResponseWriter) bool
	Issuer() string
}

Authenticator is a generic interface to validate an HTTP request

func NewAuthenticator added in v3.1.0

func NewAuthenticator(uri, username string) (Authenticator, error)

NewAuthenticator create new authenticator

type HtpasswdFile

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

HtpasswdFile is a map for usernames to passwords.

func NewHtpasswdFromFile

func NewHtpasswdFromFile(path, username string) (*HtpasswdFile, error)

NewHtpasswdFromFile reads the users and passwords from a htpasswd file and returns them.

func (*HtpasswdFile) Issuer added in v3.1.0

func (h *HtpasswdFile) Issuer() string

Issuer of the authenticator

func (*HtpasswdFile) Validate

func (h *HtpasswdFile) Validate(req *http.Request, res http.ResponseWriter) bool

Validate HTTP request credentials

type JWTAuthenticator added in v3.1.0

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

JWTAuthenticator authenticator use to handle OIDC jWT

func NewJWTAuthenticator added in v3.1.0

func NewJWTAuthenticator(issuer, username string) (*JWTAuthenticator, error)

NewJWTAuthenticator create new JWT authenticator

func (*JWTAuthenticator) Issuer added in v3.1.0

func (j *JWTAuthenticator) Issuer() string

Issuer of the authenticator

func (*JWTAuthenticator) Validate added in v3.1.0

func (j *JWTAuthenticator) Validate(req *http.Request, res http.ResponseWriter) bool

Validate HTTP request credentials

Jump to

Keyboard shortcuts

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