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
1c012f1c
Unverified
Commit
1c012f1c
authored
Jul 06, 2018
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve multi-authorizer errors
parent
91b72934
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
abac.go
pkg/auth/authorizer/abac/abac.go
+1
-1
rbac.go
plugin/pkg/auth/authorizer/rbac/rbac.go
+2
-0
No files found.
pkg/auth/authorizer/abac/abac.go
View file @
1c012f1c
...
...
@@ -227,7 +227,7 @@ func (pl policyList) Authorize(a authorizer.Attributes) (authorizer.Decision, st
return
authorizer
.
DecisionAllow
,
""
,
nil
}
}
return
authorizer
.
DecisionNoOpinion
,
"
No policy matched.
"
,
nil
return
authorizer
.
DecisionNoOpinion
,
"
no ABAC policy matched
"
,
nil
// TODO: Benchmark how much time policy matching takes with a medium size
// policy file, compared to other steps such as encoding/decoding.
// Then, add Caching only if needed.
...
...
plugin/pkg/auth/authorizer/rbac/rbac.go
View file @
1c012f1c
...
...
@@ -121,6 +121,8 @@ func (r *RBACAuthorizer) Authorize(requestAttributes authorizer.Attributes) (aut
reason
:=
""
if
len
(
ruleCheckingVisitor
.
errors
)
>
0
{
reason
=
fmt
.
Sprintf
(
"RBAC: %v"
,
utilerrors
.
NewAggregate
(
ruleCheckingVisitor
.
errors
))
}
else
{
reason
=
"no RBAC policy matched"
}
return
authorizer
.
DecisionNoOpinion
,
reason
,
nil
}
...
...
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