Commit Graph

712 Commits

Author SHA1 Message Date
Torkel Ödegaard e949eb3f58 Merge branch 'master' into dashboard-search-permissions-filter 2018-02-09 15:16:34 +01:00
Marcus Efraimsson a86f2fa34b user picker should only include users from current org (#10845) 2018-02-09 10:42:37 +01:00
Marcus Efraimsson 8921b0b517 db test: allow use of env variable for database engine to run tests for 2018-02-08 19:16:45 +01:00
Torkel Ödegaard 8e8f3c4332 dashboard and folder search with permissions 2018-02-08 17:11:01 +01:00
Marcus Efraimsson 0e8377a9f4 Update logic for create/update dashboard, validation and plugin dashboard links (#10809)
* enables overwrite if dashboard allready exist in folder

* dashboard: Don't allow creating a folder named General

* dashboards: update logic for save/update dashboard

No id and uid creates a new dashboard/folder.
No id and uid, with an existing title in folder allows overwrite
  of dashboard.
Id without uid, allows update of existing dashboard/folder without
  overwrite.
Uid without id allows update of existing dashboard/folder without
  overwrite.
Id without uid, with an existing title in folder allows overwrite
  of dashboard/folder and updated will have the uid of overwritten.
Uid without id, with an existing title in folder allows overwrite
  of dashboard/folder and new will have the same uid as provided.
Trying to change an existing folder to a dashboard yields error.
Trying to change an existing dashboard to a folder yields error.

* dashboards: include folder id when confirmed to save with overwrite

* dashboards: fixes due to new url structure

Return importedUrl property in response to importing dashboards and
getting plugin dashboards and use this for redirects/links in the
frontend.
2018-02-08 12:48:38 +01:00
Torkel Ödegaard b84fd3a7ae fix: initial fix for #10822 2018-02-07 17:54:21 +01:00
Daniel Lee db1423eebc dashfolders: fixes #10820 2018-02-07 15:13:34 +01:00
Torkel Ödegaard cf7be5da0b fix: changed dashboard title length to match slug length, will fix mysql index size issue, fixes #10779 2018-02-06 11:03:37 +01:00
Daniel Lee 2d1bd270fb Stale permissions (#10768)
* dashfolders: hide permissions in settings if folder has changed

and the dashboard has not been saved yet. Otherwise the use will
see stale permissions from the original folder.

* dashfolders: return folder url for inherited permissions
2018-02-05 14:28:24 +01:00
Carl Bergquist 04a94ce396 adds unique index for org_id+folder_id+title on dashboards (#10766) 2018-02-05 14:11:19 +01:00
Marcus Efraimsson a879dd8c0c dashboards: render correct link for folder when searching for dashboards (#10763)
Fixes #10761
2018-02-05 13:23:24 +01:00
Carl Bergquist cc0cc8dd73 changes to new urlformat for home dashboard (#10738) 2018-02-05 10:24:48 +01:00
Marcus Efraimsson cd61d2b237 Merge branch 'master' into 7883_new_url_structure 2018-02-01 17:32:43 +01:00
Marcus Efraimsson 744f402a96 db: fix failing integration tests for mysql and postgresql 2018-02-01 17:27:29 +01:00
bergquist 90207bcb7d register handler for get dashboards by slug 2018-02-01 14:17:14 +01:00
bergquist 992fd37010 alert: use new url format 2018-02-01 14:08:51 +01:00
Marcus Efraimsson ef90b3e49c Merge branch '7883_new_url_structure' into 7883_frontend_step2 2018-02-01 11:08:39 +01:00
Marcus Efraimsson b135df9a6c Merge remote-tracking branch 'upstream/master' into 7883_new_url_structure 2018-02-01 10:48:06 +01:00
Carl Bergquist eff687bece
Merge pull request #10694 from grafana/7883_backend
backend for new url structure.
2018-02-01 09:35:00 +01:00
Marcus Efraimsson 90933b0621 dashboard: refactor logic for retrieving url for folder/dashboard 2018-01-31 23:14:48 +01:00
Marcus Efraimsson 035b724725 dashboards: remove slug property in dashboard search responses
Removes slug property in dashboard search responses since this property isn't needed
anymore and it haven't been released to any stable release.
2018-01-31 18:40:54 +01:00
Marcus Efraimsson 92a0171a9b folders: change the front end route for browsing folders
Change the front end route for folders to /dashboards/f/<uid>/<slug of folder title>.
Use new route for deleting dashboard/folder by uid.
Retrieve dashboard/folder by uid when moving or deleting dashboards/folders.
2018-01-31 18:40:54 +01:00
Marcus Efraimsson b23560ed5a dashboards: add validation to delete dashboard by slug
Validates that there are only one folder/dashboard having that slug,
otherwise returns 412 Precondition Failed
2018-01-31 18:40:54 +01:00
bergquist 58cfb23625 retry uid generation 2018-01-31 17:29:17 +01:00
Daniel Lee 7e2e57c306 dashfolders: fixes #10671. Allow Editors default access to Root.
Editors should be able to create dashboards in root and should be
able to create folders. They cannot administrate permissions though
and these dashboards and folders will get the default permissions.
2018-01-31 16:43:21 +01:00
bergquist 16a1642831 gofmt... 2018-01-31 15:15:15 +01:00
bergquist 3da2ab61e0 Verifies requirement of id in dashboards. 2018-01-31 14:36:14 +01:00
bergquist 7e96052594 ensure dashboard title is unique in folder 2018-01-31 14:18:54 +01:00
bergquist bb3183f6cd removes uniqnes check on slug when saving dashboards 2018-01-31 10:29:52 +01:00
bergquist 6d2a555866 Drops unique index orgid_slug from dashboards. 2018-01-31 10:26:06 +01:00
Daniel Lee eb765d288c alertlist: disable pause button when user does not have permission 2018-01-30 23:35:27 +01:00
Marcus Efraimsson 9fb7b887db dashboards: add url property to dashboard meta and search api responses
#7883
2018-01-30 23:18:34 +01:00
Marcus Efraimsson 13d5db7d19 dashboards: add support for retrieving a dashboard by uid
Introduces new url in api /dashboards/<uid> for fetching dashboard by unique id
Leave the old dashboard by slug url /dashboards/db/<slug> for backward
compatibility and for supporting fallback
WIP for #7883
2018-01-30 23:18:34 +01:00
Marcus Efraimsson c1cff3849e dashboard: change unique index for uid to include org_id
Make the max length of uid longer in case we want to change it later
#7883
2018-01-30 23:18:34 +01:00
Marcus Efraimsson fc7bab8bf0 dashboard: fix failing test. #7883 2018-01-30 23:18:34 +01:00
Marcus Efraimsson 5b35c694dc dashboard: generate and include uid in dashboard model. #7883 2018-01-30 23:18:34 +01:00
Marcus Efraimsson 025a14ec24 db: add migrations for creating a unique index for uid. #7883 2018-01-30 23:18:34 +01:00
Marcus Efraimsson 50aa9ec69c db: add migrations for generating uid for existing dashboards. #7883 2018-01-30 23:18:34 +01:00
Marcus Efraimsson 401b01e1e6 db: add new column uid to the dashboard table. #7883 2018-01-30 23:18:34 +01:00
Daniel Lee f5107d5023 alerting: add permission check in api for pausing alerts 2018-01-30 14:41:25 +01:00
Daniel Lee 0fb05bcf59 Merge remote-tracking branch 'upstream/master' into dashboard_permissions 2018-01-30 09:26:23 +01:00
Marcus Efraimsson 3d1c624c12 WIP: Protect against brute force (frequent) login attempts (#10031)
* db: add login attempt migrations

* db: add possibility to create login attempts

* db: add possibility to retrieve login attempt count per username

* auth: validation and update of login attempts for invalid credentials

If login attempt count for user authenticating is 5 or more the last 5 minutes
we temporarily block the user access to login

* db: add possibility to delete expired login attempts

* cleanup: Delete login attempts older than 10 minutes

The cleanup job are running continuously and triggering each 10 minute

* fix typo: rename consequent to consequent

* auth: enable login attempt validation for ldap logins

* auth: disable login attempts validation by configuration

Setting is named DisableLoginAttemptsValidation and is false by default
Config disable_login_attempts_validation is placed under security section
#7616

* auth: don't run cleanup of login attempts if feature is disabled

#7616

* auth: rename settings.go to ldap_settings.go

* auth: refactor AuthenticateUser

Extract grafana login, ldap login and login attemp validation together
with their tests to separate files.
Enables testing of many more aspects when authenticating a user.
#7616

* auth: rename login attempt validation to brute force login protection

Setting DisableLoginAttemptsValidation => DisableBruteForceLoginProtection
Configuration disable_login_attempts_validation => disable_brute_force_login_protection
#7616
2018-01-26 10:41:41 +01:00
Daniel Lee bc5fae5367 dashfolders: merge conflict 2018-01-25 14:54:50 +01:00
Marcus Efraimsson d36fd66dba dashfolder: fix for sqlite test 2018-01-24 11:43:08 +01:00
Daniel Lee 9d2a667e8b dashfolder: fix for mysql test 2018-01-24 11:19:26 +01:00
bergquist ee973a977b stats: send amount of stars as stats 2018-01-23 22:51:05 +01:00
bergquist ea988a37dd tech: avoid using deprecated functions 2018-01-23 22:30:45 +01:00
bergquist 5a1cf2c793 style: minor code style changes 2018-01-23 22:28:47 +01:00
Daniel Lee 94a54248c1 dashfolders: show folders use can save to in picker
Instead of returning all folders a user has some sort of access to,
this change creates a new end point that returns folders the user
has write access to. This new endpoint is used in the folder picker
2018-01-20 01:58:28 +01:00
Daniel Lee 3ae1bf0c16 dashfolders: permissions for saving annotations
ref #10275 Use folder permissions instead of hard coded
permissions on the annotations routes.
2018-01-09 14:44:36 +01:00