datasources: querier: log caller (#115087)

This commit is contained in:
Gábor Farkas
2025-12-10 18:23:59 +01:00
committed by GitHub
parent 9e1fe16873
commit a847f36df2
2 changed files with 23 additions and 3 deletions
+10 -1
View File
@@ -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
}