1
0
mirror of https://github.com/rancher/steve.git synced 2025-08-31 15:11:31 +00:00

Full dynamic RBAC and pagination

This commit is contained in:
Darren Shepherd
2020-02-10 10:18:20 -07:00
parent 12df5d1a3d
commit e64845dcb9
18 changed files with 656 additions and 36 deletions

View File

@@ -12,7 +12,7 @@ import (
"github.com/rancher/steve/pkg/schemaserver/urlbuilder"
"github.com/rancher/steve/pkg/server/router"
"github.com/sirupsen/logrus"
"k8s.io/apiserver/pkg/authentication/user"
"k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/client-go/rest"
)
@@ -57,9 +57,9 @@ type apiServer struct {
}
func (a *apiServer) common(rw http.ResponseWriter, req *http.Request) (*types.APIRequest, bool) {
user := &user.DefaultInfo{
Name: "admin",
Groups: []string{"system:masters"},
user, ok := request.UserFrom(req.Context())
if !ok {
return nil, false
}
schemas, err := a.sf.Schemas(user)