feat: data source proxy refactoring and route handling, #9078

This commit is contained in:
Torkel Ödegaard
2017-08-22 17:14:15 +02:00
parent 5c2958023d
commit 63d6ab476a
7 changed files with 416 additions and 194 deletions
+31
View File
@@ -0,0 +1,31 @@
{
"type": "datasource",
"name": "Test Datasource",
"id": "test-ds",
"routes": [
{
"path": "api/v5/",
"method": "*",
"url": "https://grafana-api.kentik.com/api/v5",
"tokenAuth": {
"url": "https://login.microsoftonline.com/{{.JsonData.tenantId}}/oauth2/token",
"body": {
"grant_type": "client_credentials",
"client_id": "{{.JsonData.clientId}}",
"client_secret": "{{.SecureJsonData.clientSecret}}",
"resource": "https://management.azure.com/"
}
}
},
{
"path": "api/v4/",
"method": "*",
"url": "http://localhost:3333",
"headers": [
{"name": "X-CH-Auth-API-Token", "content": "test {{.SecureJsonData.token}}"},
{"name": "X-CH-Auth-Email", "content": "test {{.JsonData.email}}"}
]
}
]
}