Commit Graph

1317 Commits

Author SHA1 Message Date
ryan 71ef9b6db5 Merge remote-tracking branch 'grafana/master' into annotations-created
* grafana/master: (26 commits)
  notes about closing #11306
  cleanup
  changelog: unix socket permissions
  Adjust permissions of unix socket
  docs: tweaks
  changelog: adds note about closing #5855
  legend: small refactoring
  Make golint happier
  mysql: skip tests by default
  mssql: update query editor help
  mysql: fix precision for the time column in table/annotation query mode
  postgres: fix precision for the time column in table/annotation query mode
  mssql: fix precision for the time column in table/annotation query mode
  mssql: remove UTC conversion in macro functions
  mssql: fix timeGroup macro so that it properly creates correct groups
  small screen legend right also work like legend under in render + set scrollbar to undefined in destroyScrollbar so it doesnt become disabled when toggeling between right and under
  fixed so legend right works like legend under on small screens
  Alerting: move getNewState to EvalContext
  graphite: adds more traces for alerting
  sql datasource: extract common logic for converting time column to epoch time in ms
  ...
2018-03-24 11:39:35 +01:00
Carl Bergquist 980e078222 Merge pull request #11326 from bergquist/more_traces
dataproxy: adds dashboardid and panelid as tags
2018-03-23 17:13:15 +01:00
Julian Kornberger 6f363153d7 Adjust permissions of unix socket
fixes #8358
2018-03-23 16:09:04 +01:00
ryan 7defb1adf5 remove dashboardId check... i can't figure out how the tests work 2018-03-23 12:54:53 +01:00
ryan e92ea79524 get circle to run tests again 2018-03-23 12:48:03 +01:00
ryan 2116152295 add dashboardId to test 2018-03-23 12:35:39 +01:00
ryan a58b4ff2d6 remove api tests 2018-03-23 12:13:38 +01:00
ryan b39fb7fdd5 fix operator 2018-03-23 12:01:21 +01:00
ryan db92a96067 move dashboard error to API (not sql) 2018-03-23 11:36:44 +01:00
Julian Kornberger 0a415c50d0 Make golint happier 2018-03-22 22:38:44 +01:00
ryan 20353db966 convert epoch to milliseconds 2018-03-22 16:21:47 +01:00
ryan a2bbd89a9e adding updated column 2018-03-22 15:52:09 +01:00
ryan df94b380f4 Merge remote-tracking branch 'grafana/master' into annotations-created
* grafana/master:
  Make golint happier
2018-03-22 14:59:14 +01:00
Julian Kornberger 7aab6a8887 Make golint happier 2018-03-22 12:40:21 +01:00
ryan 3898ea02e6 adding created column 2018-03-22 02:22:58 +01:00
bergquist f142548969 dataproxy: adds dashboardid and panelid as tags
closes #11315
2018-03-20 22:23:28 +01:00
Daniel Lee 1cef373d16 Merge remote-tracking branch 'upstream/master' into update-xorm 2018-03-20 19:21:58 +01:00
Daniel Lee 3ca1e06509 session: fork Macaron mysql session middleware
This changes forks the mysql part of the Macaron session middleware.

In the forked mysql file:

- takes in a config setting for SetConnMaxLifetime (this solves wait_timeout
problem if it is set to a shorter interval than wait_timeout)
- removes the panic when an error is returned in the Exist function.
- retries the exist query once
- retries the GC query once
2018-03-16 01:19:28 +01:00
Mitja Zivkovic 5669596518 add regex search of username and password in urls, which are replaced by strings.Replace 2018-03-15 10:50:57 +01:00
Marcus Efraimsson 5fbfd67b94 dashboards: should be possible to browse dashboard using only uid
That is, the slug part of url should be optional.
Closes #11231
2018-03-13 21:06:25 +01:00
Daniel Lee 3f2c086e6f teams: removes quota on route
Got added by mistake a year ago.
2018-03-13 10:56:35 +01:00
Mitsuhiro Tanda a83ede0193 support POST for query and query_range 2018-03-12 13:25:05 +09:00
Dan Cech bbd6adabbf move quota to dedicated service 2018-03-07 17:19:35 -05: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
bergquist 5934521137 fixes invalid link to profile pic when gravatar is disabled
closes #11097
2018-03-06 11:46:50 +01:00
Marcus Efraimsson 3d4e99d8be Merge pull request #11040 from grafana/permission-checks
Add permission check for dashboard diff api route
2018-02-28 18:23:39 +01:00
Daniel Lee ecf438f8d0 dashboard: add permission check for diff api route
ref #10770
2018-02-27 17:53:30 +01:00
Marcus Efraimsson f76b98d252 dashboards: change dashboard/folder permission error messages 2018-02-27 16:04:45 +01:00
Marcus Efraimsson 03f8eff880 dashboards: handle new guardian error responses and update tests
Using a mocked guardian instead and relies on the actual guardian tests for verifying
permission handling correctness
2018-02-27 16:04:45 +01:00
Marcus Efraimsson 3c14cecd50 folders: handle new guardian error responses and add tests 2018-02-27 16:04:45 +01:00
Daniel Lee 3b836c9c5f Merge pull request #10996 from grafana/snapshot_permissions
Snapshot fixes and changes to snapshot list
2018-02-23 09:17:59 +01:00
Marcus Efraimsson 3f3175972e dashboards: fix batch dashboard/folder delete response
Use message returned from backend and use that as alert success response to user
2018-02-21 16:38:09 +01:00
Daniel Lee 7d9a9fa29c snapshots: change to snapshot list query
Admins can see all snapshots. Other roles can only see their own
snapshots.

Added permission check for deleting snapshots - admins can delete
any snapshot, other roles can delete their own snapshots or
snapshots that they have access to via dashboard permissions.
2018-02-21 13:39:08 +01:00
Marcus Efraimsson 9889c92083 fix typos in api, acl to permissions 2018-02-21 11:50:32 +01:00
Marcus Efraimsson 3df8ae2306 folders: rename folder_acl in api to folder_permission 2018-02-21 11:45:19 +01:00
Marcus Efraimsson d68099bc4a dashboards: change api route for dashboard permissions
From /api/dashboards/id/:id/acl to /api/dashboards/id/:id/permissions
2018-02-21 11:42:54 +01:00
Marcus Efraimsson a167e19b37 folders: folder api tests 2018-02-21 11:24:54 +01:00
Marcus Efraimsson 417541c77f folders: folder permissions api tests 2018-02-20 18:11:50 +01:00
Marcus Efraimsson 892bdecb19 folders: folder permission api routes 2018-02-20 15:25:16 +01:00
Marcus Efraimsson 717d8d0c45 folders: fix api error mapping 2018-02-20 15:01:20 +01:00
Marcus Efraimsson ea7998ca8e folders: use new folder service in folder api routes 2018-02-20 13:57:32 +01: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
Torkel Ödegaard 5323971c21 refactoring: alert rule query refactoring (#10941) 2018-02-16 13:56:04 +01:00
Daniel Lee b9d572bdec teams: adds some validation to the API 2018-02-16 11:46:20 +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 8dd4d505ee Merge branch 'dashboard-search-permissions-filter' 2018-02-14 10:48:55 +01:00
Marcus Efraimsson cb8c82f7f6 Merge branch 'master' into 10630_folder_api 2018-02-12 15:14:41 +01:00
Leonard Gram 9a7eb5c327 Merge branch 'master' into provisioning 2018-02-12 14:19:20 +01:00