2018-03-02 11:49:51 -07:00
|
|
|
package user
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/rancher/norman/types"
|
|
|
|
"github.com/rancher/types/apis/management.cattle.io/v3"
|
2018-08-14 09:56:07 -07:00
|
|
|
apitypes "k8s.io/apimachinery/pkg/types"
|
2018-03-02 11:49:51 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
type Manager interface {
|
|
|
|
SetPrincipalOnCurrentUser(apiContext *types.APIContext, principal v3.Principal) (*v3.User, error)
|
|
|
|
GetUser(apiContext *types.APIContext) string
|
2019-08-14 15:34:54 -07:00
|
|
|
EnsureToken(tokenName, description, kind, userName string) (string, error)
|
|
|
|
EnsureClusterToken(clusterName, tokenName, description, kind, userName string) (string, error)
|
2018-03-02 11:49:51 -07:00
|
|
|
EnsureUser(principalName, displayName string) (*v3.User, error)
|
2018-12-03 09:33:52 -07:00
|
|
|
CheckAccess(accessMode string, allowedPrincipalIDs []string, userPrincipalID string, groups []v3.Principal) (bool, error)
|
2018-03-30 16:12:30 -07:00
|
|
|
SetPrincipalOnCurrentUserByUserID(userID string, principal v3.Principal) (*v3.User, error)
|
2018-08-14 09:56:07 -07:00
|
|
|
CreateNewUserClusterRoleBinding(userName string, userUID apitypes.UID) error
|
2019-02-12 15:28:44 -08:00
|
|
|
GetUserByPrincipalID(principalName string) (*v3.User, error)
|
2018-03-02 11:49:51 -07:00
|
|
|
}
|