79 Commits

Author SHA1 Message Date
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
c0f3b2929c Backend plugins: Refactor to allow shared contract between core and external backend plugins (#25472)
Refactor to allow shared contract between core and external backend plugins 
allowing core backend data sources in Grafana to be implemented in same 
way as an external backend plugin.
Use v0.67.0 of sdk.
Add tests for verifying plugin is restarted when process is killed.
Enable strict linting for backendplugin packages
2020-06-11 16:14:05 +02:00
164242f5fd Data sources: Don't fail if URL doesn't specify protocol (#24497) 2020-05-12 13:04:18 +02:00
80e1191ca0 Backend Plugins: (breaking change) Add PluginContext (#23788)
* breaking change for newer backend plugins
* use exported protobuf converters and sdk types to reduce duplicate code
* uses grafana-plugin-sdk-go@v0.54.0
2020-04-23 14:08:21 -04:00
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
871ad73414 Backend plugins: Renderer v2 plugin (#23625)
grafana-plugin-model is legacy and is replaced by new backend 
plugins SDK and architecture. Renderer is not part of SDK and 
we want to keep it that way for now since it's highly unlikely there 
will be more than one kind of renderer plugin.
So this PR adds support for renderer plugin v2.
Also adds support sending a Device Scale Factor parameter to the 
plugin v2 remote rendering service and by that replaces #22474.
Adds support sending a Headers parameter to the plugin v2 and
remote rendering service which for now only include 
Accect-Language header (the user locale in browser when using 
Grafana), ref grafana/grafana-image-renderer#45.
Fixes health check json details response.
Adds image renderer plugin configuration settings in defaults.ini 
and sample.ini.

Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
2020-04-21 16:16:41 +02:00
e5dd7efdee Provisioning: Allows specifying uid for datasource and use that in derived fields (#23585)
* Add uid to datasource

* Fix uid passing when provisioning

* Better error handling and Uid column type change

* Fix test and strict null error counts

* Add backend tests

* Add tests

* Fix strict null checks

* Update test

* Improve tests

* Update pkg/services/sqlstore/datasource.go

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

* Variable rename

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-04-20 15:48:38 +02:00
579abad9cc Plugins: Return jsondetails as an json object instead of raw json on datasource healthchecks. (#22859) 2020-03-18 12:08:52 +01:00
ebc9549cbc Add support for sending health check to datasource plugins. (#22771)
closes #21519
ref grafana/grafana-plugin-sdk-go#93
2020-03-13 12:31:44 +01:00
5f94d31da9 Send jsondata for Datasources on DatasourceConfig for backend plugins (#22681)
ref https://github.com/grafana/grafana-plugin-sdk-go/pull/84
2020-03-10 15:18:27 +01:00
3fdd2648b1 Chore: Avoid aliasing importing models in api package (#22492) 2020-03-04 12:57:20 +01:00
e6cec8dbdc Backend plugins: Prepare and clean request headers before resource calls (#22321)
Moves common request proxy utilities to proxyutil package with
support for removing X-Forwarded-Host, X-Forwarded-Port,
X-Forwarded-Proto headers, setting X-Forwarded-For header
and cleaning Cookie header.
Using the proxyutil package to prepare and clean request
headers before resource calls.

Closes #21512
2020-03-03 11:45:16 +01:00
9d7c74ef91 Backend Plugins: Provide proper plugin config to plugins (#21985)
Properly provides plugin configs to backend plugins.
Uses v0.16.0 of grafana-plugin-sdk-go-

Ref #21512
Ref #19667
2020-02-19 19:17:05 +01:00
0390b5601e Backend plugins: Implement support for resources (#21805)
Implements initial support for resources using v0.14.0 of SDK.

Ref #21512
2020-01-31 11:15:50 +01:00
b5f0a5d5ca Api: Readonly datasources should not be created via the API (#19006)
* Readonly datasources should not be created via the API

* Return correct `ReadOnly` value in GetDataSourceByName
2019-09-17 12:29:43 +03:00
3245227016 permissions: cleanup. 2018-10-17 15:58:52 +02:00
1329c70965 codestyle 2018-10-16 14:22:50 +02:00
ec9ed5c830 Removes unused code. 2018-10-11 13:52:23 +02:00
ccfcf02e33 Refactors ds permissions to a filter. 2018-10-10 14:25:57 +02:00
162a95bff9 wip: going in circles 2018-10-01 19:31:03 +02:00
b3c78f1265 wip: data source permissions hooks 2018-10-01 15:38:55 +02:00
eb1b9405b2 return proper payload from api when updating datasource 2018-08-07 17:56:02 +02:00
defb0396b7 Return a 404 when deleting a datasource through the API if it doesn't exist and add a test for it to confirm #12313 2018-06-22 21:15:36 -05:00
0a415c50d0 Make golint happier 2018-03-22 22:38:44 +01:00
7aab6a8887 Make golint happier 2018-03-22 12:40:21 +01:00
c0ecdee375 rename Context to ReqContext 2018-03-07 11:54:50 -05:00
338655dd37 move Context and session out of middleware 2018-03-06 18:16:49 -05:00
909601d6ab api: fix so that datasources functions returns Response 2017-11-16 16:29:05 +01:00
36676e23c1 datasource as cfg: adds readonly datasources 2017-11-15 14:30:32 +01:00
d68bfaa8be datasource as cfg: typo 2017-10-25 12:21:06 +02:00
89923bf77a datasources: change to optimisic concurrency
prerequisite for #9504
2017-10-23 07:55:16 +02:00
4ce0bf4d16 mysql: improved mysql data source, added test feature when adding data source, fixed cache issue 2017-05-11 10:50:24 +02:00
aee4af2148 api: omit unused fields for /api/datasources
Fixes #7822
2017-04-25 15:23:36 +02:00
193d468ed3 admin: adds paging to global user list
Currently there is a limit of 1000 users in the global
user list. This change introduces paging so that an
admin can see all users and not just the first 1000.

Adds a new route to the api - /api/users/search that
returns a list of users and a total count. It takes
two parameters perpage and page that enable paging.

Fixes #7469
2017-02-13 12:59:36 +01:00
143cbe921f (feat) support datasource delete by name api 2017-02-10 23:30:14 +09:00
13c4ce68ee Added name and id in response of create/update (#7016) 2016-12-20 13:02:26 +01:00
330c1b945e refactor(datasource): refactoring datasource secure json fields handling, #6697, #6692 2016-12-14 21:06:10 +01:00
8ee85626f2 fix(api): return correct json info after updating datasource
closes #6869
2016-12-07 18:09:17 +01:00
2c7adccf12 Use cache for http.client in tsdb package. (#6833)
* datasource: move caching closer to datasource struct

* tsdb: use cached version of datasource http transport

closes #6825
2016-12-07 11:10:42 +01:00
7bc1c3cc1c feat(cloudwatch): make it possible to reset keys
closes #6697
2016-11-24 16:37:33 +01:00
2893b25a05 feat(datasources): allow updating of tls certs
The tls files are stored as a json blob in the
SecureJsonData field. To update one file, the
json has to be fetched from the db first and
then updated with the cert file that has been
changed.

Also, a change to the dto with flags that are
used in the frontend to show if a file has
been uploaded. For example, if tlsClientKeySet
is set to true then means a file for the
client key is saved in the db. This is to
avoid sending any private data to the frontend.
2016-11-24 13:22:25 +01:00
c9b2c694f1 refactor(dataproxy): TLS Client Auth
Use a SecureJsonData field for TLS
Client Auth instead of 3 new db
fields. Same model as used for
PluginSettings.

Saves and encrypts the pem file
content rather than just saving
the paths to the cert and key.
This allows for uploading from
the Edit Datasource page in
Grafana.
2016-11-24 13:22:25 +01:00
56b7e2dfaf Added support for TLS client auth for datasource proxies (#5801) 2016-11-24 13:22:25 +01:00
a6918617ff feat(api): fixed minor issue with error message when trying to create duplicate datasource, fixes #6164 2016-10-01 16:41:27 +02:00
1955defc43 fix(api): add missing jsonData field to dto
The field is available on the dto so I guess is should be used.
Otherwise we should remove the field rather then not setting it.

ref #5944
2016-09-01 17:21:13 +02:00
34e17f7282 feat(alerting): requests looks to be working again 2016-06-06 17:11:46 +02:00
b7d198793f refactor(): minor refactoring of #4455 2016-03-23 15:09:48 +01:00
b2fe7e518f ux(): added specific fallback logos for plugin depending on type, polished layout selector style 2016-03-17 10:15:16 +01:00
e4c0c39fbf ux(): began work on updating data source list to cards view 2016-03-15 20:29:35 +01:00
4fbff99186 Implemented GetDataSourceIdByName API 2016-03-10 01:31:10 -08:00