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
4685bd8f
Commit
4685bd8f
authored
Nov 10, 2017
by
hzxuzhonghu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename test file and remove unused code
parent
687c8d32
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
18 deletions
+1
-18
BUILD
...8s.io/apiserver/pkg/authorization/authorizerfactory/BUILD
+1
-1
builtin.go
.../apiserver/pkg/authorization/authorizerfactory/builtin.go
+0
-13
builtin_test.go
...erver/pkg/authorization/authorizerfactory/builtin_test.go
+0
-4
No files found.
staging/src/k8s.io/apiserver/pkg/authorization/authorizerfactory/BUILD
View file @
4685bd8f
...
@@ -8,7 +8,7 @@ load(
...
@@ -8,7 +8,7 @@ load(
go_test(
go_test(
name = "go_default_test",
name = "go_default_test",
srcs = ["
authz
_test.go"],
srcs = ["
builtin
_test.go"],
importpath = "k8s.io/apiserver/pkg/authorization/authorizerfactory",
importpath = "k8s.io/apiserver/pkg/authorization/authorizerfactory",
library = ":go_default_library",
library = ":go_default_library",
deps = [
deps = [
...
...
staging/src/k8s.io/apiserver/pkg/authorization/authorizerfactory/builtin.go
View file @
4685bd8f
...
@@ -68,19 +68,6 @@ func NewAlwaysDenyAuthorizer() *alwaysDenyAuthorizer {
...
@@ -68,19 +68,6 @@ func NewAlwaysDenyAuthorizer() *alwaysDenyAuthorizer {
return
new
(
alwaysDenyAuthorizer
)
return
new
(
alwaysDenyAuthorizer
)
}
}
// alwaysFailAuthorizer is an implementation of authorizer.Attributes
// which always says no to an authorization request.
// It is useful in unit tests to force an operation to fail with error.
type
alwaysFailAuthorizer
struct
{}
func
(
alwaysFailAuthorizer
)
Authorize
(
a
authorizer
.
Attributes
)
(
authorized
authorizer
.
Decision
,
reason
string
,
err
error
)
{
return
authorizer
.
DecisionNoOpinion
,
""
,
errors
.
New
(
"Authorization failure."
)
}
func
NewAlwaysFailAuthorizer
()
authorizer
.
Authorizer
{
return
new
(
alwaysFailAuthorizer
)
}
type
privilegedGroupAuthorizer
struct
{
type
privilegedGroupAuthorizer
struct
{
groups
[]
string
groups
[]
string
}
}
...
...
staging/src/k8s.io/apiserver/pkg/authorization/authorizerfactory/
authz
_test.go
→
staging/src/k8s.io/apiserver/pkg/authorization/authorizerfactory/
builtin
_test.go
View file @
4685bd8f
...
@@ -23,8 +23,6 @@ import (
...
@@ -23,8 +23,6 @@ import (
"k8s.io/apiserver/pkg/authorization/authorizer"
"k8s.io/apiserver/pkg/authorization/authorizer"
)
)
// NewAlwaysAllowAuthorizer must return a struct which implements authorizer.Authorizer
// and always return nil.
func
TestNewAlwaysAllowAuthorizer
(
t
*
testing
.
T
)
{
func
TestNewAlwaysAllowAuthorizer
(
t
*
testing
.
T
)
{
aaa
:=
NewAlwaysAllowAuthorizer
()
aaa
:=
NewAlwaysAllowAuthorizer
()
if
decision
,
_
,
_
:=
aaa
.
Authorize
(
nil
);
decision
!=
authorizer
.
DecisionAllow
{
if
decision
,
_
,
_
:=
aaa
.
Authorize
(
nil
);
decision
!=
authorizer
.
DecisionAllow
{
...
@@ -32,8 +30,6 @@ func TestNewAlwaysAllowAuthorizer(t *testing.T) {
...
@@ -32,8 +30,6 @@ func TestNewAlwaysAllowAuthorizer(t *testing.T) {
}
}
}
}
// NewAlwaysDenyAuthorizer must return a struct which implements authorizer.Authorizer
// and always return an error as everything is forbidden.
func
TestNewAlwaysDenyAuthorizer
(
t
*
testing
.
T
)
{
func
TestNewAlwaysDenyAuthorizer
(
t
*
testing
.
T
)
{
ada
:=
NewAlwaysDenyAuthorizer
()
ada
:=
NewAlwaysDenyAuthorizer
()
if
decision
,
_
,
_
:=
ada
.
Authorize
(
nil
);
decision
==
authorizer
.
DecisionAllow
{
if
decision
,
_
,
_
:=
ada
.
Authorize
(
nil
);
decision
==
authorizer
.
DecisionAllow
{
...
...
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