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.
Click to show internal directories.
Click to hide internal directories.