auth

package
v0.0.0-...-85add97 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllowExpiredCert

func GetAllowExpiredCert() bool

func GetRole

func GetRole(r *http.Request) (rbac.Role, error)

func IsAuthorized

func IsAuthorized(r *http.Request, role rbac.Role) (bool, error)

func RoleHandler

func RoleHandler(role rbac.Role, f func(http.ResponseWriter, *http.Request)) http.Handler

func SetAllowExpiredCert

func SetAllowExpiredCert(allow bool)

func SetAuthMethod

func SetAuthMethod(method AuthMethod)

func SetCheckCert

func SetCheckCert(caCerts *x509.CertPool)

func VerifyCertificates

func VerifyCertificates(clientCertificates []*x509.Certificate) (role rbac.Role, err error)

func VerifyCertificatesWithoutRole

func VerifyCertificatesWithoutRole(clientCertificates []*x509.Certificate) (err error)

Types

type AuthMethod

type AuthMethod string
const (
	NONE    AuthMethod = "NONE"
	API_KEY AuthMethod = "API_KEY"
	MTLS    AuthMethod = "mTLS"
)

func GetAuthMethod

func GetAuthMethod() AuthMethod

Jump to

Keyboard shortcuts

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