datasources: querier: log caller (#115087)
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
claims "github.com/grafana/authlib/types"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/data"
|
||||
dataapi "github.com/grafana/grafana-plugin-sdk-go/experimental/apis/data/v0alpha1"
|
||||
@@ -180,7 +181,7 @@ func TestQueryAPI(t *testing.T) {
|
||||
legacyDatasourceLookup: &mockLegacyDataSourceLookup{},
|
||||
}
|
||||
|
||||
reqCtx := identity.WithRequester(context.Background(), mockUser{})
|
||||
reqCtx := claims.WithAuthInfo(identity.WithRequester(context.Background(), mockUser{}), &mockAuthInfo{})
|
||||
|
||||
req := httptest.NewRequestWithContext(reqCtx, http.MethodPost, "/some-path", bytes.NewReader([]byte(tc.queryJSON)))
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
@@ -439,3 +440,11 @@ func TestMergeHeaders(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
type mockAuthInfo struct {
|
||||
claims.AuthInfo
|
||||
}
|
||||
|
||||
func (main mockAuthInfo) GetExtra() map[string][]string {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user