request

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImpersonatingGroups

func GetImpersonatingGroups(request *nethttp.Request, ignoreImpersonationGroups []string, impersonationGroupsRegexp *regexp.Regexp) []string

func GetImpersonatingUser

func GetImpersonatingUser(request *nethttp.Request) string

func SanitizeImpersonationHeaders

func SanitizeImpersonationHeaders(request *nethttp.Request)

Types

type AuthType

type AuthType int
const (
	BearerToken AuthType = iota
	TLSCertificate
	Anonymous
)

func (AuthType) String

func (i AuthType) String() string

type ErrUnauthorized

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

func NewErrUnauthorized

func NewErrUnauthorized(message string) *ErrUnauthorized

func (*ErrUnauthorized) Error

func (e *ErrUnauthorized) Error() string

type Request

type Request interface {
	GetUserAndGroups() (string, []string, error)
	GetHTTPRequest() *h.Request
}

func NewHTTP

func NewHTTP(request *h.Request, authTypes []AuthType, usernameClaimField string, client client.Writer, ignoredImpersonationGroups []string, impersonationGroupsRegexp *regexp.Regexp) Request

Jump to

Keyboard shortcuts

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