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
83248a97
Commit
83248a97
authored
Mar 19, 2016
by
zhouhaibing089
Committed by
haibzhou
Mar 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move keystone package to password since it is a password authenticator
parent
e2f4141b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
authn.go
pkg/apiserver/authenticator/authn.go
+1
-1
doc.go
plugin/pkg/auth/authenticator/password/keystone/doc.go
+3
-3
keystone.go
plugin/pkg/auth/authenticator/password/keystone/keystone.go
+3
-2
No files found.
pkg/apiserver/authenticator/authn.go
View file @
83248a97
...
@@ -23,9 +23,9 @@ import (
...
@@ -23,9 +23,9 @@ import (
"k8s.io/kubernetes/pkg/auth/authenticator/bearertoken"
"k8s.io/kubernetes/pkg/auth/authenticator/bearertoken"
"k8s.io/kubernetes/pkg/serviceaccount"
"k8s.io/kubernetes/pkg/serviceaccount"
"k8s.io/kubernetes/pkg/util/crypto"
"k8s.io/kubernetes/pkg/util/crypto"
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/password/keystone"
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/password/passwordfile"
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/password/passwordfile"
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/basicauth"
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/basicauth"
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/keystone"
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/union"
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/union"
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/x509"
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/x509"
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/token/oidc"
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/token/oidc"
...
...
plugin/pkg/auth/authenticator/
request
/keystone/doc.go
→
plugin/pkg/auth/authenticator/
password
/keystone/doc.go
View file @
83248a97
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
//
Package keystone provide
authentication via keystone.
//
Package keystone provides
authentication via keystone.
// For details
//
about keystone and how to use the plugin, refer to
// For details about keystone and how to use the plugin, refer to
// https://github.com/kubernetes/kubernetes
/blob/oidc
/docs/admin/authentication.md
// https://github.com/kubernetes/kubernetes
.github.io/blob/master
/docs/admin/authentication.md
package
keystone
package
keystone
plugin/pkg/auth/authenticator/
request
/keystone/keystone.go
→
plugin/pkg/auth/authenticator/
password
/keystone/keystone.go
View file @
83248a97
...
@@ -26,12 +26,13 @@ import (
...
@@ -26,12 +26,13 @@ import (
"k8s.io/kubernetes/pkg/auth/user"
"k8s.io/kubernetes/pkg/auth/user"
)
)
// Keystone
a
uthenticator contacts openstack keystone to validate user's credentials passed in the request.
// Keystone
A
uthenticator contacts openstack keystone to validate user's credentials passed in the request.
// The keystone endpoint is passed during apiserver startup
// The keystone endpoint is passed during apiserver startup
type
KeystoneAuthenticator
struct
{
type
KeystoneAuthenticator
struct
{
authURL
string
authURL
string
}
}
// AuthenticatePassword checks the username, password via keystone call
func
(
keystoneAuthenticator
*
KeystoneAuthenticator
)
AuthenticatePassword
(
username
string
,
password
string
)
(
user
.
Info
,
bool
,
error
)
{
func
(
keystoneAuthenticator
*
KeystoneAuthenticator
)
AuthenticatePassword
(
username
string
,
password
string
)
(
user
.
Info
,
bool
,
error
)
{
opts
:=
gophercloud
.
AuthOptions
{
opts
:=
gophercloud
.
AuthOptions
{
IdentityEndpoint
:
keystoneAuthenticator
.
authURL
,
IdentityEndpoint
:
keystoneAuthenticator
.
authURL
,
...
@@ -48,7 +49,7 @@ func (keystoneAuthenticator *KeystoneAuthenticator) AuthenticatePassword(usernam
...
@@ -48,7 +49,7 @@ func (keystoneAuthenticator *KeystoneAuthenticator) AuthenticatePassword(usernam
return
&
user
.
DefaultInfo
{
Name
:
username
},
true
,
nil
return
&
user
.
DefaultInfo
{
Name
:
username
},
true
,
nil
}
}
// New
returns a request
authenticator that validates credentials using openstack keystone
// New
KeystoneAuthenticator returns a password
authenticator that validates credentials using openstack keystone
func
NewKeystoneAuthenticator
(
authURL
string
)
(
*
KeystoneAuthenticator
,
error
)
{
func
NewKeystoneAuthenticator
(
authURL
string
)
(
*
KeystoneAuthenticator
,
error
)
{
if
!
strings
.
HasPrefix
(
authURL
,
"https"
)
{
if
!
strings
.
HasPrefix
(
authURL
,
"https"
)
{
return
nil
,
errors
.
New
(
"Auth URL should be secure and start with https"
)
return
nil
,
errors
.
New
(
"Auth URL should be secure and start with https"
)
...
...
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