Commit Graph

3564 Commits

Author SHA1 Message Date
Ieva
f256f625d8
AccessControl: Enable RBAC by default (#48813)
* Add RBAC section to settings

* Default to RBAC enabled settings to true

* Update tests to respect RBAC

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2022-05-16 12:45:41 +02:00
Todd Treece
87e8521591
Prometheus: Implement Streaming JSON Parser (#48477)
use `prometheusStreamingJSONParser` feature toggle to enable
2022-05-13 20:28:54 +02:00
Yuriy Tseretyan
e528f2e430
Alerting: Use UID scope for folders authorization (#48970) 2022-05-13 18:05:25 +02:00
Yuriy Tseretyan
00ef1acb93
Alerting: Create folder for alerting when start from the scratch (#48866)
* create folderHelper struct
2022-05-13 11:49:04 -04:00
Karl Persson
60bc3e4e5c
AccessControl: Let users with data source create permissions list non-core plugins (#48897)
* Only require create and permissions for new data source page

* Let users with permissions to create data sources list non-core plugins

* Keep the admin check as fallback when using rbac as well
2022-05-13 10:30:26 +02:00
Eric Leijonmarck
555867135b
Access control: Using RBAC to filter users in list view that you have read access to (#47963)
* Add SQL filter for global user search

* Remove scope requirements from endpoints

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2022-05-13 09:26:34 +02:00
Karl Persson
1c679e814b
AccessControl: Only return action and scope for user permissions and make them unique (#48939)
* Only return action and scope for user permissions and make them unique
2022-05-12 17:15:18 +02:00
Yuriy Tseretyan
186ba26b59
Alerting: refactor rule API to create rule group in a single place (#48915)
* extract method toGettableRuleGroupConfig
2022-05-12 10:42:31 -04:00
Yuriy Tseretyan
369fcc5e9a
Alerting: scheduler to use short version of model for alert rule (#48916)
* scheduler to use a short version of alert rule model
2022-05-12 09:55:05 -04:00
Karl Persson
58fa119270
sort user permissions by scope (#48928) 2022-05-12 11:46:56 +02:00
Gabriel MABILLE
d31d300ce1
Accesscontrol: Rename scope permissions:delegate (#48898) 2022-05-11 17:22:43 +02:00
Yuriy Tseretyan
99156b40bd
Alerting: Move alertRuleRegistry to its own file (#48890)
* move alertRuleRegistry to its own file
* move tests to separate file
2022-05-11 10:04:50 -04:00
Yuriy Tseretyan
dc33e09b24
simplify getting a slice of keys (#48889) 2022-05-11 09:44:31 -04:00
Karl Persson
61772a66b6
AccessControl: Create own interface and impl for each permission service (#48871)
* Create own interfaces for team, folder, dashboard and data source permissions services
* Remove service container and inject them individually
2022-05-10 15:48:47 +02:00
George Robinson
897db011eb
Add error options for rendering to return errors on failure (#48864) 2022-05-09 19:11:24 +01:00
Ieva
6923b4c6c6
Dashboard: Fix dashboard update permission check (#48746)
* Change dash permission check for dashboards that are moved to a different folder
2022-05-09 12:01:03 +02:00
Ryan McKinley
d6d358ef26
Search: create bluge based index (#48606) 2022-05-09 01:00:09 -07:00
Alexander Weaver
99eaa0fc20
Put identifier in path (#48831) 2022-05-06 16:06:30 -05:00
Alexander Weaver
809aa38103
POST routes to PUT routes (#48828) 2022-05-06 14:33:30 -05:00
Sofia Papagiannaki
bb66c03f9a
Alerting: modify prometheus endpoints for proxying using the datasource UID (#48052)
* Modify prometheus endpoints to expect the data source UID

* Update frontend
2022-05-06 15:05:02 -04:00
Jean-Philippe Quéméner
30d9cc81ec
Alerting: check provenance of alert rules in current API (#48694) 2022-05-06 20:55:27 +02:00
Emil Tullstedt
51ff2b8c58
Logging: Unify logging fakes (#48822) 2022-05-06 17:44:22 +02:00
Krzysztof Dąbrowski
5be23b40b6
LDAP: allow Grafana Admin mapping without org_role field (#37189) 2022-05-06 12:12:42 +02:00
Will Browne
f135a5c8a4
Plugins: Refactor plugin resource call with and without data source (#48754)
* refactor plugin resource call with/without ds

* check err

* fix imports

* only validate req on ds path

* Update warn log

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-05-06 10:58:02 +02:00
Ieva
3c78196d0b
fix a bug (#48782) 2022-05-06 09:36:11 +01:00
Karl Persson
817cf52744
Access control: Allow users with permission to update team, dashboard and folder permissions to list users in OSS (#48275)
* Remove banner when missing permissions to list users

* For OSS allow users to list other users if they have permissions to
write either team, dashboard or folder permissions
2022-05-06 10:31:53 +02:00
Joan López de la Franca Beltran
9826a694a8
Encryption: Add Prometheus metrics (#48603) 2022-05-06 10:21:55 +02:00
Connor Lindsey
c1b5ea3e54
Tracing: Add trace to metrics config behind feature toggle (#46298)
* Add trace to metrics behind feature flag
2022-05-05 14:46:18 -06:00
Alexander Weaver
0f56462fbe
Alerting: Provisioning message templates (#48665)
* Generate API for writing templates

* Persist templates app logic layer

* Validate templates

* Extract logic, make set and delete methods

* Drop post route for templates

* Fix response details, wire up remainder of API

* Authorize routes

* Mirror some existing tests on new APIs

* Generate mock for prov store

* Wire up prov store mock, add tests using it

* Cover cases for both storage paths

* Add happy path tests and fix bugs if file contains no template section

* Normalize template content with define statement

* Tests for deletion

* Fix linter error

* Move provenance field to DTO

* empty commit

* ID to name

* Fix in auth too
2022-05-05 15:21:42 -05:00
Ieva
a5672758d8
Access control: further reduce access control feature toggle checks (#48171)
* reduce the usage of access control flag further by removing it from SQL store methods

* fixing tests

* fix another test

* linting

* remove AC feature toggle use from API keys

* remove unneeded function
2022-05-05 17:31:14 +02:00
Sofia Papagiannaki
610247d52a
Alerting: modify ruler endpoints for proxying using the datasource UID (#48046)
* Modify ruler endpoints to expect the data source UID

* Update frontend

* Apply suggestion from code review
2022-05-05 14:58:32 +03:00
ying-jeanne
0d14c27eb9
Chore: add Folderuid into panel-library API (#48577)
* add folderuid into interface

* panellibrary id/uid things

* modify doc

* update doc

* correct some comments
2022-05-05 10:04:54 +02:00
gotjosh
7313310080
Alerting: Fix & Cut the changelog (#48714) 2022-05-04 16:05:48 +01:00
Karl Persson
2738d1c557
Access Control: Move dashboard actions and create scope provider (#48618)
* Move dashboard actions and create scope provider
2022-05-04 16:12:09 +02:00
Adam Simpson
b2644de6c8
AzureMonitor: add feature toggle azureMonitorExperimentalUI for migrating to experimental UI (#48658)
* feat: add feature toggle azureMonitorExperimentalUI

Add QueryHeader which adds an experimental header to AzureMonitor. This work is documented in #44432.
2022-05-04 13:54:09 +00:00
Yuriy Tseretyan
f85e758972
unhide alert rule's data sources during migraiton (#48559) 2022-05-04 09:31:05 -04:00
Krzysztof Dąbrowski
c41397a6e7
LDAP: validate organization role during parsing (#37188)
* LDAP: validate organization role during parsing

* Trigger a new build

* Check if grafana_admin is present
2022-05-04 09:35:10 +02:00
Jeff Levin
38fc0c68e4
Update documentation to explicitly state we should not be putting migrations behind feature flags (#48663) 2022-05-03 15:10:59 -08:00
Jeff Levin
b88644cb83
public dashboards: add public dashboard table (#48470)
* add public dashboard table migration
2022-05-03 15:08:40 -08:00
Will Browne
4ecd57f49c
Plugins: Introduce HTTP 207 Multi Status response to api/ds/query (#48550)
* feature toggles

* return HTTP 207 from ds/query

* add ft check

* add API test

* add 207 check for qr

* change to OR

* revert check

* add explicit toggle check for cloudwatch

* remove unused import

* remove from defaults.ini

* add status codes to md and update swagger

* new fangled http api tests pattern

* update swagger

* Update docs/sources/http_api/data_source.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* add missing word and reformat

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2022-05-03 18:02:20 +02:00
Ivana Huckova
4661c9ca47
Query history: Cleanup (#48303)
* Query history: Clean up stale history after 14 days

* Add unstarring sleanup

* Add wraapping

* Update sql for mysql database

* Update

* Remove fmt.Print

* Refactor and simplify solution

* Update pkg/services/queryhistory/database.go

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* Adjust SQL to limit number of deleted queries

* Add limit enforcmenet to cleanup

* Change limit

* Update

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2022-05-03 14:49:58 +02:00
Jguer
6a303bb6b8
AccessControl: Rename builtin role roles to basic roles (#48519)
* AccessControl: Rename grafana:builtins roles to basic

* AccessControl: rename macro references to basic

Co-authored-by: gamab <gabi.mabs@gmail.com>
2022-05-03 13:59:16 +02:00
Andreas Gerstmayr
21034e31de
chore: remove executable permissions of source files and docs (#46303) 2022-05-03 12:08:14 +02:00
Artur Wierzbicki
de75dd6aad
Search: remove dev-mode from the feature flag 2022-05-02 23:01:29 +04:00
Ryan McKinley
a8f3b17262
SaveDashboard: remove feature flag for save drawer (#48462) 2022-05-02 09:29:22 -07:00
Guilherme Caulada
2533f21015
DataSource: Fix secure json data reset on datasource update (#48557)
* Fix secure json data reset on datasource update

* Update fillWithSecureJSONData to use DecryptedValues

* Remove unecessary conversion

* Move fillWithSecureJsonData logic to datasource service

* Add sanity check for nil secure json data
2022-05-02 11:29:13 -03:00
ying-jeanne
bde368be55
Chore : Replace dashboardid with dashboardUID in annotation API (#48481)
* replace dashboardid with dashboardUID in annotation API

* add some tests

* modify some docs and add uid into get endpoint

* rebase with main

* add map for avoiding too much retrieve on dashboards
2022-05-02 11:35:36 +02:00
Jean-Philippe Quéméner
0a87ef06af
Alerting: add safeguard for migrations that might cause dataloss (#48526)
* Alerting: add safeguard for migrations that might cause dataloss

* add test for panic

* add documentation
2022-05-02 10:38:42 +02:00
Jack Westbrook
39ee365b82
Swagger: Add integrity attributes (#48396) 2022-05-02 09:49:49 +02:00
Karl Persson
de50f39c12
Access Control: Refactor scope resolvers with support to resolve into several scopes (#48202)
* Refactor Scope resolver to support resolving into several scopes

* Change permission evaluator to match at least one of passed scopes
2022-05-02 09:29:30 +02:00