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
a6677d6f
Unverified
Commit
a6677d6f
authored
Mar 19, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Mar 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #73409 from yue9944882/bugfix/compatible-with-nil-authorizer
Fixes authz compatibility w/ nil authorizer in apiserver
parents
86f6279b
24861741
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
config.go
staging/src/k8s.io/apiserver/pkg/server/config.go
+11
-2
No files found.
staging/src/k8s.io/apiserver/pkg/server/config.go
View file @
a6677d6f
...
...
@@ -614,9 +614,18 @@ func (s *SecureServingInfo) HostPort() (string, int, error) {
}
// AuthorizeClientBearerToken wraps the authenticator and authorizer in loopback authentication logic
// if the loopback client config is specified AND it has a bearer token.
// if the loopback client config is specified AND it has a bearer token. Note that if either authn or
// authz is nil, this function won't add a token authenticator or authorizer.
func
AuthorizeClientBearerToken
(
loopback
*
restclient
.
Config
,
authn
*
AuthenticationInfo
,
authz
*
AuthorizationInfo
)
{
if
loopback
==
nil
||
authn
==
nil
||
authz
==
nil
||
authn
.
Authenticator
==
nil
&&
authz
.
Authorizer
==
nil
||
len
(
loopback
.
BearerToken
)
==
0
{
if
loopback
==
nil
||
len
(
loopback
.
BearerToken
)
==
0
{
return
}
if
authn
==
nil
||
authz
==
nil
{
// prevent nil pointer panic
}
if
authn
.
Authenticator
==
nil
||
authz
.
Authorizer
==
nil
{
// authenticator or authorizer might be nil if we want to bypass authz/authn
// and we also do nothing in this case.
return
}
...
...
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