Skip to content

Commit

Permalink
Revert "disable TSB client cert and front proxy auth until aggregatio…
Browse files Browse the repository at this point in the history
…n is on by default"

This reverts commit a564e15.
  • Loading branch information
deads2k committed Oct 4, 2017
1 parent 879725b commit 7b09621
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions pkg/templateservicebroker/cmd/server/start.go
Expand Up @@ -11,11 +11,8 @@ import (
"k8s.io/apimachinery/pkg/apimachinery/registered"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apiserver/pkg/authentication/authenticatorfactory"
genericapiserver "k8s.io/apiserver/pkg/server"
genericoptions "k8s.io/apiserver/pkg/server/options"
authenticationclient "k8s.io/client-go/kubernetes/typed/authentication/v1beta1"
"k8s.io/client-go/rest"
"k8s.io/kubernetes/pkg/kubectl/cmd/util"

"io/ioutil"
Expand Down Expand Up @@ -128,32 +125,9 @@ func (o TemplateServiceBrokerServerOptions) Config() (*server.TemplateServiceBro
if err := o.SecureServing.ApplyTo(serverConfig); err != nil {
return nil, err
}

// TODO restore this after https://github.com/openshift/openshift-ansible/issues/5056 is fixed
//if err := o.Authentication.ApplyTo(serverConfig); err != nil {
// return nil, err
//}
// the TSB server *can* limp along without terminating client certs or front proxy authn. Do that for now
// this wiring is a bit tricky.
clientConfig, err := rest.InClusterConfig()
if err != nil {
return nil, err
}
client, err := authenticationclient.NewForConfig(clientConfig)
if err != nil {
if err := o.Authentication.ApplyTo(serverConfig); err != nil {
return nil, err
}
authenticationConfig := authenticatorfactory.DelegatingAuthenticatorConfig{
Anonymous: true,
TokenAccessReviewClient: client.TokenReviews(),
CacheTTL: o.Authentication.CacheTTL,
}
authenticator, _, err := authenticationConfig.New()
if err != nil {
return nil, err
}
serverConfig.Authenticator = authenticator

if err := o.Authorization.ApplyTo(serverConfig); err != nil {
return nil, err
}
Expand Down

0 comments on commit 7b09621

Please sign in to comment.