37 Commits

Author SHA1 Message Date
a6b2e1865c Datasource: Improve default timeout settings for HTTP client provider (#36621)
Make sure that default timeout settings are based on configuration
parameters. This now applies for core data sources using old TSDB
contracts and new SDK contracts. Before it was only applied for old TSDB
contracts.
Also moves global setting variables to non-global (setting.Cfg).
2021-07-15 14:30:06 +02:00
89ba607382 AzureMonitor: strongly-typed AzureCredentials and correct resolution of auth type and cloud (#36284) 2021-07-05 12:20:12 +02:00
52e38c54e5 AzureMonitor: token provider into aztokenprovider and cleanup (#36102) 2021-06-29 10:05:42 +02:00
6b786e7f68 Avoid log entry if not set for debug (#35741) 2021-06-15 15:03:24 +02:00
7109285ac9 AzureMonitor: Use auth middleware for QueryData requests (#35343) 2021-06-11 17:02:24 +02:00
81f6c806e1 Azure token provider with support for Managed Identities (#33807)
* Azure token provider

* Configuration for Azure token provider

* Authentication via Azure SDK for Go

* Fix typo

* ConcurrentTokenCache for Azure credentials

* Resolve AAD authority for selected Azure cloud

* Fixes

* Generic AccessToken and fixes

* Tests and wordings

* Tests for getAccessToken

* Tests for getClientSecretCredential

* Tests for token cache
2021-05-14 13:59:07 +02:00
1790737cf1 Plugins: AuthType in route configuration and params interpolation (#33674)
* AuthType in route configuration

* Pass interpolated auth parameters to token provider

* Unit tests

* Update after review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

Fixes #33669
Closed #33732
2021-05-06 22:05:23 +02:00
19f520d891 PluginProxy: Split implementations of token providers (#32820)
* Split implementations of token providers

* Fix imports

* Fix code racing in unit tests
2021-05-03 13:46:32 +01:00
aad43869c3 Plugins: Support set body content in plugin routes (#32551)
Adds support for overriding the body and length in plugin routes.
2021-03-31 16:38:35 +02:00
b79e61656a Introduce TSDB service (#31520)
* Introduce TSDB service

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-03-08 07:02:49 +01:00
967e9b39e8 Fix panic when using complex dynamic URLs in app plugin routes (#27977)
* remove unused function to interpolate URLs

* share function to add headers between ds/plugin proxies

* stop performing unnecessary plugin setting lookup

* fix bug causing runtime errors when using complex templated URLs

* lower case util functions not used outside of pluginproxy package

* change test URL to a (valid) dummy URL to make intent clearer

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-17 10:56:42 +01:00
cb62e69997 Chore: Convert API tests to standard Go lib (#29009)
* Chore: Convert tests to standard Go lib

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2020-11-13 09:52:38 +01:00
a5d9196a53 Chore/fix lint issues (#27704)
* Chore: Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-09-22 16:22:19 +02:00
564d7ecea7 DataProxy: Ignore empty URL's in plugin routes (#27653)
This adds a check to see if plugin route URL is empty, and in such case 
does not modify request schema and host of the request to be proxied.
This behavior is now the same as in the plugin proxy.
2020-09-18 13:22:07 +02:00
52154b465b dsproxy: adds support for url params for plugin routes (#23503)
* dsproxy: adds support for url params for plugin routes

* docs: fixes after review

* pluginproxy: rename Params to URLParams

* Update pkg/plugins/app_plugin.go

Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>

* pluginproxy: rename struct

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-04-24 10:32:13 +02:00
3fdd2648b1 Chore: Avoid aliasing importing models in api package (#22492) 2020-03-04 12:57:20 +01:00
b07d0b1026 Plugins: Support templated urls in routes (#16599)
This adds support for using templated/dynamic urls in routes.
* refactor interpolateString into utils and add interpolation support for app plugin routes.
* cleanup and add error check for url parse failure
* add docs for interpolated route urls

Closes #16835
2019-05-07 18:55:39 +02:00
8261613b51 pkg/util/{ip.go,url.go}: Fix some golint issues
See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=golint  ./...
ip.go:8:6⚠️ func SplitIpPort should be SplitIPPort (golint)
url.go:14:6⚠️ func NewUrlQueryReader should be NewURLQueryReader (golint)
url.go:9:6⚠️ type UrlQueryReader should be URLQueryReader (golint)
url.go:37:6⚠️ func JoinUrlFragments should be JoinURLFragments (golint)
2019-01-28 22:29:20 +01:00
0cafd9a663 dataproxy: Override incoming Authorization header 2018-11-30 12:12:55 -07:00
b02a8127ff stackdriver: remove debug comments 2018-10-22 16:11:17 +02:00
afe0b4b8db stackdriver: fix typo 2018-10-22 16:11:17 +02:00
b2c6c743ce stackdriver: add debug logging 2018-10-22 16:11:17 +02:00
cd7b454e25 stackdriver: add default value for authentication type 2018-10-22 16:03:14 +02:00
823838a839 stackdriver: wip - remove debug code 2018-10-22 16:03:14 +02:00
2b1709b875 stackdriver: only get default token from metadata server when applying route 2018-10-22 16:03:13 +02:00
ff5f281508 stackdriver: wip - get metric descriptors in the backend 2018-10-22 16:03:13 +02:00
60617d0bf7 stackdriver: wip - add logic for retrieving token from gce metadata server in the auth provider 2018-10-22 16:03:13 +02:00
3f9ed2efaa stackdriver: wip - temp remove jwt token auth 2018-10-22 16:03:12 +02:00
b2de0d8c3e stackdriver: wip - always use gce default account for stackdriver 2018-10-22 16:03:12 +02:00
2002162073 stackdriver: wip - add scope and remove debug code 2018-10-22 16:03:12 +02:00
df215d9d09 stackdriver: WIP - test retrieving project id from gce metadata 2018-10-22 16:03:12 +02:00
fbe0ffd10b skip jwt token auth if privateKey is empty 2018-10-22 16:03:12 +02:00
43aa6603a3 fetch token from GCE metadata server 2018-10-22 16:03:12 +02:00
6db0880fd8 invalidate access token cache after datasource is updated 2018-09-21 14:24:44 +02:00
56e8e50497 Stackdriver: Use ds_auth_provider in stackdriver. This will make sure the token is renewed when it has exporired 2018-09-14 09:38:16 +02:00
05f6710454 stackdriver: fix test 2018-09-14 09:38:16 +02:00
1725940ab9 Stackdriver: Add new file 2018-09-14 09:38:16 +02:00