FeatureToggle: for storing signed in user object in a Remote Cache (#59883)

* FeatureToggle: for storing sessions in a Remote Cache

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Fix conflicting modifications :D

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* rename the flag to userRemoteCache

* undo unintended change

* Users: Add option to use remote cache for SignedInUsers (#59892)

* Add remote cache to GetSignedInUserWithCacheCtx

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Populate SignedInUser remote cache

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Line

* minor fixes to make this work

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Fix tests

* change flag to updated name

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>
This commit is contained in:
Gabriel MABILLE
2022-12-07 08:58:15 +01:00
committed by GitHub
co-authored by ievaVasiljeva
parent 3c86bf550e
commit 91b15eed1a
7 changed files with 48 additions and 4 deletions
+6
View File
@@ -362,6 +362,7 @@ func TestGetOrgUsersAPIEndpoint_AccessControlMetadata(t *testing.T) {
hs.userService = userimpl.ProvideService(
hs.SQLStore, nil, nil, nil, nil,
nil, nil, nil, nil, nil, hs.SQLStore.(*sqlstore.SQLStore),
nil, featuremgmt.WithFeatures(),
)
hs.orgService = orgimpl.ProvideService(hs.SQLStore, cfg)
})
@@ -467,6 +468,7 @@ func TestGetOrgUsersAPIEndpoint_AccessControl(t *testing.T) {
hs.userService = userimpl.ProvideService(
hs.SQLStore, nil, nil, nil, nil,
nil, nil, nil, nil, nil, hs.SQLStore.(*sqlstore.SQLStore),
nil, featuremgmt.WithFeatures(),
)
hs.orgService = orgimpl.ProvideService(hs.SQLStore, cfg)
})
@@ -573,6 +575,7 @@ func TestPostOrgUsersAPIEndpoint_AccessControl(t *testing.T) {
hs.userService = userimpl.ProvideService(
hs.SQLStore, nil, nil, nil, nil,
nil, nil, nil, nil, nil, hs.SQLStore.(*sqlstore.SQLStore),
nil, featuremgmt.WithFeatures(),
)
})
setupOrgUsersDBForAccessControlTests(t, sc.db)
@@ -699,6 +702,7 @@ func TestOrgUsersAPIEndpointWithSetPerms_AccessControl(t *testing.T) {
hs.userService = userimpl.ProvideService(
hs.SQLStore, nil, nil, nil, nil,
nil, nil, nil, nil, nil, hs.SQLStore.(*sqlstore.SQLStore),
nil, featuremgmt.WithFeatures(),
)
})
setInitCtxSignedInViewer(sc.initCtx)
@@ -818,6 +822,7 @@ func TestPatchOrgUsersAPIEndpoint_AccessControl(t *testing.T) {
hs.userService = userimpl.ProvideService(
hs.SQLStore, nil, nil, nil, nil,
nil, nil, nil, nil, nil, hs.SQLStore.(*sqlstore.SQLStore),
nil, featuremgmt.WithFeatures(),
)
hs.orgService = orgimpl.ProvideService(hs.SQLStore, cfg)
})
@@ -946,6 +951,7 @@ func TestDeleteOrgUsersAPIEndpoint_AccessControl(t *testing.T) {
hs.userService = userimpl.ProvideService(
hs.SQLStore, nil, nil, nil, nil,
nil, nil, nil, nil, nil, hs.SQLStore.(*sqlstore.SQLStore),
nil, featuremgmt.WithFeatures(),
)
})
setupOrgUsersDBForAccessControlTests(t, sc.db)