Zanzana: Fix namespace in remote client (#113433)
This commit is contained in:
@@ -110,7 +110,7 @@ func ProvideStandaloneZanzanaClient(cfg *setting.Cfg, features featuremgmt.Featu
|
||||
ServerCertFile: cfg.ZanzanaClient.ServerCertFile,
|
||||
}
|
||||
|
||||
return NewRemoteZanzanaClient(fmt.Sprintf("stacks-%s", cfg.StackID), zanzanaConfig)
|
||||
return NewRemoteZanzanaClient(cfg.ZanzanaClient.TokenNamespace, zanzanaConfig)
|
||||
}
|
||||
|
||||
type ZanzanaClientConfig struct {
|
||||
|
||||
@@ -27,6 +27,8 @@ type ZanzanaClientSettings struct {
|
||||
// URL called to perform exchange request.
|
||||
// Only used when mode is set to client.
|
||||
TokenExchangeURL string
|
||||
// Namespace to use for the token.
|
||||
TokenNamespace string
|
||||
}
|
||||
|
||||
type ZanzanaServerSettings struct {
|
||||
@@ -113,6 +115,10 @@ func (cfg *Cfg) readZanzanaSettings() {
|
||||
zc.Addr = clientSec.Key("address").MustString("")
|
||||
zc.ServerCertFile = clientSec.Key("tls_cert").MustString("")
|
||||
|
||||
// TODO: read Token and TokenExchangeURL from grpc_client_authentication section
|
||||
grpcClientAuthSection := cfg.SectionWithEnvOverrides("grpc_client_authentication")
|
||||
zc.TokenNamespace = grpcClientAuthSection.Key("token_namespace").MustString("stacks-" + cfg.StackID)
|
||||
|
||||
cfg.ZanzanaClient = zc
|
||||
|
||||
zs := ZanzanaServerSettings{}
|
||||
|
||||
Reference in New Issue
Block a user