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
ee4d2d0a
Commit
ee4d2d0a
authored
Sep 29, 2017
by
Mike Danese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor authorizer to return a tristate decision
parent
71918892
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
interfaces.go
...s.io/apiserver/pkg/authorization/authorizer/interfaces.go
+15
-3
No files found.
staging/src/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go
View file @
ee4d2d0a
...
@@ -67,12 +67,12 @@ type Attributes interface {
...
@@ -67,12 +67,12 @@ type Attributes interface {
// zero or more calls to methods of the Attributes interface. It returns nil when an action is
// zero or more calls to methods of the Attributes interface. It returns nil when an action is
// authorized, otherwise it returns an error.
// authorized, otherwise it returns an error.
type
Authorizer
interface
{
type
Authorizer
interface
{
Authorize
(
a
Attributes
)
(
authorized
bool
,
reason
string
,
err
error
)
Authorize
(
a
Attributes
)
(
authorized
Decision
,
reason
string
,
err
error
)
}
}
type
AuthorizerFunc
func
(
a
Attributes
)
(
bool
,
string
,
error
)
type
AuthorizerFunc
func
(
a
Attributes
)
(
Decision
,
string
,
error
)
func
(
f
AuthorizerFunc
)
Authorize
(
a
Attributes
)
(
bool
,
string
,
error
)
{
func
(
f
AuthorizerFunc
)
Authorize
(
a
Attributes
)
(
Decision
,
string
,
error
)
{
return
f
(
a
)
return
f
(
a
)
}
}
...
@@ -144,3 +144,15 @@ func (a AttributesRecord) IsResourceRequest() bool {
...
@@ -144,3 +144,15 @@ func (a AttributesRecord) IsResourceRequest() bool {
func
(
a
AttributesRecord
)
GetPath
()
string
{
func
(
a
AttributesRecord
)
GetPath
()
string
{
return
a
.
Path
return
a
.
Path
}
}
type
Decision
int
const
(
// DecisionDeny means that an authorizer decided to deny the action.
DecisionDeny
Decision
=
iota
// DecisionAllow means that an authorizer decided to allow the action.
DecisionAllow
// DecisionNoOpionion means that an authorizer has no opinion on wether
// to allow or deny an action.
DecisionNoOpinion
)
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