mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
Merge pull request #29796 from deads2k/token-review
Automatic merge from submit-queue Token review endpoint Unrevert of #28788, which was rolled back because of https://github.com/kubernetes/kubernetes/issues/29375 @cjcullen @wojtek-t I'd like to remerge if possible. Have we gotten the field checking mentioned here relaxed? https://github.com/kubernetes/kubernetes/pull/28788#discussion_r71918442
This commit is contained in:
@@ -22,14 +22,14 @@ import (
|
||||
"time"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1"
|
||||
"k8s.io/kubernetes/pkg/apis/authentication/v1beta1"
|
||||
"k8s.io/kubernetes/pkg/auth/authenticator"
|
||||
"k8s.io/kubernetes/pkg/auth/user"
|
||||
"k8s.io/kubernetes/pkg/client/restclient"
|
||||
"k8s.io/kubernetes/pkg/util/cache"
|
||||
"k8s.io/kubernetes/plugin/pkg/webhook"
|
||||
|
||||
_ "k8s.io/kubernetes/pkg/apis/authentication.k8s.io/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/authentication/install"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -30,7 +30,7 @@ import (
|
||||
"time"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/authentication.k8s.io/v1beta1"
|
||||
"k8s.io/kubernetes/pkg/apis/authentication/v1beta1"
|
||||
"k8s.io/kubernetes/pkg/auth/user"
|
||||
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/v1"
|
||||
)
|
||||
@@ -353,10 +353,21 @@ func TestWebhookTokenAuthenticator(t *testing.T) {
|
||||
|
||||
type authenticationUserInfo v1beta1.UserInfo
|
||||
|
||||
func (a *authenticationUserInfo) GetName() string { return a.Username }
|
||||
func (a *authenticationUserInfo) GetUID() string { return a.UID }
|
||||
func (a *authenticationUserInfo) GetGroups() []string { return a.Groups }
|
||||
func (a *authenticationUserInfo) GetExtra() map[string][]string { return a.Extra }
|
||||
func (a *authenticationUserInfo) GetName() string { return a.Username }
|
||||
func (a *authenticationUserInfo) GetUID() string { return a.UID }
|
||||
func (a *authenticationUserInfo) GetGroups() []string { return a.Groups }
|
||||
|
||||
func (a *authenticationUserInfo) GetExtra() map[string][]string {
|
||||
if a.Extra == nil {
|
||||
return nil
|
||||
}
|
||||
ret := map[string][]string{}
|
||||
for k, v := range a.Extra {
|
||||
ret[k] = []string(v)
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
// Ensure v1beta1.UserInfo contains the fields necessary to implement the
|
||||
// user.Info interface.
|
||||
|
||||
Reference in New Issue
Block a user