1
0
mirror of https://github.com/rancher/types.git synced 2025-08-30 19:32:18 +00:00
types/user/manager.go
2021-01-04 22:07:54 -07:00

22 lines
1.1 KiB
Go

package user
import (
"github.com/rancher/norman/types"
"github.com/rancher/types/apis/management.cattle.io/v3"
apitypes "k8s.io/apimachinery/pkg/types"
)
type Manager interface {
SetPrincipalOnCurrentUser(apiContext *types.APIContext, principal v3.Principal) (*v3.User, error)
GetUser(apiContext *types.APIContext) string
EnsureToken(tokenName, description, kind, userName string, ttl *int64, randomize bool) (string, error)
EnsureClusterToken(clusterName, tokenName, description, kind, userName string, ttl *int64, randomize bool) (string, error)
DeleteToken(tokenName string) error
EnsureUser(principalName, displayName string) (*v3.User, error)
CheckAccess(accessMode string, allowedPrincipalIDs []string, userPrincipalID string, groups []v3.Principal) (bool, error)
SetPrincipalOnCurrentUserByUserID(userID string, principal v3.Principal) (*v3.User, error)
CreateNewUserClusterRoleBinding(userName string, userUID apitypes.UID) error
GetUserByPrincipalID(principalName string) (*v3.User, error)
GetKubeconfigToken(clusterName, tokenName, description, kind, userName string) (*v3.Token, error)
}