@@ -18,6 +18,7 @@ import (
18
18
kapierrors "k8s.io/kubernetes/pkg/api/errors"
19
19
"k8s.io/kubernetes/pkg/api/unversioned"
20
20
"k8s.io/kubernetes/pkg/apiserver/request"
21
+ "k8s.io/kubernetes/pkg/auth/authenticator"
21
22
"k8s.io/kubernetes/pkg/auth/group"
22
23
"k8s.io/kubernetes/pkg/client/cache"
23
24
kclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
@@ -35,12 +36,11 @@ import (
35
36
saadmit "k8s.io/kubernetes/plugin/pkg/admission/serviceaccount"
36
37
storageclassdefaultadmission "k8s.io/kubernetes/plugin/pkg/admission/storageclass/default"
37
38
"k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/headerrequest"
39
+ "k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/union"
38
40
39
- "github.com/openshift/origin/pkg/auth/authenticator"
40
41
"github.com/openshift/origin/pkg/auth/authenticator/anonymous"
41
42
"github.com/openshift/origin/pkg/auth/authenticator/request/bearertoken"
42
43
"github.com/openshift/origin/pkg/auth/authenticator/request/paramtoken"
43
- "github.com/openshift/origin/pkg/auth/authenticator/request/unionrequest"
44
44
"github.com/openshift/origin/pkg/auth/authenticator/request/x509request"
45
45
authnregistry "github.com/openshift/origin/pkg/auth/oauth/registry"
46
46
"github.com/openshift/origin/pkg/auth/userregistry/identitymapper"
@@ -648,11 +648,11 @@ func newAuthenticator(config configapi.MasterConfig, restOptionsGetter restoptio
648
648
tokenAuthenticators = append (tokenAuthenticators ,
649
649
// if you have a bearer token, you're a human (usually)
650
650
// if you change this, have a look at the impersonationFilter where we attach groups to the impersonated user
651
- group .NewGroupAdder (unionrequest . NewUnionAuthentication (oauthTokenRequestAuthenticators ... ), []string {bootstrappolicy .AuthenticatedOAuthGroup }))
651
+ group .NewGroupAdder (union . New (oauthTokenRequestAuthenticators ... ), []string {bootstrappolicy .AuthenticatedOAuthGroup }))
652
652
}
653
653
654
654
if len (tokenAuthenticators ) > 0 {
655
- authenticators = append (authenticators , unionrequest . NewUnionAuthentication (tokenAuthenticators ... ))
655
+ authenticators = append (authenticators , union . New (tokenAuthenticators ... ))
656
656
}
657
657
658
658
if configapi .UseTLS (config .ServingInfo .ServingInfo ) {
@@ -665,10 +665,10 @@ func newAuthenticator(config configapi.MasterConfig, restOptionsGetter restoptio
665
665
authenticators = append (authenticators , certauth )
666
666
}
667
667
668
- resultingAuthenticator := & unionrequest. Authenticator { FailOnError : true , Handlers : authenticators }
668
+ resultingAuthenticator := union . NewFailOnError ( authenticators ... )
669
669
670
670
topLevelAuthenticators := []authenticator.Request {}
671
- // if we have a front proxy providing authentication configuration, wire it up and it should come first
671
+ // if we have a front proxy providing authentication configuration, wire it up and it should come first
672
672
if config .AuthConfig .RequestHeader != nil {
673
673
requestHeaderAuthenticator , err := headerrequest .NewSecure (
674
674
config .AuthConfig .RequestHeader .ClientCA ,
@@ -680,10 +680,7 @@ func newAuthenticator(config configapi.MasterConfig, restOptionsGetter restoptio
680
680
if err != nil {
681
681
return nil , fmt .Errorf ("Error building front proxy auth config: %v" , err )
682
682
}
683
- topLevelAuthenticators = append (topLevelAuthenticators , & unionrequest.Authenticator {
684
- FailOnError : false ,
685
- Handlers : []authenticator.Request {requestHeaderAuthenticator , resultingAuthenticator },
686
- })
683
+ topLevelAuthenticators = append (topLevelAuthenticators , union .New (requestHeaderAuthenticator , resultingAuthenticator ))
687
684
688
685
} else {
689
686
topLevelAuthenticators = append (topLevelAuthenticators , resultingAuthenticator )
@@ -692,10 +689,7 @@ func newAuthenticator(config configapi.MasterConfig, restOptionsGetter restoptio
692
689
693
690
topLevelAuthenticators = append (topLevelAuthenticators , anonymous .NewAuthenticator ())
694
691
695
- return group .NewAuthenticatedGroupAdder (& unionrequest.Authenticator {
696
- FailOnError : true ,
697
- Handlers : topLevelAuthenticators ,
698
- }), nil
692
+ return group .NewAuthenticatedGroupAdder (union .NewFailOnError (topLevelAuthenticators ... )), nil
699
693
}
700
694
701
695
func newProjectAuthorizationCache (authorizer authorizer.Authorizer , kubeClient * kclientset.Clientset , informerFactory shared.InformerFactory ) * projectauth.AuthorizationCache {
0 commit comments