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