[v9.4.x] Authn: Anon session service (#63520)

* Authn: Anon session service (#63052)

* add anon sessions package

* add usage stat fn

* implement count for cache

* add anonservice to authn broker

* lint

* add tests for remote cache count

* move anon service to services

* wrap tagging in goroutine

* make func used

(cherry picked from commit ff78103a24)

* add local cache to protect multiple writes to DB cache

(cherry picked from commit bdb084736b)
This commit is contained in:
Jo
2023-02-22 08:55:17 +00:00
committed by GitHub
parent 98489d5f81
commit 92ac380621
23 changed files with 594 additions and 278 deletions
+1
View File
@@ -213,6 +213,7 @@ var wireBasicSet = wire.NewSet(
wire.Bind(new(correlations.Service), new(*correlations.CorrelationsService)),
quotaimpl.ProvideService,
remotecache.ProvideService,
wire.Bind(new(remotecache.CacheStorage), new(*remotecache.RemoteCache)),
loginservice.ProvideService,
wire.Bind(new(login.Service), new(*loginservice.Implementation)),
authinfoservice.ProvideAuthInfoService,
+4
View File
@@ -13,6 +13,8 @@ import (
"github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/accesscontrol/acimpl"
"github.com/grafana/grafana/pkg/services/accesscontrol/ossaccesscontrol"
"github.com/grafana/grafana/pkg/services/anonymous"
"github.com/grafana/grafana/pkg/services/anonymous/anonimpl"
"github.com/grafana/grafana/pkg/services/auth"
"github.com/grafana/grafana/pkg/services/auth/authimpl"
"github.com/grafana/grafana/pkg/services/datasources"
@@ -41,6 +43,8 @@ var wireExtsBasicSet = wire.NewSet(
authimpl.ProvideUserAuthTokenService,
wire.Bind(new(auth.UserTokenService), new(*authimpl.UserAuthTokenService)),
wire.Bind(new(auth.UserTokenBackgroundService), new(*authimpl.UserAuthTokenService)),
anonimpl.ProvideAnonymousSessionService,
wire.Bind(new(anonymous.Service), new(*anonimpl.AnonSessionService)),
licensing.ProvideService,
wire.Bind(new(licensing.Licensing), new(*licensing.OSSLicensingService)),
setting.ProvideProvider,