Commit Graph

5867 Commits

Author SHA1 Message Date
bergquist 4dc6074e79 provisioning: dont ignore sample yaml files
closes #10963
2018-02-20 08:40:37 +01:00
Carl Bergquist af7ede6ec5 Merge pull request #10959 from grafana/10957_influx_escaping
influxdb: escape backslashes in tag values (for alerting)
2018-02-19 15:28:55 +01:00
Aleksandar Gyorev 89a17a4ace Correct typo in DashboardInputMissingError 2018-02-19 15:44:20 +02:00
Marcus Efraimsson fce1e3f7f1 Merge branch 'master' into 10630_folder_api 2018-02-19 13:32:45 +01:00
Marcus Efraimsson 53cd39fde5 Shouldn't be able to overwrite a dashboard if you don't have permissions (#10900)
* dashboards: new command for validating dashboard before update

Removes validation logic from saveDashboard and later on use the new command for validating
dashboard before saving a dashboard. This due to the fact that we need to validate permissions
for overwriting other dashboards by uid and title.

* dashboards: use the new command for validating dashboard before saving

Had to refactor dashboard provisioning a bit to be able to sidetrack the permission validation
in a somewhat reasonable way.
Adds some initial tests of the dashboard repository, but needs to be extended later. At least
now you can mock the dashboard guardian

* dashboards: removes validation logic in the save dashboard api layer

Use the dashboard repository solely for create/update dashboards and let it do all
the validation. One exception regarding quota validation which still is in api layer
since that logic is in a macaron middleware.
Need to move out-commented api tests later.

* dashboards: fix database tests for validate and saving dashboards

* dashboards: rename dashboard repository to dashboard service

Split the old dashboard repository interface in two new interfaces, IDashboardService and
IDashboardProvisioningService. Makes it more explicit when using it from the provisioning package
and there's no possibility of calling an incorrect method for saving a dashboard.

* database: make the InitTestDB function available to use from other packages

* dashboards: rename ValidateDashboardForUpdateCommand and some refactoring

* dashboards: integration tests of dashboard service

* dashboard: fix sqlstore test due to folder exist validation

* dashboards: move dashboard service integration tests to sqlstore package

Had to move it to the sqlstore package due to concurrency problems when running
against mysql and postgres. Using InitTestDB from two packages added conflicts
when clearing and running migrations on the test database

* dashboards: refactor how to find id to be used for save permission check

* dashboards: remove duplicated dashboard tests

* dashboards: cleanup dashboard service integration tests

* dashboards: handle save dashboard errors and return correct http status

* fix: remove log statement

* dashboards: import dashboard should use dashboard service

Had to move alerting commands to models package due to problems with import cycles of packages.

* dashboards: cleanup dashboard api tests and add some tests for post dashboard

* dashboards: rename dashboard service interfaces

* dashboards: rename dashboard guardian interface
2018-02-19 11:12:56 +01:00
Daniel Lee f959ba9bcf influxdb: escape backslashes in tag values (for alerting)
Closes #10957. Backslash escaping was already implemented on the
frontend but does not work for queries executed on the backend.
2018-02-19 10:02:14 +01:00
Leonard Gram fe357a72d9 login: migration fix. 2018-02-16 17:36:28 +01:00
Leonard Gram 0053be9882 login: uses epochs for login throtting.
Closes #10937
2018-02-16 17:25:46 +01:00
Leonard Gram 1f3442020b alerts: refactoring tests 2018-02-16 14:37:10 +01:00
Leonard Gram c5226a945b alerting: pausing alerts modifies updated.
When pausing an alert the updated field is
modified to the current time.

Closes #10191
2018-02-16 14:24:52 +01:00
Torkel Ödegaard 8af2c9f1f8 test: added integration test for #10941 2018-02-16 14:17:41 +01:00
Torkel Ödegaard 5323971c21 refactoring: alert rule query refactoring (#10941) 2018-02-16 13:56:04 +01:00
bergquist 529fc022d5 db: reduce name column size in dashboard_provisoning
ref #10931
2018-02-16 11:49:17 +01:00
Daniel Lee b9d572bdec teams: adds some validation to the API 2018-02-16 11:46:20 +01:00
bergquist b099f0309f cli: download latest dependency by default 2018-02-16 09:54:37 +01:00
bergquist 5bbe047eaa Revert "removes dependencies install for plugins"
This reverts commit 47e363ea15.
2018-02-16 09:49:29 +01:00
Mitsuhiro Tanda 18c54a9341 support cloudwatch high resolution query 2018-02-15 23:35:01 +09:00
bergquist 651103bdda chore: adds comment for exported function 2018-02-15 15:06:03 +01:00
bergquist 0ab0343995 mark redirect_to cookie as http only
closes #10829
2018-02-15 10:56:29 +01:00
bergquist 8954559cbd dashboard: whitelist allowed chars for uid 2018-02-15 09:56:13 +01:00
Carl Bergquist 243b987758 Merge pull request #10910 from bergquist/provisioning_disable_deleting_dashboards
provisioning: adds setting to disable dashboard deletes
2018-02-15 08:28:10 +01:00
bergquist ad42883fc7 provisioning: adds setting to disable dashboard deletes 2018-02-14 17:30:08 +01:00
bergquist 842f4c1d32 tech: dont print error message on 500 page
closes #10828
2018-02-14 16:39:20 +01:00
bergquist 47e363ea15 removes dependencies install for plugins
this features was never intended for production.
2018-02-14 15:40:42 +01:00
bergquist 56907eef69 tests: makes sure we all migrations are working 2018-02-14 15:30:29 +01:00
Leonard Gram fa1b92a12b provisioning: uses unix epoch timestamps. (#10907)
* provisioning: uses unix epoch timestamps.
2018-02-14 15:28:30 +01:00
Sven Klemm ebbc079853 improve error message for invalid/unknown datatypes (#10834) 2018-02-14 15:21:00 +01:00
Mitsuhiro Tanda 60b30d3e9a add AWS/States Rekognition (#10890)
* added AWS/States

* added Rekognition
2018-02-14 15:14:38 +01:00
Torkel Ödegaard fcaa8227a6 Dashboard acl query fixes (#10909)
* initial fixes for dashboard permission acl list query, fixes #10864

* permissions: refactoring of acl api and query
2018-02-14 15:04:26 +01:00
Torkel Ödegaard 73eaba076e wip: dashboard acl ux2, #10747 2018-02-14 15:03:22 +01:00
Torkel Ödegaard ec6f0f94b8 permissions: refactoring of acl api and query 2018-02-14 14:31:20 +01:00
bergquist 1a041a2250 bug: return correct err message
if the sql query failed has is false and the method will return
m.ErrDataSourceNotFound which is incorrect. We now return the
correct error message from the query

ref #10843
2018-02-14 13:32:52 +01:00
Torkel Ödegaard db89ac4134 initial fixes for dashboard permission acl list query, fixes #10864 2018-02-14 11:50:58 +01:00
bergquist dba087463a provisioing: always skip sample.yaml files 2018-02-14 11:33:58 +01:00
bergquist 165304a342 provisioning: handle nil configs 2018-02-14 11:22:24 +01:00
Carl Bergquist 3091697a2c Merge pull request #10896 from bergquist/provisioning_cfg_camelCase
Change naming format to camelCase for provisioning configs
2018-02-14 11:00:01 +01:00
Torkel Ödegaard 8dd4d505ee Merge branch 'dashboard-search-permissions-filter' 2018-02-14 10:48:55 +01:00
Leonard Gram b60b6690ba sql: removes locale from test to mirror prod. 2018-02-14 10:31:36 +01:00
bergquist fc371af47f adds tests that validate that updated is correct 2018-02-14 10:31:36 +01:00
bergquist 84de76ff0a provisioning: code formating 2018-02-14 10:30:08 +01:00
bergquist 44baaeed8f provisioning: adds logs about deprecated config format 2018-02-14 10:30:08 +01:00
bergquist b010e4df93 provisioning: support camelcase for dashboards configs 2018-02-14 10:30:08 +01:00
bergquist 4a35244cb9 provisioning: support camcelCase provisioning files 2018-02-14 10:30:08 +01:00
Torkel Ödegaard 162439a8d6 fix: removed logging 2018-02-13 17:03:20 +01:00
Torkel Ödegaard e3c3f3ce4c fix: sql search permissions filter fix 2018-02-13 16:49:00 +01:00
Leonard Gram ba0285a3ec provisioning: Warns the user when uid or title is re-used. (#10892)
* provisioning: Warns the user when uid or title is re-used.

Closes #10880
2018-02-13 15:47:02 +01:00
Marcus Efraimsson cb8c82f7f6 Merge branch 'master' into 10630_folder_api 2018-02-12 15:14:41 +01:00
Marcus Efraimsson 2b31465254 Merge branch 'master' into docs_v5.0 2018-02-12 14:29:22 +01:00
Leonard Gram 9a7eb5c327 Merge branch 'master' into provisioning 2018-02-12 14:19:20 +01:00
Marcus Efraimsson 12a6de7461 dashboard: always make sure dashboard exist in dashboard acl http api (#10856) 2018-02-12 09:26:09 +01:00