users

package
v0.0.0-...-351f9be Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddClusterRoleToUser

func AddClusterRoleToUser(rancherClient *rancher.Client, cluster *management.Cluster,
	user *management.User, clusterRole string, attrs []*authzv1.ResourceAttributes) error

AddClusterRoleToUser is a helper function that adds a cluster role to `user`. If a list of ResourceAttributes is given, then the function blocks until all attributes are allowed by SelfSubjectAccessReviews OR the function times out.

func AddProjectMember

func AddProjectMember(rancherClient *rancher.Client, project *management.Project,
	user *management.User, projectRole string, attrs []*authzv1.ResourceAttributes) error

AddProjectMember is a helper function that adds a project role to `user`. It uses the watch.WatchWait to ensure BackingNamespaceCreated is true. If a list of ResourceAttributes is given, then the function blocks until all attributes are allowed by SelfSubjectAccessReviews OR the function times out.

func CreateUserWithRole

func CreateUserWithRole(rancherClient *rancher.Client, user *management.User, roles ...string) (*management.User, error)

CreateUserWithRole is helper function that creates a user with a role or multiple roles

func GetUserIDByName

func GetUserIDByName(client *rancher.Client, username string) (string, error)

GetUserIDByName is a helper function that returns the user ID by name

func RemoveClusterRoleFromUser

func RemoveClusterRoleFromUser(rancherClient *rancher.Client, user *management.User) error

RemoveClusterRoleFromUser is a helper function that removes the user from cluster

func RemoveProjectMember

func RemoveProjectMember(rancherClient *rancher.Client, user *management.User) error

RemoveProjectMember is a helper function that removes the project role from `user`

func UserConfig

func UserConfig() (user *management.User)

UserConfig sets and returns username and password of the user

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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