oncall-engine/engine/apps/grafana_plugin/tests
Joey Orlando babacf4da8
refactor the is_rbac_permissions_enabled check to be more robust (#1099)
# What this PR does
Checks the `is_rbac_permissions_enabled` flag differently based on
whether we are dealing with an open-source, or cloud installation:
- for open-source installations, simply continue making a `HEAD` request
to the list RBAC permissions Grafana API endpoint.
- for cloud installations, use the `config` object returned from `GET
/instances/{instance_id}?config=true` and check whether
`instance_info["config"]["feature_toggles"]["accessControlOnCall"] ==
"true"`

## Which issue(s) this PR fixes
Resolves the issue in hosted grafana where when a stack is inactive, the
hosted grafana gateway, returns 200 to the `HEAD` request (which
erroneously sets the `is_rbac_permissions_enabled` flag to `true`)

## Checklist

- [x] Tests updated (N/A)
- [ ] Documentation added
- [x] `CHANGELOG.md` updated
2023-01-11 12:48:30 +01:00
..
test_app_config.py Get rid of installation token + add a bunch of tests (#624) 2022-11-21 16:26:00 +01:00
test_gcom_api_client.py refactor the is_rbac_permissions_enabled check to be more robust (#1099) 2023-01-11 12:48:30 +01:00
test_grafana_api_client.py refactor the is_rbac_permissions_enabled check to be more robust (#1099) 2023-01-11 12:48:30 +01:00
test_install.py Get rid of installation token + add a bunch of tests (#624) 2022-11-21 16:26:00 +01:00
test_self_hosted_install.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
test_status.py Get rid of installation token + add a bunch of tests (#624) 2022-11-21 16:26:00 +01:00
test_sync.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00