Login: refactor auth info package (#78459)

* Remove unused stats and metrics

* No longer collect metrics

* Remove unused dependency

* Move database from sub package
This commit is contained in:
Karl Persson
2023-11-21 14:47:23 +01:00
committed by GitHub
parent d85f03ec26
commit 1eb19befaa
22 changed files with 116 additions and 402 deletions

View File

@@ -9,8 +9,8 @@ import (
"github.com/grafana/grafana/pkg/services/authn"
"github.com/grafana/grafana/pkg/services/login"
"github.com/grafana/grafana/pkg/services/login/authinfoservice"
"github.com/grafana/grafana/pkg/services/login/logintest"
"github.com/grafana/grafana/pkg/services/login/authinfoimpl"
"github.com/grafana/grafana/pkg/services/login/authinfotest"
"github.com/grafana/grafana/pkg/services/quota"
"github.com/grafana/grafana/pkg/services/quota/quotatest"
"github.com/grafana/grafana/pkg/services/user"
@@ -30,9 +30,9 @@ func ptrInt64(i int64) *int64 {
}
func TestUserSync_SyncUserHook(t *testing.T) {
userProtection := &authinfoservice.OSSUserProtectionImpl{}
userProtection := &authinfoimpl.OSSUserProtectionImpl{}
authFakeNil := &logintest.AuthInfoServiceFake{
authFakeNil := &authinfotest.FakeService{
ExpectedError: user.ErrUserNotFound,
SetAuthInfoFn: func(ctx context.Context, cmd *login.SetAuthInfoCommand) error {
return nil
@@ -41,7 +41,7 @@ func TestUserSync_SyncUserHook(t *testing.T) {
return nil
},
}
authFakeUserID := &logintest.AuthInfoServiceFake{
authFakeUserID := &authinfotest.FakeService{
ExpectedError: nil,
ExpectedUserAuth: &login.UserAuth{
AuthModule: "oauth",