impersonation

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoImpersonationData is an error message for no impersonation data case
	ErrNoImpersonationData = errors.New("no impersonation data found")
	// ErrImpersonateUserRequired is an error message about required impersonate user to impersonate another info.
	ErrImpersonateUserRequired = errors.New("impersonate user is required to impersonate groups, UID, extra")
)

Functions

func HeaderMatcher

func HeaderMatcher(key string) (string, bool)

HeaderMatcher matches the impersonation header for adding to GRPC metadata.

Types

type Impersonation

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

Impersonation represents component to add Kubernetes impersonation header processing, make impersonation access check and RBAC for Tekton results resources with impersonated user data

func NewImpersonation

func NewImpersonation(md metadata.MD) (*Impersonation, error)

NewImpersonation returns an impersonation request if any impersonation data is found, returns error otherwise.

func (*Impersonation) Check

Check checks if the requester has permission to impersonate every resource.

func (*Impersonation) GetUserInfo

func (i *Impersonation) GetUserInfo() *user.DefaultInfo

GetUserInfo returns the impersonated user information.

Jump to

Keyboard shortcuts

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