request

package
v0.13.9 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 18 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 ResolveUserAndGroups added in v0.13.0

func ResolveUserAndGroups(
	request *h.Request,
	authTypes []AuthType,
	usernameClaimField string,
	writer client.Writer,
	ignoredImpersonationGroups []string,
	impersonationGroupsRegexp *regexp.Regexp,
	skipImpersonationReview bool,
	xfcc_header string,
) (*h.Request, string, []string, error)

func SanitizeImpersonationHeaders

func SanitizeImpersonationHeaders(request *nethttp.Request)

Types

type AuthType

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

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,
	skipImpersonationReview bool,
	xfcc_header string,
) Request

Jump to

Keyboard shortcuts

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