Backed plugin missing headers

I’m rewriting an plugin to use backend, to support alarts.
In my old plugin depend on oauthPassThru to grab data as the user that request the report.
I get I can not do that for alarms, but i still want that feature for “web users”.
But I can not find it. req.Headers is always nil inside QueryData

func (td *MyDatasource) QueryData(ctx context.Context, 
req *backend.QueryDataRequest) (r *backend.QueryDataResponse, err error) {
}

Is req.headers not the correct way to read them or am i doing something else wrong ?
go version go1.15.5 windows/amd64
Grafana: v7.3.5 ( to ensure https://github.com/isaozler/grafana/pull/3/commits is embeded )
github.com/grafana/grafana-plugin-sdk-go v0.80.0

Does noone have any information about this ?
I tried using the example created using

npx @grafana/toolkit plugin:create

added oauthPassThru to MyDataSourceOptions in types.ts
and added a FormField to ConfigEditor.tsx with a change event to save the value of true
and yet, req.Headers is STILL nill in QueryData in sample-plugin.go

And after way to much recoding the addon in different versions of plugin API’s, I ended up going tough some of the latest release tags to see when 27055 was implemented, just to realise it has NOT been. It’s scheduled for 7.4.0
So compiling that and running with that, made everything work.

1 Like