Skip to content

Commit 1dd74d3

Browse files
csweichelroboquat
authored andcommitted
[baseserver] Incorporate review feedback
1 parent d2384ea commit 1dd74d3

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

components/common-go/baseserver/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (s *ServerConfiguration) GetAddress() string {
2727
}
2828

2929
type TLSConfiguration struct {
30-
CA string `json:"ca" yaml:"ca"`
31-
Cert string `json:"cert" yaml:"cert"`
32-
Key string `json:"key" yaml:"key"`
30+
CAPath string `json:"caPath" yaml:"caPath"`
31+
CertPath string `json:"certPath" yaml:"certPath"`
32+
KeyPath string `json:"keyPath" yaml:"keyPath"`
3333
}

components/common-go/baseserver/options.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ type options struct {
2424
// closeTimeout is the amount we allow for the server to shut down cleanly
2525
closeTimeout time.Duration
2626

27-
noBuiltinServices bool
28-
underTest bool
27+
underTest bool
2928

3029
// metricsRegistry configures the metrics registry to use for exporting metrics. When not set, the default prometheus registry is used.
3130
metricsRegistry *prometheus.Registry
@@ -62,13 +61,6 @@ func WithConfig(config *Configuration) Option {
6261
}
6362
}
6463

65-
func WithoutBuiltinServices() Option {
66-
return func(opts *options) error {
67-
opts.noBuiltinServices = true
68-
return nil
69-
}
70-
}
71-
7264
func WithUnderTest() Option {
7365
return func(opts *options) error {
7466
opts.underTest = true

components/common-go/baseserver/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func serveHTTP(cfg *ServerConfiguration, srv *http.Server, l net.Listener) (err
9393
if cfg.TLS == nil {
9494
err = srv.Serve(l)
9595
} else {
96-
err = srv.ServeTLS(l, cfg.TLS.Cert, cfg.TLS.Key)
96+
err = srv.ServeTLS(l, cfg.TLS.CertPath, cfg.TLS.KeyPath)
9797
}
9898
return
9999
}
@@ -272,7 +272,7 @@ func (s *Server) initializeGRPC() error {
272272
opts := common_grpc.ServerOptionsWithInterceptors(stream, unary)
273273
if cfg := s.options.config.Services.GRPC; cfg != nil && cfg.TLS != nil {
274274
tlsConfig, err := common_grpc.ClientAuthTLSConfig(
275-
cfg.TLS.CA, cfg.TLS.Cert, cfg.TLS.Key,
275+
cfg.TLS.CAPath, cfg.TLS.CertPath, cfg.TLS.KeyPath,
276276
common_grpc.WithSetClientCAs(true),
277277
common_grpc.WithServerName(s.Name),
278278
)

0 commit comments

Comments
 (0)