1264 Commits

Author SHA1 Message Date
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
8dd4d505ee Merge branch 'dashboard-search-permissions-filter' 2018-02-14 10:48:55 +01:00
9a7eb5c327 Merge branch 'master' into provisioning 2018-02-12 14:19:20 +01:00
12a6de7461 dashboard: always make sure dashboard exist in dashboard acl http api (#10856) 2018-02-12 09:26:09 +01:00
e1e0b5f951 teams: use orgId in all team and team member operations (#10862)
Also fixes issue in org users tests for postgres
2018-02-09 17:26:15 +01:00
e949eb3f58 Merge branch 'master' into dashboard-search-permissions-filter 2018-02-09 15:16:34 +01:00
a86f2fa34b user picker should only include users from current org (#10845) 2018-02-09 10:42:37 +01:00
8e8f3c4332 dashboard and folder search with permissions 2018-02-08 17:11:01 +01:00
5a85fb6d32 Merge branch 'master' into provisioning 2018-02-08 13:43:19 +01:00
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
b549d29319 Merge branch 'master' into provisioning 2018-02-08 11:01:09 +01:00
0e61a670bb fix: error handling now displays page correctly, fixes #10777 2018-02-06 12:28:17 +01:00
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
55100d5ff9 Merge pull request #10760 from grafana/10749_link_to_folder
Fix link to folder from permissions list
2018-02-05 11:34:59 +01:00
7d3b990e91 permissions: fix link to folder from permissions list
Also, closing Add Permissions CTA when DashboardPermissions and
FolderPermissions unmounts.
Fixes #10749"
2018-02-05 11:10:37 +01:00
cc0cc8dd73 changes to new urlformat for home dashboard (#10738) 2018-02-05 10:24:48 +01:00
07fa2f1722 fix: alert list links did not work, changed dashboardUri to Url, this is breaking api change in alert api (#10756) 2018-02-05 09:42:41 +01:00
130a2b6499 handle new error message 2018-02-02 11:06:32 +01:00
512f6992f1 dashfolders: rename Root folder to General. Closes #10692 2018-02-02 10:39:26 +01:00
fcd86fb24f make it easier for dashboards to generate ur; 2018-02-01 14:08:51 +01:00
74ca6f6dbf changes dashboard url in alertlist 2018-02-01 14:08:51 +01:00
ef90b3e49c Merge branch '7883_new_url_structure' into 7883_frontend_step2 2018-02-01 11:08:39 +01:00
b135df9a6c Merge remote-tracking branch 'upstream/master' into 7883_new_url_structure 2018-02-01 10:48:06 +01:00
eff687bece Merge pull request #10694 from grafana/7883_backend
backend for new url structure.
2018-02-01 09:35:00 +01:00
90933b0621 dashboard: refactor logic for retrieving url for folder/dashboard 2018-01-31 23:14:48 +01:00
c0c3f17d84 dashboards: when restoring a dashboard to an older version, set current uid 2018-01-31 18:40:54 +01:00
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
95d063621e dashboards: new route for deleting dashboards by uid 2018-01-31 18:40:54 +01:00
9aa488c084 Merge remote-tracking branch 'origin/7883_frontend_step' into 7883_backend
* origin/7883_frontend_step:
  dashboards: make scripted dashboards work using the old legacy urls
  dashboards: redirect from old url used to load dashboard to new url
  dashboards: add new default frontend route for rendering a dashboard panel
  dashboards: fix links to recently viewed and starred dashboards
  dashboards: use new *url* prop from dashboard search for linking to dashboards
  dashboards: when saving dashboard redirect if url changes
  dashboards: add new default frontend route for loading a dashboard
  dashboards: return url in response to save dashboard. #7883
2018-01-31 15:57:03 +01:00
57edf89033 dashboards: make scripted dashboards work using the old legacy urls
Scripted dashboards are still requested from /dashboard/script/scripted.js
#7883
2018-01-31 14:07:49 +01:00
a99331cdb9 dashboards: redirect from old url used to load dashboard to new url
If legacy backend routes (/dashboard/db/<slug> and /dashboard-solo/db/<slug>)
are requested we try to redirect to new routes with a 301 Moved Permanently
 #7883
2018-01-31 14:06:19 +01:00
79fe01959b alerting: small refactoring 2018-01-31 10:47:31 +01:00
bb3183f6cd removes uniqnes check on slug when saving dashboards 2018-01-31 10:29:52 +01:00
369597f7b2 dashboards: return url in response to save dashboard. #7883 2018-01-31 00:09:14 +01:00
eb765d288c alertlist: disable pause button when user does not have permission 2018-01-30 23:35:27 +01:00
fd59241e35 dashboards: revert adding api for retrieving uid by slug
Since we're already have possibility to get a dashboard by slug
it makes little sense to have a separate endpoint in api for
retrieving uid by slug.
#7883
2018-01-30 23:18:34 +01:00
9fb7b887db dashboards: add url property to dashboard meta and search api responses
#7883
2018-01-30 23:18:34 +01:00
7ee691dc48 dashboards: api for retrieving uid by slug. #7883 2018-01-30 23:18:34 +01:00
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
46e1296700 dashboards: return uid in response to creating/updating a dashboard. #7883 2018-01-30 23:18:34 +01:00
f5107d5023 alerting: add permission check in api for pausing alerts 2018-01-30 14:41:25 +01:00
87d6d791d5 dashfolders: adds comment for dashboard api tests 2018-01-30 14:09:30 +01:00
2b7984355a dashfolders: adds comment for dashboard acl test 2018-01-30 13:28:00 +01:00
a00a42d9ee api: extract api test code to common_test.go 2018-01-30 13:17:48 +01:00
0fb05bcf59 Merge remote-tracking branch 'upstream/master' into dashboard_permissions 2018-01-30 09:26:23 +01:00
d74a98feff dashfolders: link to folder for inherited permissions
In the permissions view in dashboard settings, this adds a
link to the parent folder for inherited permissions. Which
allows the user to easily navigate to the folder and change
inherited permissions.
2018-01-29 16:10:47 +01:00
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
bc5fae5367 dashfolders: merge conflict 2018-01-25 14:54:50 +01:00
67a9e6a71d provisioing: add lookup table provisioned dashboards 2018-01-23 21:52:55 +01:00
dbfaf5dac8 refactor: minor refactoring of PR #10560 2018-01-23 13:03:44 +01:00