File tree 1 file changed +14
-2
lines changed
pkg/openservicebroker/cmd/server 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,11 @@ import (
7
7
8
8
"github.com/spf13/cobra"
9
9
10
+ "k8s.io/apiserver/pkg/authentication/authenticatorfactory"
10
11
genericapiserver "k8s.io/apiserver/pkg/server"
11
12
genericoptions "k8s.io/apiserver/pkg/server/options"
13
+ authenticationclient "k8s.io/client-go/kubernetes/typed/authentication/v1beta1"
14
+ "k8s.io/client-go/rest"
12
15
13
16
"github.com/openshift/origin/pkg/openservicebroker/server"
14
17
)
@@ -99,11 +102,20 @@ func (o TemplateServiceBrokerServerOptions) Config() (*server.TemplateServiceBro
99
102
//}
100
103
// the TSB server *can* limp along without terminating client certs or front proxy authn. Do that for now
101
104
// this wiring is a bit tricky.
102
- cfg , err := o . Authentication . ToAuthenticationConfig ()
105
+ clientConfig , err := rest . InClusterConfig ()
103
106
if err != nil {
104
107
return nil , err
105
108
}
106
- authenticator , _ , err := cfg .New ()
109
+ client , err := authenticationclient .NewForConfig (clientConfig )
110
+ if err != nil {
111
+ return nil , err
112
+ }
113
+ authenticationConfig := authenticatorfactory.DelegatingAuthenticatorConfig {
114
+ Anonymous : true ,
115
+ TokenAccessReviewClient : client .TokenReviews (),
116
+ CacheTTL : o .Authentication .CacheTTL ,
117
+ }
118
+ authenticator , _ , err := authenticationConfig .New ()
107
119
if err != nil {
108
120
return nil , err
109
121
}
You can’t perform that action at this time.
0 commit comments