Chore: use remote cache instead of session storage (#16114)
Replaces session storage in auth_proxy middleware with remote cache Fixes #15161
This commit is contained in:
@@ -7,12 +7,10 @@ import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
|
||||
"github.com/grafana/grafana/pkg/log"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
||||
|
||||
"github.com/grafana/grafana/pkg/registry"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/bmizerany/assert"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package remotecache
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
// NewFakeStore creates store for testing
|
||||
func NewFakeStore(t *testing.T) *RemoteCache {
|
||||
t.Helper()
|
||||
|
||||
opts := &setting.RemoteCacheOptions{
|
||||
Name: "database",
|
||||
ConnStr: "",
|
||||
}
|
||||
|
||||
SQLStore := sqlstore.InitTestDB(t)
|
||||
|
||||
dc := &RemoteCache{
|
||||
SQLStore: SQLStore,
|
||||
Cfg: &setting.Cfg{
|
||||
RemoteCacheOptions: opts,
|
||||
},
|
||||
}
|
||||
|
||||
err := dc.Init()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to init remote cache for test. error: %v", err)
|
||||
}
|
||||
|
||||
return dc
|
||||
}
|
||||
Reference in New Issue
Block a user