1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-06 18:01:04 +00:00

Add dashboard to steve

This commit is contained in:
Darren Shepherd
2020-02-21 22:18:58 -07:00
parent c069f32bbe
commit 82c7877ba3
11 changed files with 478 additions and 0 deletions

View File

@@ -146,6 +146,17 @@ func ToMiddleware(auth Authenticator) Middleware {
}
}
func AlwaysAdmin(req *http.Request) (user.Info, bool, error) {
return &user.DefaultInfo{
Name: "admin",
UID: "admin",
Groups: []string{
"system:masters",
"system:authenticated",
},
}, true, nil
}
func Impersonation(req *http.Request) (user.Info, bool, error) {
userName := req.Header.Get(transport.ImpersonateUserHeader)
if userName == "" {