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
64d61185
Commit
64d61185
authored
Jun 16, 2015
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-enable ECDSA private server key use
parent
43889c61
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
server.go
cmd/kube-apiserver/app/server.go
+4
-0
authn.go
pkg/apiserver/authn.go
+6
-0
No files found.
cmd/kube-apiserver/app/server.go
View file @
64d61185
...
@@ -321,7 +321,11 @@ func (s *APIServer) Run(_ []string) error {
...
@@ -321,7 +321,11 @@ func (s *APIServer) Run(_ []string) error {
// Default to the private server key for service account token signing
// Default to the private server key for service account token signing
if
s
.
ServiceAccountKeyFile
==
""
&&
s
.
TLSPrivateKeyFile
!=
""
{
if
s
.
ServiceAccountKeyFile
==
""
&&
s
.
TLSPrivateKeyFile
!=
""
{
if
apiserver
.
IsValidServiceAccountKeyFile
(
s
.
TLSPrivateKeyFile
)
{
s
.
ServiceAccountKeyFile
=
s
.
TLSPrivateKeyFile
s
.
ServiceAccountKeyFile
=
s
.
TLSPrivateKeyFile
}
else
{
glog
.
Warning
(
"no RSA key provided, service account token authentication disabled"
)
}
}
}
authenticator
,
err
:=
apiserver
.
NewAuthenticator
(
s
.
BasicAuthFile
,
s
.
ClientCAFile
,
s
.
TokenAuthFile
,
s
.
ServiceAccountKeyFile
,
s
.
ServiceAccountLookup
,
helper
)
authenticator
,
err
:=
apiserver
.
NewAuthenticator
(
s
.
BasicAuthFile
,
s
.
ClientCAFile
,
s
.
TokenAuthFile
,
s
.
ServiceAccountKeyFile
,
s
.
ServiceAccountLookup
,
helper
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
pkg/apiserver/authn.go
View file @
64d61185
...
@@ -77,6 +77,12 @@ func NewAuthenticator(basicAuthFile, clientCAFile, tokenFile, serviceAccountKeyF
...
@@ -77,6 +77,12 @@ func NewAuthenticator(basicAuthFile, clientCAFile, tokenFile, serviceAccountKeyF
}
}
}
}
// IsValidServiceAccountKeyFile returns true if a valid public RSA key can be read from the given file
func
IsValidServiceAccountKeyFile
(
file
string
)
bool
{
_
,
err
:=
serviceaccount
.
ReadPublicKey
(
file
)
return
err
==
nil
}
// newAuthenticatorFromBasicAuthFile returns an authenticator.Request or an error
// newAuthenticatorFromBasicAuthFile returns an authenticator.Request or an error
func
newAuthenticatorFromBasicAuthFile
(
basicAuthFile
string
)
(
authenticator
.
Request
,
error
)
{
func
newAuthenticatorFromBasicAuthFile
(
basicAuthFile
string
)
(
authenticator
.
Request
,
error
)
{
basicAuthenticator
,
err
:=
passwordfile
.
NewCSV
(
basicAuthFile
)
basicAuthenticator
,
err
:=
passwordfile
.
NewCSV
(
basicAuthFile
)
...
...
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