Arve Knudsen
41d432b5ae
Chore: Enable whitespace linter ( #25903 )
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-06 20:17:28 +02:00
Arve Knudsen
3651a8e976
Chore: Disable scopelint for tests ( #25923 )
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-30 11:05:47 +02:00
Arve Knudsen
d1e6214a4a
Chore: Enable scopelint Go linter ( #25896 )
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-29 17:04:38 +02:00
Arve Knudsen
d352c213b3
API: Recognize MSSQL data source URLs ( #25629 )
...
* API: Recognize MSSQL URLs
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
* Move MSSQL URL validation into mssql package
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-17 11:17:11 +02:00
Arve Knudsen
164242f5fd
Data sources: Don't fail if URL doesn't specify protocol ( #24497 )
2020-05-12 13:04:18 +02:00
Mario Trangoni
5116420e9a
Fix misspell issues ( #23905 )
...
* Fix misspell issues
See,
$ golangci-lint run --timeout 10m --disable-all -E misspell ./...
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
* Fix codespell issues
See,
$ codespell -S './.git*' -L 'uint,thru,pres,unknwon,serie,referer,uptodate,durationm'
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
* ci please?
* non-empty commit - ci?
* Trigger build
Co-authored-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
2020-04-29 21:37:21 +02:00
Daniel Lee
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
Arve Knudsen
7d88018531
DataSourceProxy: Handle URL parsing error ( #23731 )
...
* pluginproxy: Handle URL parsing error
* pkg/api: Validate data source URLs
* pkg/api: Return 400 for URL validation error
2020-04-22 10:30:06 +02:00
Carl Bergquist
3fdd2648b1
Chore: Avoid aliasing importing models in api package ( #22492 )
2020-03-04 12:57:20 +01:00
Marcus Efraimsson
3fc5f4552a
CloudWatch: Fix high CPU load ( #20579 )
...
* Cache decrypted securejsondata
* Models: Add datasource cache tests
2019-11-22 14:21:23 +01:00
Weeco
8cd93f0b88
Datasource: Add custom headers on alerting queries ( #19508 )
...
* Add custom headers on alerting queries
Reference issue #15381
Signed-off-by: Martin Schneppenheim <martin.schneppenheim@rewe-digital.com>
* Fix datasource transport tests
* Migrate decrypting header test to models pkg
* Check correct header
* Add HTTP transport test
Fixes #15381
2019-10-11 14:28:52 +02:00
Arve Knudsen
0a2d5e16dd
pkg/api: Check errors ( #19657 )
...
* pkg/api: Check errors
* pkg/api: Remove unused function HashEmail
2019-10-08 18:57:53 +02:00
Oleg Gaidarenko
caa1314f44
Build: use golangci-lint as a make command ( #17739 )
...
* Build: use golangci-lint as a make command
* Since gometalinter was deprecated in favor of golangci-lint so it was
replaced by it. Responsibilities held by the gometalinter was moved to
golangci-lint
* There was some changes in implementation (that was also mentioned in
the code comment) between the tools, which uncovered couple errors
in the code. Those issues were either solved or disabled by
the inline comments
* Introduce the golangci-lint config, to make their
configuration more manageable
* Build: replace backend-lint.sh script with make
2019-07-02 16:06:59 +03:00
zhulongcheng
2fff8f77dc
move log package to /infra ( #17023 )
...
ref #14679
Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
2019-05-13 08:45:54 +02:00
Marcus Efraimsson
e210725d3d
DataProxy: Restore Set-Cookie header after proxy request ( #16838 )
...
If Grafana rotates the user's auth token during a request to the data
source proxy it will set the Set-Cookie header with new auth token in
response before proxying the request to the datasource.
Before this fix the Set-Cookie response header was cleared after the
proxied request was finished to make sure that proxied datasources
cannot affect cookies in users browsers. This had the consequence
of accidentally also clearing the new auth token set in Set-Cookie
header.
With this fix the original Set-Cookie value in response header is now
restored after the proxied datasource request is finished. The existing
logic of clearing Set-Cookie response header from proxied request
have been left intact.
Fixes #16757
2019-05-01 16:32:03 +02:00
Andrej Ocenas
66f6e16916
Security: Store datasource passwords encrypted in secureJsonData ( #16175 )
...
* Store passwords in secureJsonData
* Revert unnecessary refactors
* Fix for nil jsonSecureData value
* Remove copied encryption code from migration
* Fix wrong field reference
* Remove migration and provisioning changes
* Use password getters in datasource proxy
* Refactor password handling in datasource configs
* Add provisioning warnings
* Update documentation
* Remove migration command, moved to separate PR
* Remove unused code
* Set the upgrade version
* Remove unused code
* Remove double reference
2019-04-15 11:11:17 +02:00
Sean Lafferty
3f9a19dcd5
Merge branch 'master' into 12556-oauth-pass-thru
2019-03-14 13:18:00 -04:00
Andrej Ocenas
697a87b7b2
Add check so that header is not sent for anonymous users
2019-03-14 16:33:21 +01:00
Andrej Ocenas
bbdc1c0e64
Add custom header with grafana user and a config switch for it
2019-03-14 16:33:19 +01:00
Sean Lafferty
fcc18d8121
Change import path for social in the tests
2019-03-13 14:55:22 -04:00
Sean Lafferty
4324a7f51a
Remove auth module from ds_proxy oauth test
2019-03-13 13:28:49 -04:00
Sean Lafferty
5a59cdf0ef
Add oauth pass-thru option for datasources
2019-02-01 19:40:57 -05:00
Julien Pivotto
62417ca69f
Remove Origin and Referer headers while proxying requests
...
Fix #13949
Fix #13328
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2018-11-08 14:57:47 +01:00
Marcus Efraimsson
2b1e4d001a
Merge pull request #13326 from ryantxu/proxy-slash
...
Keep trailing slash for datasource proxy requests
2018-10-04 14:38:34 +02:00
Marcus Efraimsson
8bf4d68035
add datasource proxy test to verify trailing slashes are forwarded
2018-10-03 12:28:30 +02:00
Ryan McKinley
7c6227c061
remove the test that does not do anything
2018-09-18 11:18:55 -07:00
Ryan McKinley
71dfeff782
add a test
2018-09-17 12:28:36 -07:00
Erik Sundell
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
Erik Sundell
db170845b0
Stackdriver: Restructured ds proxy tests
2018-09-14 09:38:16 +02:00
Erik Sundell
6a610558c4
Stackdriver: Start breaking out apply route to its own file
2018-09-14 09:38:16 +02:00
Daniel Lee
c75e071213
dsproxy: interpolate route url
...
Allows for dynamic urls for plugin routes. There are a few plugins
where the route url should be configurable and this change allows
using jsonData fields in the url field for a route in the
plugin.json file for a plugin.
2018-08-18 16:02:49 +02:00
Marcus Efraimsson
13921902b5
Set User-Agent header in all proxied datasource requests
...
Header value will be Grafana/%version%, i.e. Grafana/5.3.0
2018-08-15 09:46:59 +02:00
Torkel Ödegaard
4f704cec53
fix: ds_proxy test not initiating header
2018-08-14 09:18:23 +02:00
Carl Bergquist
828fb39ee2
Merge pull request #11643 from mrsiano/generic_oauth
...
Pass configured/auth headers to a Datasource.
2018-06-21 14:21:59 +02:00
mrsiano
cc1e3a0e3c
Pass configured/auth headers to a Datasource.
...
In some setups (ex openshift), the Datasource will require Grafana
to pass oauth token as header when sending queries.
Also, this PR allow to send any header which is something
Grafana currently does not support.
2018-06-21 14:58:05 +03:00
Daniel Lee
10d30f0b73
dsproxy: move http client variable back
...
After refactoring to be able to mock the client in
a test, the client wasn't a global variable anymore.
This change moves the client back to being a package-
level variable.
2018-06-14 13:39:46 +02:00
Daniel Lee
719ebdc24d
dsproxy: allow multiple access tokens per datasource
...
Changes the cache key for tokens to cache on datasource id +
route path + http method instead of just datasource id.
2018-06-12 17:39:38 +02:00
Julian Kornberger
0a415c50d0
Make golint happier
2018-03-22 22:38:44 +01:00
Dan Cech
c0ecdee375
rename Context to ReqContext
2018-03-07 11:54:50 -05:00
Dan Cech
338655dd37
move Context and session out of middleware
2018-03-06 18:16:49 -05:00
Robin Gustafsson
cf7a49977f
proxyds: delete cookies except those listed in keepCookies
2017-12-14 11:46:44 +01:00
Daniel Lee
f1aa7dcd52
proxyds: failing test for keepCookies
...
If the cookies are specified in the keepCookies property then they
should not be deleted from proxied requests for data sources
2017-12-14 11:46:44 +01:00
Torkel Ödegaard
71c9582944
data source with token auth is starting to work, #9078
2017-08-24 11:07:37 +02:00
Torkel Ödegaard
3c9798bec9
datasource-proxy: token exchange
2017-08-23 17:18:43 +02:00
Torkel Ödegaard
8bf49c51b9
dataproxy: refactoring data source proxy to support route templates and wrote more tests for data proxy code, #9078
2017-08-23 10:52:31 +02:00
Torkel Ödegaard
63d6ab476a
feat: data source proxy refactoring and route handling, #9078
2017-08-22 17:14:15 +02:00