diff --git a/pkg/services/authz/zanzana.go b/pkg/services/authz/zanzana.go index 21199b502cb..3be1b18dc1d 100644 --- a/pkg/services/authz/zanzana.go +++ b/pkg/services/authz/zanzana.go @@ -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 { diff --git a/pkg/setting/settings_zanzana.go b/pkg/setting/settings_zanzana.go index be7121f3b0d..1a06ea034ef 100644 --- a/pkg/setting/settings_zanzana.go +++ b/pkg/setting/settings_zanzana.go @@ -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{}