Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
2a773531
Commit
2a773531
authored
Nov 28, 2016
by
xilabao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extend err info when authorize failed
parent
f87edaac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
errors.go
pkg/apiserver/filters/errors.go
+1
-1
rbac.go
plugin/pkg/auth/authorizer/rbac/rbac.go
+2
-1
No files found.
pkg/apiserver/filters/errors.go
View file @
2a773531
...
...
@@ -64,6 +64,6 @@ func internalError(w http.ResponseWriter, req *http.Request, err error) {
w
.
Header
()
.
Set
(
"Content-Type"
,
"text/plain"
)
w
.
Header
()
.
Set
(
"X-Content-Type-Options"
,
"nosniff"
)
w
.
WriteHeader
(
http
.
StatusInternalServerError
)
fmt
.
Fprintf
(
w
,
"Internal Server Error: %#v
"
,
req
.
RequestURI
)
fmt
.
Fprintf
(
w
,
"Internal Server Error: %#v
: %v"
,
req
.
RequestURI
,
err
)
runtime
.
HandleError
(
err
)
}
plugin/pkg/auth/authorizer/rbac/rbac.go
View file @
2a773531
...
...
@@ -18,6 +18,7 @@ limitations under the License.
package
rbac
import
(
"fmt"
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/apis/rbac"
...
...
@@ -47,7 +48,7 @@ func (r *RBACAuthorizer) Authorize(requestAttributes authorizer.Attributes) (boo
glog
.
V
(
2
)
.
Infof
(
"RBAC DENY: user %q groups %v cannot %q on
\"
%v.%v/%v
\"
"
,
requestAttributes
.
GetUser
()
.
GetName
(),
requestAttributes
.
GetUser
()
.
GetGroups
(),
requestAttributes
.
GetVerb
(),
requestAttributes
.
GetResource
(),
requestAttributes
.
GetAPIGroup
(),
requestAttributes
.
GetSubresource
())
return
false
,
""
,
ruleResolutionError
return
false
,
fmt
.
Sprintf
(
"%v"
,
ruleResolutionError
),
nil
}
func
New
(
roles
validation
.
RoleGetter
,
roleBindings
validation
.
RoleBindingLister
,
clusterRoles
validation
.
ClusterRoleGetter
,
clusterRoleBindings
validation
.
ClusterRoleBindingLister
)
*
RBACAuthorizer
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment