handler.go 3.1 KB
Newer Older
Z
zryfish 已提交
1
package v1alpha2
H
hongming 已提交
2 3 4

import (
	"github.com/emicklei/go-restful"
5
	authoptions "kubesphere.io/kubesphere/pkg/apiserver/authentication/options"
H
hongming 已提交
6
	"kubesphere.io/kubesphere/pkg/informers"
H
update  
hongming 已提交
7 8
	"kubesphere.io/kubesphere/pkg/models/iam/am"
	"kubesphere.io/kubesphere/pkg/models/iam/im"
9
	"kubesphere.io/kubesphere/pkg/simple/client/cache"
H
hongming 已提交
10 11
	"kubesphere.io/kubesphere/pkg/simple/client/k8s"
	ldappool "kubesphere.io/kubesphere/pkg/simple/client/ldap"
H
hongming 已提交
12 13 14
)

type iamHandler struct {
H
update  
hongming 已提交
15 16
	amOperator am.AccessManagementInterface
	imOperator im.IdentityManagementInterface
H
hongming 已提交
17 18
}

19
func newIAMHandler(k8sClient k8s.Client, factory informers.InformerFactory, ldapClient ldappool.Interface, cacheClient cache.Interface, options *authoptions.AuthenticationOptions) *iamHandler {
H
hongming 已提交
20
	return &iamHandler{
H
update  
hongming 已提交
21
		amOperator: am.NewAMOperator(k8sClient.Kubernetes(), factory.KubernetesSharedInformerFactory()),
H
update  
hongming 已提交
22
		imOperator: im.NewLDAPOperator(ldapClient),
H
hongming 已提交
23
	}
H
hongming 已提交
24 25 26
}

func (h *iamHandler) CreateUser(req *restful.Request, resp *restful.Response) {
H
update  
hongming 已提交
27
	panic("implement me")
H
hongming 已提交
28 29
}

H
hongming 已提交
30
func (h *iamHandler) DeleteUser(req *restful.Request, resp *restful.Response) {
H
update  
hongming 已提交
31
	panic("implement me")
H
hongming 已提交
32 33 34
}

func (h *iamHandler) ModifyUser(request *restful.Request, response *restful.Response) {
H
update  
hongming 已提交
35
	panic("implement me")
H
hongming 已提交
36 37 38
}

func (h *iamHandler) DescribeUser(req *restful.Request, resp *restful.Response) {
H
update  
hongming 已提交
39
	panic("implement me")
H
hongming 已提交
40 41
}

H
hongming 已提交
42
func (h *iamHandler) ListUsers(req *restful.Request, resp *restful.Response) {
H
update  
hongming 已提交
43
	panic("implement me")
H
hongming 已提交
44 45 46
}

func (h *iamHandler) ListUserRoles(req *restful.Request, resp *restful.Response) {
H
update  
hongming 已提交
47
	panic("implement me")
H
hongming 已提交
48 49 50
}

func (h *iamHandler) ListRoles(req *restful.Request, resp *restful.Response) {
H
update  
hongming 已提交
51

H
update  
hongming 已提交
52
	panic("implement me")
H
hongming 已提交
53
}
H
hongming 已提交
54
func (h *iamHandler) ListClusterRoles(req *restful.Request, resp *restful.Response) {
H
update  
hongming 已提交
55
	panic("implement me")
H
hongming 已提交
56
}
H
hongming 已提交
57

H
hongming 已提交
58
func (h *iamHandler) ListRoleUsers(req *restful.Request, resp *restful.Response) {
H
update  
hongming 已提交
59
	panic("implement me")
H
hongming 已提交
60 61
}

H
hongming 已提交
62 63
// List users by namespace
func (h *iamHandler) ListNamespaceUsers(req *restful.Request, resp *restful.Response) {
H
update  
hongming 已提交
64
	panic("implement me")
H
hongming 已提交
65 66 67
}

func (h *iamHandler) ListClusterRoleUsers(req *restful.Request, resp *restful.Response) {
H
update  
hongming 已提交
68
	panic("implement me")
H
hongming 已提交
69 70 71
}

func (h *iamHandler) ListClusterRoleRules(req *restful.Request, resp *restful.Response) {
H
update  
hongming 已提交
72
	panic("implement me")
H
hongming 已提交
73 74
}

H
hongming 已提交
75
func (h *iamHandler) ListRoleRules(req *restful.Request, resp *restful.Response) {
H
update  
hongming 已提交
76
	panic("implement me")
H
hongming 已提交
77
}
H
hongming 已提交
78

H
hongming 已提交
79 80 81
func (h *iamHandler) ListWorkspaceRoles(request *restful.Request, response *restful.Response) {
	panic("implement me")
}
H
hongming 已提交
82

H
hongming 已提交
83 84
func (h *iamHandler) DescribeWorkspaceRole(request *restful.Request, response *restful.Response) {
	panic("implement me")
H
hongming 已提交
85 86
}

H
hongming 已提交
87 88 89 90 91 92 93
func (h *iamHandler) ListWorkspaceRoleRules(request *restful.Request, response *restful.Response) {
	panic("implement me")
}

func (h *iamHandler) ListWorkspaceUsers(request *restful.Request, response *restful.Response) {
	panic("implement me")
}
H
hongming 已提交
94

H
hongming 已提交
95 96 97
func (h *iamHandler) InviteUser(request *restful.Request, response *restful.Response) {
	panic("implement me")
}
H
hongming 已提交
98

H
hongming 已提交
99 100 101
func (h *iamHandler) RemoveUser(request *restful.Request, response *restful.Response) {
	panic("implement me")
}
H
hongming 已提交
102

H
hongming 已提交
103 104
func (h *iamHandler) DescribeWorkspaceUser(request *restful.Request, response *restful.Response) {
	panic("implement me")
H
hongming 已提交
105
}