Zanzana: Setup GRPC authentication in client/server mode (#98680)

* Zanzana: Setup GRPC authentication in client/server mode

* don't use grpcutils

* refactor

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

* Add a namespace stub for in-proc mode

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

* Read parameters from config

* authorize server requests

* add namespace to the tests context

* use stack id from config

* simplify authorize func

* properly format namespace

* return Unauthenticated if namespace is empty

* use insecure cred only in dev env

* check request namespace

* Use CallCredentials API for client auth

* provide config

* fail if stack id is missing

* improve error message

* use insecure connection by default

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
This commit is contained in:
Alexander Zobnin
2025-01-13 10:02:15 +01:00
committed by GitHub
co-authored by Karl Persson
parent 8f79a59e1f
commit 5922015fec
13 changed files with 210 additions and 58 deletions
+11
View File
@@ -37,6 +37,13 @@ type ZanzanaSettings struct {
// Use streamed version of list objects.
// Returns full list of objects, but takes more time.
UseStreamedListObjects bool
// Token used to perform the exchange request.
Token string
// URL called to perform exchange request.
TokenExchangeURL string
// URL for signing keys
SigningKeysURL string
}
func (cfg *Cfg) readZanzanaSettings() {
@@ -63,5 +70,9 @@ func (cfg *Cfg) readZanzanaSettings() {
s.ListObjectsMaxResults = uint32(sec.Key("list_objects_max_results").MustUint(1000))
s.UseStreamedListObjects = sec.Key("use_streamed_list_objects").MustBool(false)
s.Token = sec.Key("token").MustString("")
s.TokenExchangeURL = sec.Key("token_exchange_url").MustString("")
s.SigningKeysURL = sec.Key("signing_keys_url").MustString("")
cfg.Zanzana = s
}