rbac

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoIdentity is used to mark no identity is defined on a resource.
	NoIdentity = ""
	// UserIdentityAnnotation is the annotation that is used to store the user identity.
	UserIdentityAnnotation = "open-cluster-management.io/user-identity"
	// UserGroupsAnnotation is the annotation that is used to store the user groups.
	UserGroupsAnnotation = "open-cluster-management.io/user-group"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ImpersonationManager

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

ImpersonationManager manages the k8s clients for the various users and for the controller.

func NewImpersonationManager

func NewImpersonationManager(config *rest.Config) *ImpersonationManager

NewImpersonationManager creates a new instance of ImpersonationManager.

func (*ImpersonationManager) GetUserGroups

func (manager *ImpersonationManager) GetUserGroups(obj interface{}) (string, []string, error)

GetUserGroups returns the base64 encoded user groups and the decoded user groups in the obj or nil in case it can't be found on the object.

func (*ImpersonationManager) GetUserIdentity

func (manager *ImpersonationManager) GetUserIdentity(obj interface{}) (string, error)

GetUserIdentity returns the user identity in the obj or NoIdentity in case it can't be found on the object.

func (*ImpersonationManager) Impersonate

func (manager *ImpersonationManager) Impersonate(userIdentity string, userGroups []string) (client.Client, error)

Impersonate gets the user identity and returns the k8s client that represents the requesting user.

Jump to

Keyboard shortcuts

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