I’m pretty sure this isn’t possible, but figured I’d check anyway…
I’m using the Infinity datasource plugin. We have some somewhat funky auth, where each Grafana user has a JWT stored in a cookie. That cookie is included in all requests the frontend makes to the Grafana backend (including datasource requests). The JWT from that cookie can be used to authenticate requests to an API endpoint I’d like to hit from the Infinity datasource.
I figured I should be able to modify the datasource plugin to (1) read the cookie, (2) grab the JWT, (3) pass the JWT with the API requests. But after a bit of poking around, it seems that there’s no way for the datasource plugin to access any cookies included from the HTTP request. In fact, inspecting QueryDataRequest
(SDK) always shows a completely blank Headers
map regardless of the request headers…I guess this is only populated when OAuth passthrough is enabled?
Anyway, as I said at the start, I guess there’s no way to access the cookie/request headers from within the datasource plugin - but I’d love to be corrected if I’ve missed anything!