54 Commits

Author SHA1 Message Date
b8eeea0fe0 Remove flag disableSecretsCompatibility (#103135)
Remove flag disableSecretsCompatibility
2025-04-23 16:21:13 +00:00
fd6fd91115 Prometheus: Add support for cloud partners Prometheus data sources (#103482)
* wip

* Add prom flavor support for data source variables and export/import dashboards (#103321)

* add dashboard and data source var selection

* use match plugin id instead

* use updated matchpluginid

* formatting

* cleanup

* regex anchor

* update error msg

* Alerting: Clean up prometheus-flavored types and functions (#103703)

* clean up types and utility functions for dealing with
prometheus-flavored data sources

* Refactor alerting datasource types to use constants as source of truth

* Alerting: Clean up prometheus-flavored types and functions on the bac… (#103716)

Alerting: Clean up prometheus-flavored types and functions on the backend

* add matchPluginId tests

* Update matchPluginId func to bidirectional (#103746)

* update matchpluginid func to bidirectional

* lint

* formatting

* use actual isSupportedExternalRulesSourceType in test

* add tests in datasource_srv

* betterer

* remove type assertion

* remove unnecessary case

* use satisifies to not have to convert tuple to an array of string

* add prometheus_flavor test

---------

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: Alexander Akhmetov <me@alx.cx>
2025-04-10 12:49:11 -07:00
32643c933e LBAC for datasources: GA (#99511)
* GA: feature toggle removal of `teamHttpHeaders`

* Apply suggestions from code review

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2025-02-20 10:26:46 +00:00
d192a44469 Plugins: Modify interface for plugin validations to allow taking PDC into account (#96089)
* Request interceptor: Do not block PDC

* Apply change after feedback received

* Add test

* Check if secure socks proxy configured for the instance

* Apply suggestions from code review

* Add dedicated service for datasource request URL validation (#99179)

---------

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2025-01-24 17:01:46 +02:00
b1e1297bb3 LBAC for datasources: Move validation of rules from datasources to LBAC Rules (#94622)
* FIX: Remove the checks for lbac rules inside of datasources

* Remove json validation for lbac rules

* Preserve lbac rules in updates

* Refactored test to remove the table structure

* refactor: change to allow naming and concise override instead of complex branching

* refactor to make sure we set an empty field for updates

* bugfix

* check for datasources.JsonData

* fix merge

* add datasource to check for field presence only

* add function call for readability
2024-10-25 10:07:53 +01:00
7aeb1adff2 Fix: Check JSON data is not nil (#95189)
* Fix: Fix panic when json data are nil

* Use Interface()

* Feedback

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* Need to check inside the if statement

---------

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2024-10-22 18:09:44 +01:00
a46ff09bf9 LBAC for datasources: Override lbac rules if present when updating via datasources endpoints (#94608)
bloc updates to datasources
2024-10-17 11:29:30 +01:00
458fc69616 IAM: Add test for AddDataSource managed permissions (#94113)
Add test for AddDataSource managed permissions and fix control flow issues
2024-10-04 06:35:25 -05:00
01a4e6b9af Remove the need for plugins to implement AdmissionHandler for v0alpha1 (#93272) 2024-09-13 09:08:26 +02:00
9bb2cf4968 RBAC: Allow omitting default permissions when a new resource is created (#90720)
* Cfg: Move rbac settings to own struct

* Cfg: Add setting to control if resource should generate managed permissions when created

* Dashboards: Check if we should generate default permissions when dashboard is created

* Folders: Check if we should generate default permissions when folder is created

* Datasource: Check if we should generate default permissions when datasource is created

* ServiceAccount: Check if we should generate default permissions when service account is created

* Cfg: Add option to specify resources for wich we should default seed

* ManagedPermissions: Move providers to their own files

* Dashboards: Default seed all possible managed permissions if configured

* Folders: Default seed all possible managed permissions if configured

* Cfg: Remove service account from list

* RBAC: Move utility function

* remove managed permission settings from the config file examples, change the setting names

* remove ini file changes from the PR

* fix setting reading

* fix linting errors

* fix tests

* fix wildcard role seeding

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: jguer <me@jguer.space>
2024-07-24 19:31:26 +03:00
a22c1ae424 Chore: Remove provisional APIVersion from plugin info (#89831) 2024-07-01 10:53:16 +02:00
99d8025829 Chore: Move identity and errutil to apimachinery module (#89116) 2024-06-13 07:11:35 +03:00
60ce523b72 Refactor plugin context initialization (#88343) 2024-05-28 16:59:06 +03:00
0b526acf09 Fix provisioning for a missing plugin (#88354) 2024-05-28 01:47:45 +03:00
ffc2702552 Plugins: Support Admission validation hooks (#87718) 2024-05-24 18:45:16 +03:00
d8904f3ca4 Add apiVersion to plugin models (#87510) 2024-05-14 13:58:27 +02:00
b6f899d953 Migrate wrong datasource UIDs (#86598) 2024-05-03 13:32:07 +02:00
2049f766c6 Remove fmt.Println of client certificate (#86773) 2024-04-23 15:15:52 +01:00
724517dc40 Provisioning: datasources auto deletion (#83034) 2024-04-08 11:45:39 +02:00
257cc98062 Datasources: Remove unused functions (#85473)
* cleanup unused funcs

* remove more stuff
2024-04-02 16:19:52 +02:00
22fe7b067c Plugins: Set correct PDC config values for proxy requests (#85412)
pass appropriate values
2024-03-29 20:17:05 +02:00
b765c21d4c Plugins: Pass PDC file contents in requests (#84783)
* Plugins: Pass PDC file contents in requests

* go mod tidy

* undo go.mod changes

* fix linter

* fix tests

* undo unnecessary changes

* update dep

* join with comma

* update naming

* bump SDK
2024-03-22 13:52:24 +01:00
265200799d Chore: Update grafana-plugin-sdk (#84289) 2024-03-12 17:13:23 +01:00
Jo
36a19bfa83 AuthProxy: Allow disabling Auth Proxy cache (#83755)
* extract auth proxy settings

* simplify auth proxy methods

* add doc mentions
2024-03-01 11:31:06 +01:00
6768c6c059 Chore: Remove public vars in setting package (#81018)
Removes the public variable setting.SecretKey plus some other ones. 
Introduces some new functions for creating setting.Cfg.
2024-01-23 12:36:22 +01:00
def1b05a93 RBAC: Clean up data source permissions after data source deletion (#80654)
* clean up data source permissions after data source deletion

* remove a comment
2024-01-17 09:49:33 +00:00
58678f5879 Plugins: Add option to disable TLS in the socks proxy (#79246)
* Plugins: add option to disable TLS in the socks proxy

* fix allow_insecure docs

* upgrade github.com/grafana/grafana-plugin-sdk-go from v0.196.0 to v0.197.0

* fix conflicts
2023-12-14 12:16:32 -03:00
9a3b2937aa Data sources: Refactor logic for naming new data sources (#78479)
* move the name finding logic for new data sources from frontend to backend

* cleanup and fix test

* linting

* change the way the number after the ds type is incremented - keep incrementing it without adding more hyphens

* enterprise spec updates (unrelated to the PR)
2023-11-22 09:57:26 +00:00
f69fd3726b FeatureToggles: Add context and and an explicit global check (#78081) 2023-11-14 12:50:27 -08:00
94fec65192 RBAC: introduce a data source admin role (#75915)
* introduce data source admin role and fix frontend check

* introduce fixed roles for data source creator and team reader

* add documentation

* undo an unintended change
2023-10-19 14:36:41 +01:00
1dd97301e5 Chore: Adapt GetDataSourcesByType to plugins with aliases (#76637) 2023-10-17 11:09:56 +02:00
9d92818cae Plugins: Update PDC pattern from latest plugin SDK changes (#76576)
* update with sdk

* do sql

* fix core plugins

* fix proxy settings

* bump SDK version

* tidy

* enable pdc for test

* add codeowners

* bump dep

* go mod tidy

* bump SDK
2023-10-16 16:40:04 +02:00
91cf4f0c1c Revert "Plugins: Update PDC pattern from latest plugin SDK changes" (#76565)
Revert "Plugins: Update PDC pattern from latest plugin SDK changes (#76036)"

This reverts commit 151f6d6216e5e93edf56e4bbc6d3bfa5e0690b45.
2023-10-13 12:35:16 -04:00
151f6d6216 Plugins: Update PDC pattern from latest plugin SDK changes (#76036)
* update with sdk

* do sql

* fix core plugins

* fix proxy settings

* bump SDK version

* tidy

* enable pdc for test

* add codeowners
2023-10-13 14:42:15 +02:00
93cdc94a94 Chore: capitalise logs in other backend packages (#74344)
* capitalise logs in observability logs

* capitalise oss-bit-tent packages

* capitalise logs in aws-datasources

* capitalise logs for traces and profiling

* capitalise logs for partner datasources

* capitalise logs in plugins platform

* capitalise logs for observability metrics
2023-09-04 22:25:43 +02:00
025b2f3011 Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
6885b3d577 Chore: remove checks for whether RBAC is disabled (#73812)
* remove checks for whether access control is disabled, as it is always enabled now

* linting
2023-08-25 14:19:58 +01:00
2c949a6a33 Proxy: Set the proxy information in Grafana for Graphite (#72777) 2023-08-03 15:11:02 +03:00
a912c970e3 Provisioning: Fix overwrite SecureJSONData on provisioning (#72395)
* Overwrite SecureJSONData on provisioning
2023-07-27 11:11:43 +02:00
60496fbae3 Chore: Return correct error for name taken and validation error on add/update datasource (#70465) 2023-07-17 16:27:19 +02:00
42cdec369d Datasources: provide generic function to extract custom headers (#66738) 2023-04-19 17:04:30 +02:00
126c4a106e Chore: Remove result field from remaining datasources queries (#65054)
remove result field from datasources
2023-03-20 19:18:21 +01:00
39a4634ae9 Plugins: Fix bug with copying grafanaData (#64446) 2023-03-08 11:21:01 -07:00
49b3027049 Chore: Remove Result field from datasources (#63048)
* Remove Result field from AddDataSourceCommand
* Remove DatasourcesPermissionFilterQuery Result
* Remove GetDataSourceQuery Result
* Remove GetDataSourcesByTypeQuery Result
* Remove GetDataSourcesQuery Result
* Remove GetDefaultDataSourceQuery Result
* Remove UpdateDataSourceCommand Result
2023-02-09 15:49:44 +01:00
23c27cffb3 Chore: Rename Id to ID in alerting models (#62777)
* Chore: Rename Id to ID in alerting models

* Add xorm tags for datasource

* Add xorm tag for uid
2023-02-02 17:22:43 +01:00
c41f97029e Plugins: Fix circular reference in customOptions leading to MarshalJSON errors (#62328)
* Plugins: test ds.JsonData.MarshalJSON()

* CustomOptions: copy to avoid cyclic marshal
2023-01-31 12:35:36 +01:00
3b718a3e8f Plugins: enable the plugin sdk to get the json data for all datasources (#61729) 2023-01-19 08:49:45 -07:00
386faf5958 OpenSearch: Use aoss servicename if OpenSearch is configured as serverless (#60344)
* Use `aoss` if opensearch is configured as `serverless`
2022-12-14 20:22:26 +01:00
9855e74b92 Chore: Refactor quota service (#58643)
Chore: Refactor quota service (#57586)

* Chore: refactore quota service

* Apply suggestions from code review
2022-11-14 21:08:10 +02:00
96cdf77995 Revert "Chore: Refactor quota service (#57586)" (#58394)
This reverts commit 326ea86a579ed927b1999bba5f2c0a35e26506d9.
2022-11-08 11:52:07 +02:00