37 Star 411 Fork 76

GVPrancher/rancher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
server.go 1.84 KB
一键复制 编辑 原始数据 按行查看 历史
rajashree 提交于 2018-03-10 13:02 . Add Saml-Ping provider
package server
import (
"context"
"net/http"
normanapi "github.com/rancher/norman/api"
"github.com/rancher/norman/api/builtin"
"github.com/rancher/norman/pkg/subscribe"
"github.com/rancher/rancher/pkg/api/controllers/dynamicschema"
"github.com/rancher/rancher/pkg/api/controllers/samlconfig"
"github.com/rancher/rancher/pkg/api/controllers/settings"
"github.com/rancher/rancher/pkg/api/controllers/whitelistproxy"
"github.com/rancher/rancher/pkg/api/server/managementstored"
"github.com/rancher/rancher/pkg/api/server/userstored"
"github.com/rancher/rancher/pkg/clustermanager"
clusterSchema "github.com/rancher/types/apis/cluster.cattle.io/v3/schema"
managementSchema "github.com/rancher/types/apis/management.cattle.io/v3/schema"
projectSchema "github.com/rancher/types/apis/project.cattle.io/v3/schema"
"github.com/rancher/types/config"
)
func New(ctx context.Context, scaledContext *config.ScaledContext, clusterManager *clustermanager.Manager,
k8sProxy http.Handler) (http.Handler, error) {
subscribe.Register(&builtin.Version, scaledContext.Schemas)
subscribe.Register(&managementSchema.Version, scaledContext.Schemas)
subscribe.Register(&clusterSchema.Version, scaledContext.Schemas)
subscribe.Register(&projectSchema.Version, scaledContext.Schemas)
if err := managementstored.Setup(ctx, scaledContext, clusterManager, k8sProxy); err != nil {
return nil, err
}
if err := userstored.Setup(ctx, scaledContext, clusterManager, k8sProxy); err != nil {
return nil, err
}
server := normanapi.NewAPIServer()
server.AccessControl = scaledContext.AccessControl
if err := server.AddSchemas(scaledContext.Schemas); err != nil {
return nil, err
}
dynamicschema.Register(scaledContext, server.Schemas)
whitelistproxy.Register(scaledContext)
samlconfig.Register(scaledContext)
err := settings.Register(scaledContext)
return server, err
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.0.12-rc3

搜索帮助

0d507c66 1850385 C8b1a773 1850385