AuthN: support sync cache for proxy client (#62874)

* AuthN: Add cache support for auth proxy to skip sync

* AuthN: Change proxy auth hook to be a client hook

* AuthN: fix cache key

* fix test

* lint
This commit is contained in:
Karl Persson
2023-02-06 13:30:05 +01:00
committed by GitHub
parent 791b1001af
commit 9311085e5a
4 changed files with 103 additions and 8 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ import (
"net/http"
"strconv"
"github.com/grafana/grafana/pkg/infra/remotecache"
"github.com/hashicorp/go-multierror"
"go.opentelemetry.io/otel/attribute"
@@ -53,7 +54,7 @@ func ProvideService(
loginAttempts loginattempt.Service, quotaService quota.Service,
authInfoService login.AuthInfoService, renderService rendering.Service,
features *featuremgmt.FeatureManager, oauthTokenService oauthtoken.OAuthTokenService,
socialService social.Service,
socialService social.Service, cache *remotecache.RemoteCache,
) *Service {
s := &Service{
log: log.New("authn.service"),
@@ -104,7 +105,7 @@ func ProvideService(
}
if s.cfg.AuthProxyEnabled && len(proxyClients) > 0 {
proxy, err := clients.ProvideProxy(cfg, proxyClients...)
proxy, err := clients.ProvideProxy(cfg, cache, userService, proxyClients...)
if err != nil {
s.log.Error("failed to configure auth proxy", "err", err)
} else {