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
4bfd42bb
Commit
4bfd42bb
authored
Mar 24, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #23240 from zhouhaibing089/keystone_fix
Auto commit by PR queue bot
parents
dae5ac48
83248a97
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 @
4bfd42bb
...
...
@@ -23,9 +23,9 @@ import (
"k8s.io/kubernetes/pkg/auth/authenticator/bearertoken"
"k8s.io/kubernetes/pkg/serviceaccount"
"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/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/x509"
"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 @
4bfd42bb
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//
Package keystone provide
authentication via keystone.
// For details
//
about keystone and how to use the plugin, refer to
// https://github.com/kubernetes/kubernetes
/blob/oidc
/docs/admin/authentication.md
//
Package keystone provides
authentication via keystone.
// For details about keystone and how to use the plugin, refer to
// https://github.com/kubernetes/kubernetes
.github.io/blob/master
/docs/admin/authentication.md
package
keystone
plugin/pkg/auth/authenticator/
request
/keystone/keystone.go
→
plugin/pkg/auth/authenticator/
password
/keystone/keystone.go
View file @
4bfd42bb
...
...
@@ -26,12 +26,13 @@ import (
"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
type
KeystoneAuthenticator
struct
{
authURL
string
}
// AuthenticatePassword checks the username, password via keystone call
func
(
keystoneAuthenticator
*
KeystoneAuthenticator
)
AuthenticatePassword
(
username
string
,
password
string
)
(
user
.
Info
,
bool
,
error
)
{
opts
:=
gophercloud
.
AuthOptions
{
IdentityEndpoint
:
keystoneAuthenticator
.
authURL
,
...
...
@@ -48,7 +49,7 @@ func (keystoneAuthenticator *KeystoneAuthenticator) AuthenticatePassword(usernam
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
)
{
if
!
strings
.
HasPrefix
(
authURL
,
"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