diff --git a/pkg/services/supportbundles/supportbundlesimpl/service.go b/pkg/services/supportbundles/supportbundlesimpl/service.go index 97459bc6aae..fae3bfedade 100644 --- a/pkg/services/supportbundles/supportbundlesimpl/service.go +++ b/pkg/services/supportbundles/supportbundlesimpl/service.go @@ -13,11 +13,11 @@ import ( "github.com/grafana/grafana/pkg/infra/usagestats" "github.com/grafana/grafana/pkg/plugins" ac "github.com/grafana/grafana/pkg/services/accesscontrol" + "github.com/grafana/grafana/pkg/services/auth/identity" "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/services/supportbundles" "github.com/grafana/grafana/pkg/services/supportbundles/bundleregistry" - "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" ) @@ -109,7 +109,7 @@ func (s *Service) Run(ctx context.Context) error { return ctx.Err() } -func (s *Service) create(ctx context.Context, collectors []string, usr *user.SignedInUser) (*supportbundles.Bundle, error) { +func (s *Service) create(ctx context.Context, collectors []string, usr identity.Requester) (*supportbundles.Bundle, error) { bundle, err := s.store.Create(ctx, usr) if err != nil { return nil, err diff --git a/pkg/services/supportbundles/supportbundlesimpl/store.go b/pkg/services/supportbundles/supportbundlesimpl/store.go index a7bc17fa742..d437b0d4e1a 100644 --- a/pkg/services/supportbundles/supportbundlesimpl/store.go +++ b/pkg/services/supportbundles/supportbundlesimpl/store.go @@ -15,8 +15,8 @@ import ( "github.com/grafana/grafana/pkg/infra/kvstore" "github.com/grafana/grafana/pkg/infra/log" + "github.com/grafana/grafana/pkg/services/auth/identity" "github.com/grafana/grafana/pkg/services/supportbundles" - "github.com/grafana/grafana/pkg/services/user" ) const ( @@ -41,7 +41,7 @@ type store struct { } type bundleStore interface { - Create(ctx context.Context, usr *user.SignedInUser) (*supportbundles.Bundle, error) + Create(ctx context.Context, usr identity.Requester) (*supportbundles.Bundle, error) Get(ctx context.Context, uid string) (*supportbundles.Bundle, error) StatsCount(ctx context.Context) (int64, error) List() ([]supportbundles.Bundle, error) @@ -49,7 +49,7 @@ type bundleStore interface { Update(ctx context.Context, uid string, state supportbundles.State, tarBytes []byte) error } -func (s *store) Create(ctx context.Context, usr *user.SignedInUser) (*supportbundles.Bundle, error) { +func (s *store) Create(ctx context.Context, usr identity.Requester) (*supportbundles.Bundle, error) { uid, err := uuid.NewRandom() if err != nil { return nil, err @@ -58,7 +58,7 @@ func (s *store) Create(ctx context.Context, usr *user.SignedInUser) (*supportbun bundle := supportbundles.Bundle{ UID: uid.String(), State: supportbundles.StatePending, - Creator: usr.Login, + Creator: usr.GetLogin(), CreatedAt: time.Now().Unix(), ExpiresAt: time.Now().Add(defaultBundleExpiration).Unix(), }