3
0
mirror of https://github.com/grafana/grafana.git synced 2025-02-25 18:55:37 -06:00
Commit Graph

20 Commits

Author SHA1 Message Date
Alexander Weaver
809aa38103
POST routes to PUT routes () 2022-05-06 14:33:30 -05:00
Sofia Papagiannaki
bb66c03f9a
Alerting: modify prometheus endpoints for proxying using the datasource UID ()
* Modify prometheus endpoints to expect the data source UID

* Update frontend
2022-05-06 15:05:02 -04:00
Alexander Weaver
0f56462fbe
Alerting: Provisioning message templates ()
* 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
Sofia Papagiannaki
610247d52a
Alerting: modify ruler endpoints for proxying using the datasource UID ()
* Modify ruler endpoints to expect the data source UID

* Update frontend

* Apply suggestion from code review
2022-05-05 14:58:32 +03:00
Sofia Papagiannaki
3e752a0db1
Alerting: modify alertmanager endpoints for proxying using the datasource UID ()
* Alerting: enable proxying alertmanager calls using the datasource UID

* Remove use of datasource ID from the API

* Update frontend
2022-04-29 10:25:22 +03:00
Alexander Weaver
735822e48a
Alerting: Add provisioning GET routes for message templates ()
* Template service

* Add GET routes and implement them

* Generate mock for persist layer

* Unit tests for reading templates

* Set up composition root and get integration tests working

* Fix prealloc issue

* Extract setup boilerplate

* Update AuthorizationTest

* Rebase and resolve

* Fix linter error
2022-04-28 13:51:57 -05:00
Karl Persson
e9a93ebfc9
Access Control: Move access control middlewares to domain package ()
* Move access control middleware to domain package
2022-04-28 10:46:18 +02:00
Sofia Papagiannaki
54962c2f0c
Alerting: Rename Recipient path parameter to DatasourceID () 2022-04-20 16:20:17 +03:00
Jean-Philippe Quéméner
388ecb4037
Alerting: Provisioning API - Contact points () 2022-04-13 22:15:55 +02:00
Alexander Weaver
dde0b93cf1
Alerting: Provisioning API - Notification Policies ()
* Base-line API for provisioning notification policies

* Wire API up, some simple tests

* Return provenance status through API

* Fix missing call

* Transactions

* Clarity in package dependencies

* Unify receivers in definitions

* Fix issue introduced by receiver change

* Drop unused internal test implementation

* FGAC hooks for provisioning routes

* Polish, swap names

* Asserting on number of exposed routes

* Don't bubble up updated object

* Integrate with new concurrency token feature in store

* Back out duplicated changes

* Remove redundant tests

* Regenerate and create unit tests for API layer

* Integration tests for auth

* Address linter errors

* Put route behind toggle

* Use alternative store API and fix feature toggle in tests

* Fixes, polish

* Fix whitespace

* Re-kick drone

* Rename services to provisioning
2022-04-05 16:48:51 -05:00
Yuriy Tseretyan
c1dbe7617c
fix scope for datasource:query action () 2022-03-29 09:58:59 -04:00
Yuriy Tseretyan
15e4556c2f
Alerting: update authorization logic to use proper legacy roles when fine-grained access is disabled ()
* require legacy Editor for post, put, delete endpoints
* require user to be signed in on group level because handler that checks that user has role Editor does not check it is signed in
2022-03-24 17:13:47 -04:00
Yuriy Tseretyan
8868848e93
Alerting: rule group update API to ignore deletes of rules user is not authorized to access ()
* verify that the user has access to all data sources used by the rule that needs to be deleted from the group
* if a user is not authorized to access the rule, the rule is removed from the list to delete
2022-03-24 16:53:00 -04:00
Yuriy Tseretyan
acd7be1cb4
Alerting: Change getEvaluatorForAlertRule to checkDatasourcePermissionsForRule ()
update method getEvaluatorForAlertRule to accept permissions evaluator and exit on the first negative result, which is more effective than returning an evaluator that in fact is a bunch of slices.
2022-03-23 17:11:30 +00:00
Yuriy Tseretyan
2ade8b56dd
Alerting: support fine-grained access control in ruler update API ()
* require Editor if FGAC is disabled. Otherwise, check `alert.rule:*` + `datasource:query` permissions when user changes rules.
2022-03-21 19:20:35 -04:00
Karl Persson
2727e2503f
Use corrct variable names () 2022-03-16 16:18:45 +01:00
Yuriy Tseretyan
c42d2e6f5d
Alerting: Add support for fine-grained access to alerting APIs () 2022-03-16 09:36:58 -04:00
Yuriy Tseretyan
468def0c00
Alerting: fixed roles for fine-grained access control ()
* move alerting actions to accesscontrol to avoid cycledeps
* define new actions and fixed roles for alerting
* add folder permission to alert reader role
2022-03-15 14:30:32 -04:00
Yuriy Tseretyan
f7894db99c
Alerting: declare authorization actions, scopes and roles for fine-grained access ()
* add actions, roles and route mapping for rule permission
* add instance\notification actions
* do not declare alerting roles if no feature flag is set (temporary)
2022-03-08 09:22:16 -05:00
Yuriy Tseretyan
ddfe2dce74
Alerting: Split grafana and lotex routes ()
* split Lotex and Grafana routes
* update template to use authorize function for every route
2022-02-04 12:42:04 -05:00