grafana/pkg/services/oauthtoken
Marcus Efraimsson 6dbe3b555f
Plugins: Refactor forward of cookies, OAuth token and header modifications by introducing client middlewares (#58132)
Adding support for backend plugin client middlewares. This allows headers in outgoing 
backend plugin and HTTP requests to be modified using client middlewares.

The following client middlewares added:
Forward cookies: Will forward incoming HTTP request Cookies to outgoing plugins.Client 
and HTTP requests if the datasource has enabled forwarding of cookies (keepCookies).
Forward OAuth token: Will set OAuth token headers on outgoing plugins.Client and HTTP 
requests if the datasource has enabled Forward OAuth Identity (oauthPassThru).
Clear auth headers: Will clear any outgoing HTTP headers that was part of the incoming 
HTTP request and used when authenticating to Grafana.
The current suggested way to register client middlewares is to have a separate package, 
pluginsintegration, responsible for bootstrap/instantiate the backend plugin client with 
middlewares and/or longer term bootstrap/instantiate plugin management. 

Fixes #54135
Related to #47734
Related to #57870
Related to #41623
Related to #57065
2022-12-01 19:08:36 +01:00
..
oauthtokentest Plugins: Refactor forward of cookies, OAuth token and header modifications by introducing client middlewares (#58132) 2022-12-01 19:08:36 +01:00
oauth_token_test.go Auth: Display id Provider label in orgs/users view (#58033) 2022-11-29 15:20:28 +01:00
oauth_token.go Plugins: Refactor forward of cookies, OAuth token and header modifications by introducing client middlewares (#58132) 2022-12-01 19:08:36 +01:00