mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 16:43:08 +08:00
Replace signed in user for identity.requester (#74048)
* Make identity.Requester available at Context * Clean pkg/services/guardian/guardian.go * Clean guardian provider and guardian AC * Clean pkg/api/team.go * Clean ctxhandler, datasources, plugin and live * Clean dashboards and guardian * Implement NewUserDisplayDTOFromRequester * Change status code numbers for http constants * Upgrade signature of ngalert services * log parsing errors instead of throwing error
This commit is contained in:
@ -11,7 +11,7 @@ import (
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
user "github.com/grafana/grafana/pkg/services/user"
|
||||
identity "github.com/grafana/grafana/pkg/services/auth/identity"
|
||||
)
|
||||
|
||||
// FakeQueryService is an autogenerated mock type for the Service type
|
||||
@ -20,11 +20,11 @@ type FakeQueryService struct {
|
||||
}
|
||||
|
||||
// QueryData provides a mock function with given fields: ctx, _a1, skipDSCache, reqDTO
|
||||
func (_m *FakeQueryService) QueryData(ctx context.Context, _a1 *user.SignedInUser, skipDSCache bool, reqDTO dtos.MetricRequest) (*backend.QueryDataResponse, error) {
|
||||
func (_m *FakeQueryService) QueryData(ctx context.Context, _a1 identity.Requester, skipDSCache bool, reqDTO dtos.MetricRequest) (*backend.QueryDataResponse, error) {
|
||||
ret := _m.Called(ctx, _a1, skipDSCache, reqDTO)
|
||||
|
||||
var r0 *backend.QueryDataResponse
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *user.SignedInUser, bool, dtos.MetricRequest) *backend.QueryDataResponse); ok {
|
||||
if rf, ok := ret.Get(0).(func(context.Context, identity.Requester, bool, dtos.MetricRequest) *backend.QueryDataResponse); ok {
|
||||
r0 = rf(ctx, _a1, skipDSCache, reqDTO)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@ -33,7 +33,7 @@ func (_m *FakeQueryService) QueryData(ctx context.Context, _a1 *user.SignedInUse
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *user.SignedInUser, bool, dtos.MetricRequest) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(context.Context, identity.Requester, bool, dtos.MetricRequest) error); ok {
|
||||
r1 = rf(ctx, _a1, skipDSCache, reqDTO)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
|
Reference in New Issue
Block a user