Commit graph

73 commits

Author SHA1 Message Date
Joey Orlando
9a7b8acd5a
centralize timezone validation + add serializer validation for on call shifts and schedules (#924)
* Centralize timezone validation into one spot + add serializer validation
for schedules and oncall shifts (both public and internal API)

* add engine-manage make command
2022-12-01 14:13:39 +01:00
Joey Orlando
9e598385f4
Add RBAC Support (#777)
* Modify plugin.json to support RBAC role registration

* defines 26 new custom roles in plugin.json. The main roles are:

- Admin: read/write access to everything in OnCall
- Reader: read access to everything in OnCall
- OnCaller : read access to everything in OnCall + edit access to Alert Groups and Schedules
- <object-type> Editor: read/write access to everything related to <object-type>
- <object-type> Reader: read access for <object-type>
- User Settings Admin: read/write access to all user's settings, not just own settings. This is in comparison to User Settings Editor which can only read/write own settings

* update changelog and documentation (#686)

* implement RBAC for OnCall backend

This commit refactors backend authorization. It trys to use RBAC authorization if the org's grafana instance supports it, otherwise it falls back to basic role authorization.

* update RBAC backend tests

* add tests for RBAC changes
- run backend tests as matrix where RBAC is enabled/disabled. When RBAC is enabled, the permissions granted are read from the role grants in the frontend's plugin.json file (instead of relying what we specify in RBACPermission.Permissions)
- remove --reuse-db --nomigrations flags from engine/tox.ini
- minor autoformatting changes to docker-compose-developer.yml

* remove --ds=settings.ci-test from pytest CI command

DJANGO_SETTINGS_MODULE is already specified as an env var so this is just unecessary duplication

* update gitignore

* update github action job name for "test"

* RBAC frontend changes

* refactors the use of basic roles (ex. Viewer, Editor, Admin) use RBAC permissions (when supported), or falling back to basic roles when RBAC is not supported.

- updates the UserAction enum in grafana-plugin/src/state/userAction.ts. Previously this was hardcoded to a list of strings that were being returned by the OnCall API. Now the values here correspond to the permissions in plugin.json (plus a fallback role)

* changes per Gabriel's comments:
- get rid of group attribute in rbac roles
- remove displayName role attribute
- remove hidden role attribute
- add back role to includes section

* don't try to update user timezone if they don't have permission
2022-11-29 09:41:56 +01:00
Joey Orlando
eb97797d43
Merge pull request #880 from grafana/jorlando/mobile-app-qr-code
Fetch/Display Mobile App QR Code
2022-11-28 18:54:05 +01:00
Joey Orlando
5a4fc90fa4
fetch/render mobile app QR code in user settings modal 2022-11-28 18:47:59 +01:00
Michael Derynck
3582f9b08f
Improve Jinja Template feedback and error handling (#884)
* Improve feedback so template errors are given to user

* Add security error logging

* Add limits for templates, payloads, results

* Show popup error notification for webhook errors and template errors that don't have a result

* Update tests

* Split exceptions into warnings/errors to give more control when previewing, rendering, saving templates

* Limit title lengths

* Make TypeError a warning

* Adjust title length limit

* Remove length limiting on urlize since it is being done on template render

* Fix tests

* Add KeyError and ValueError to warnings

* No longer enforcing json result when saving webhook in case it is dependent on payload

* Add tests for expected exceptions coming from apply_jinja_template

* Update changelog

* Send raw post if template result is not JSON
2022-11-28 09:46:51 -07:00
Vadim Stepanov
c23de808cb
Update CHANGELOG.md 2022-11-24 14:03:14 +00:00
Joey Orlando
d50db0dd80
[Hotfix] UI not handling invalid grafana tokens properly (#892)
* bug-fix

fix issue where frontend would not properly handle
scenario where Grafana API token was not yet available/valid
2022-11-23 13:29:58 +01:00
Michael Derynck
2edd88cbe3 Update changelog 2022-11-22 11:27:41 -07:00
Yulya Artyukhina
381520ee13
Get rid of installation token + add a bunch of tests (#624)
* Get rid of installation token (for OSS installations)

This is done by being required to supply the grafana API URL as an
environment variable on the backend. Additionally, optionally an OnCall
API URL environment variable can be passed in to the frontend (this basically
allows completely skipping the need to configure anything).
- deduplicated a lot of the sync logic on the frontend + made
error message more useful and consistent
- Split PluginConfigPage component into several subcomponents
(making it easier to test each individual component)
- Moved RootWithLoader (from plugin/GrafanaPluginRootPage) into its own
subcomponent (making it easier to test)
- Added tests for pre-existing components that were touched:
  - PluginConfigPage component (and its new subcomponents)
  - state/plugin and state/rootBaseStore functions
  - apps.grafana_plugin django app

Helm changes:
- add GRAFANA_API_URL to oncall.env
- some yaml autoformatting changes
- remove reference to python manage.py issue_invite_for_the_frontend --override

Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
2022-11-21 16:26:00 +01:00
Innokentii Konstantinov
671c3a74b9 Update Changelod 2022-11-18 17:39:23 +08:00
Innokentii Konstantinov
0b645b2835 Update changelog 2022-11-16 19:11:13 +08:00
Matias Bordese
4dc8adee1f
Update CHANGELOG.md 2022-11-09 15:05:55 -03:00
Joey Orlando
fd4877408a
remove grafana_plugin_management django app (#812)
* remove grafana_plugin_management django app

it seems to be no longer used or referenced. In addition apps.api.serializers.organization.PluginOrganizationSerializer was only
referenced from within grafana_plugin_management and is thereby safe
to remove.
2022-11-09 13:53:59 +01:00
Michael Derynck
f01d754851 Merge dev 2022-11-08 10:14:35 -07:00
Michael Derynck
9311b530c2 Update changelog 2022-11-05 00:44:55 -06:00
Michael Derynck
81702ba52d Merge dev 2022-11-03 12:42:36 -06:00
Matias Bordese
54204bad3b
Update CHANGELOG.md 2022-11-03 15:33:34 -03:00
Michael Derynck
71c8d17c78 Changelog cleanup 2022-11-01 18:29:28 -06:00
Michael Derynck
2905423bad Merge dev 2022-11-01 17:56:03 -06:00
Vadim Stepanov
ae485beded
Update CHANGELOG.md 2022-11-01 14:34:31 +00:00
Innokentii Konstantinov
ca6f7ef691 Update changelog 2022-11-01 19:03:01 +08:00
Innokentii Konstantinov
6d5853d1ff Update changelog 2022-11-01 19:02:10 +08:00
Innokentii Konstantinov
882851e0b8 Revert "Modify CHANGELOG.md"
This reverts commit fd8ad47a55.
2022-11-01 17:39:18 +08:00
Innokentii Konstantinov
fd8ad47a55 Modify CHANGELOG.md 2022-11-01 17:13:39 +08:00
Joey Orlando
5a4c3d6d77
remove POST /api/internal/v1/custom_buttons/{id}/action (#734)
* remove POST /api/internal/v1/custom_buttons/{id}/action
2022-10-28 10:44:37 +02:00
Ildar Iskhakov
00315e5c2d
Merge branch 'main' into dev 2022-10-27 21:28:44 +08:00
Joey Orlando
726650fe4c
Update CHANGELOG.md (#728) 2022-10-27 15:23:17 +02:00
Joey Orlando
627afe37e1
Remove references to Alert.migrator_lock attribute
This commit patches issue related to #708.

#708 forgot to remove attributes on models outside of the migration_tool django app that were referencing model attributes from migration_tool.

The only attribute that referenced a field in migration_tool was migrator_lock on the Alert model. This commit removes any references to that attribute.
2022-10-27 13:52:03 +02:00
Joey Orlando
945d29cf47
Update CHANGELOG.md 2022-10-27 12:17:20 +02:00
Ildar Iskhakov
440a5ee004
Update CHANGELOG.md 2022-10-27 16:02:05 +08:00
Joey Orlando
d19f135756
revert object destructuring changes which affect the value of 'this' (#719)
* revert object destructuring changes which affect the value of 'this'

* update CHANGELOG.md
2022-10-27 15:51:19 +08:00
Michael Derynck
c46e3bef01 Update changelog for v1.0.43 2022-10-25 13:42:32 -06:00
Vadim Stepanov
e83249ac31
Update CHANGELOG.md 2022-10-24 16:32:53 +01:00
Ildar Iskhakov
a60e14c3c6
Update CHANGELOG.md 2022-10-24 19:22:56 +08:00
Michael Derynck
363f019356 Update CHANGELOG.md 2022-10-18 16:12:57 -06:00
Matias Bordese
f65430fbca
Update CHANGELOG.md 2022-10-05 14:55:33 -03:00
Michael Derynck
0ee8f3e42b Update changelog for v1.0.39 2022-10-03 11:18:49 -06:00
Michael Derynck
2bfb834e92 Update changelog for v1.0.38 2022-09-30 12:40:22 -06:00
Joey Orlando
9f3f691ea4
Feat 549 - add telegram permalink to alert groups http response (#551)
* rename AlertGroup.permalink to slack_permalink

* add telegram key to alert_groups permalinks object in public API response
2022-09-28 16:59:57 +02:00
Vadim Stepanov
2dbd64105a
Update CHANGELOG.md 2022-09-23 12:10:19 +01:00
Vadim Stepanov
5859e883c5
Update CHANGELOG.md 2022-09-23 12:10:01 +01:00
Joey Orlando
e16064c6ba
#539 - add slack permalink to alert group public API response (#543)
* add .python-version to .gitignore

* add .nvmrc to frontend

Also update DEVELOPER.md to mention optionally using nvm

* update DEVELOPER.md to reflect running successfully locally

* markdown autoformatter styling changes

* add slack permalink to alertgroup public api http response

* update changelog

* address PR comments

- rename permalink to permalinks in alert group public api seralizer
- add permalinks property to AlertGroup model
- update public api alert groups test
- update alertgroups public documentation to include permalinks property

* add default DEBUG = True in dev.py settings
2022-09-22 15:17:17 +02:00
Matias Bordese
a606a6de2e
Update CHANGELOG.md 2022-09-12 10:20:08 -03:00
Vadim Stepanov
f5a8d859c7
Update CHANGELOG.md 2022-09-07 11:35:41 +01:00
Innokentii Konstantinov
0432f6f72a Update CHANGELOG.md 2022-09-06 20:18:03 +05:00
Vadim Stepanov
727dd438d4
Update CHANGELOG.md 2022-09-06 13:11:12 +01:00
Vadim Stepanov
b6e667928f
update changelog 2022-09-01 14:48:14 +01:00
Innokentii Konstantinov
0d24c1850d Update CHANGELOG.md 2022-09-01 16:22:58 +05:00
Michael Derynck
b71b92e8dd Update changelog for v1.0.30 2022-08-31 12:29:56 -06:00
Vadim Stepanov
86c0e816c5
Update CHANGELOG.md (#443)
* Update CHANGELOG.md

* update CHANGELOG.md
2022-08-31 11:56:03 +01:00