github.com/rancher/types@v0.0.0-20220328215343-4370ff10ecd5/user/manager.go (about)

     1  package user
     2  
     3  import (
     4  	"github.com/rancher/norman/types"
     5  	"github.com/rancher/types/apis/management.cattle.io/v3"
     6  	apitypes "k8s.io/apimachinery/pkg/types"
     7  )
     8  
     9  type Manager interface {
    10  	SetPrincipalOnCurrentUser(apiContext *types.APIContext, principal v3.Principal) (*v3.User, error)
    11  	GetUser(apiContext *types.APIContext) string
    12  	EnsureToken(tokenName, description, kind, userName string) (string, error)
    13  	EnsureClusterToken(clusterName, tokenName, description, kind, userName string) (string, error)
    14  	EnsureUser(principalName, displayName string) (*v3.User, error)
    15  	CheckAccess(accessMode string, allowedPrincipalIDs []string, userPrincipalID string, groups []v3.Principal) (bool, error)
    16  	SetPrincipalOnCurrentUserByUserID(userID string, principal v3.Principal) (*v3.User, error)
    17  	CreateNewUserClusterRoleBinding(userName string, userUID apitypes.UID) error
    18  	GetUserByPrincipalID(principalName string) (*v3.User, error)
    19  	GetKubeconfigToken(clusterName, tokenName, description, kind, userName string) (*v3.Token, error)
    20  }