Commit Graph

787 Commits

Author SHA1 Message Date
Will Browne
3885497553
Plugins: Update renderer plugin source (#80643)
* rework renderer plugin source

* add tests
2024-01-18 11:06:33 +01:00
Gabriel MABILLE
6b954165c5
RBAC: Cover plugin routes (#80578)
* RBAC: Cover plugin routes

* Action instead of ReqAction

* Fix test initializations

* Fix NewPluginProxy call

* Duplicate test to add RBAC checks

* Cover legacy access control as well

* Fix typo

* action -> reqAction

* Add example

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>

---------

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2024-01-17 16:32:23 +01:00
Giuseppe Guerra
b40d3e7487
Plugins: Add enablePluginsTracingByDefault feature flag (#80195)
* Add enablePluginsTracingByDefault feature flag

* Enable tracing for all plugins if enablePluginsTracingByDefault is set

* fix docstrings for IsEnabled and IsEnabledGlobally

* fix tests

* do not use separate feature manager

* add test case

* Revert "fix tests"

This reverts commit 46a2420ed1.

* cleanup

* fix plugin tracing disabled if wrong plugin setting is present

* add test case for enabled on plugin with wrong plugin setting but with enablePluginsTracingByDefault feature flag

* Add RequiresRestart = true to enablePluginsTracingByDefault

* re-generate feature flags

* pr review feedback
2024-01-10 13:25:54 +02:00
Ryan McKinley
1caaa56de0
FeatureFlags: Use interface rather than manager (#80000) 2024-01-09 10:38:06 -08:00
Giuseppe Guerra
c045a9f395
Plugins: Fix symlinks inside plugins path not being followed (#80205)
* Plugins: Loader: Fix symlinks not followed when loading external plugins

* Add test case
2024-01-09 14:23:03 +01:00
Will Browne
78ae795e06
Plugins: Fix loading of dist folders (#80015)
* end to end

* tidy

* fix whitespace

* remove unused code

* fix linter

* fix gosec + add sort

* fix test

* apply cr feedback
2024-01-08 11:45:03 +01:00
Giuseppe Guerra
b1c7aa269b
Dependencies: Bump github.com/grafana/grafana-plugin-sdk-go from v0.197.0 to v0.198.0 (#79928)
* chore: Bump google.golang.org/grpc from 1.59.0 to 1.60.1

* Bump google.golang.org/protobuf to v1.32.0

* Fix make protobuf failing with latest protoc and protoc-gen-go

* Re-generate protobuf files

* Re-generate protobuf files

* Bump grafana-plugin-sdk-go

* go mod tidy
2024-01-03 13:36:44 +02:00
Will Browne
6ceab61bf8
Plugins: Support nested plugin signature validation on Windows (#79467)
* rework

* fix

* fix backend start

* fix tests

* fix

* print env

* enable CGO

* undo changes

* undo whitespace change
2023-12-19 11:56:40 +01:00
Will Browne
ef60c90dfa
Plugins: Make file system path handling in tests OS agnostic (#79651)
* make path handling OS agnostic

* PR feedback

* fix input for test case
2023-12-19 11:01:48 +01:00
Will Browne
ce8fd14f1f
Plugins: Make renderer service load renderer plugin (#77854)
* rendering service loads renderer plugin

* update naming

* tidy

* apply PR feedback

* fix missing feature manager

* fix step

* set plugin
2023-12-14 17:33:29 +01:00
Bruno
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
Andreas Christou
f3cdb44898
Plugins: Include Azure settings as a part of Grafana config sent in plugin requests (#79342)
* Add Azure settings and update tests

* Filter by plugin ID

* Add forward settings config variable

* Update line

* Add tests

* Update so that data sources are fully defined in config

* Update SDK and test

* Fix lint

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>

* Remove unnecessary if

---------

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>
2023-12-14 11:48:22 +00:00
Giuseppe Guerra
0d1d437c86
Plugins: Add forward_host_env_vars setting (#79333)
* Plugins: Add forward_host_env_vars_plugins setting

* Renamed forward_host_env_vars_plugins to forward_host_env_vars

* Add readPluginIDsList

* refactoring

* lint

* Use util.SplitString
2023-12-13 11:25:17 +02:00
Giuseppe Guerra
f76b9f266e
Plugins: Add hide_angular_deprecation setting (#79296)
* Add plugins.hide_angular_deprecation config ini

* Add more tests

* Remove the ability to use [plugins.*] hide_angular_deprecation
2023-12-12 11:20:21 +02:00
Gabriel MABILLE
5b70130e6c
Plugins: Rename externalServiceAuthentication to iam (#78686)
Plugins: Rename externalServiceAuthentication to iam
2023-12-04 13:14:21 +01:00
Gabriel MABILLE
ef2c79d22a
Chore: use errutil for pluginRepo errors (#78647)
* Chore: use errutil for pluginRepo errors

* Update pkg/util/errutil/status.go

* Use errutil helper functions

Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Forgot the log level

* Use entity

---------

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2023-11-30 15:49:27 +01:00
Andres Martinez Gotor
f8a6380510
Chore: Change endpoint to check versions in cli (#78008) 2023-11-21 12:46:26 +01:00
Andres Martinez Gotor
20f3a87bf5
Bug: Fix loading behavior with FlagExternalCorePlugins (#78388) 2023-11-21 11:51:13 +01:00
Giuseppe Guerra
027a157898
Plugins: Allow disabling "skip host environment variables" per-plugin (#78266)
* Plugins: Allow disabling skipping host environment variables per-plugin

* Renamed SkipEnvVarsDecorateFunc to SkipHostEnvVarsDecorateFunc

* PR review feedback

* fix tests
2023-11-17 16:12:05 +02:00
Will Browne
ddb7406caa
Plugins: Add running method to interface (#78326)
* add running to interface

* add context
2023-11-17 13:52:31 +01:00
Giuseppe Guerra
cb0a88a027
Plugins: Backend: Skip host environment variables (#77858)
* Add pluginsSkipHostEnvVars feature flag

* Set go-plugin's SkipHostEnvVar depending on feature flags

* add missing file

* Re-generate feature flags

* Add allowedHostEnvVarNames

* Fix feature toggles not being passed to plugin context service's plugin env vars

* Fix tests

* PR review feedback: Use cfg.Features

* Fix tests

* PR review feedback: removed DefaultProviderWithFeatures

* merge with master

* fix tests

* use features.IsEnabledGlobally
2023-11-15 18:09:14 +01:00
Will Browne
b3ad61e180
Plugins: Add plugin version field to proto interface (#78213)
add plugin version
2023-11-15 16:53:30 +01:00
Ryan McKinley
f69fd3726b
FeatureToggles: Add context and and an explicit global check (#78081) 2023-11-14 12:50:27 -08:00
Giuseppe Guerra
ab4fc07cc7
Plugins: Add statusSource to partial data response error log (#78057)
* Plugins: Add statusSource to partial data response error log

* Introduce DefaultStatusSource

* Add StatusSourceFromPluginErrorSource

* Moved StatusSourceFromPluginErrorSource

* Update pkg/services/pluginsintegration/clientmiddleware/logger_middleware.go
2023-11-14 16:27:48 +02:00
Andres Martinez Gotor
fcc2f01c7e
Chore: Update otel deps (#78069)
Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-11-14 14:14:15 +01:00
Will Browne
26bcfe300f
Plugins: Follow root level dist and siblings when walking file system (#78042)
* simplify

* add comments

* tidy up

* remove line

* update comment

* fix pfs test

* fix err import

* delete code
2023-11-14 10:31:46 +01:00
Gabriel MABILLE
fe8d0e6381
ExtSvcAuth: Refactor external service registry to use ExternalServiceRegistry variables (#78056)
ExtSvcAuth: Refactor external service registry to use ExternalServiceRegistry
2023-11-13 16:23:11 +01:00
Will Browne
4299efbc56
Plugins: Expose PID through proto interface (#77821)
* expose PID thru interface

* apply PR feedback

* simplify

* add read lock
2023-11-13 14:41:53 +01:00
Gabriel MABILLE
20a2840046
Plugin: Remove external service on plugin removal (#77712)
* Plugin: Remove external service on plugin removal

* Add feature flag check in the service registration service

* Initialize map

* Add HasExternalService as suggested

* Commit suggestion

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>

* Nit on test.

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>


---------

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
2023-11-13 13:18:13 +01:00
Gábor Farkas
2d391c1bf5
postgresql: change plugin id (#77444)
* postgres: change plugin id

* fixed cue file

* codeowners update

* fixed backend test
2023-11-13 08:49:26 +01:00
Giuseppe Guerra
7b4bcc86f1
Plugins: Pass OTEL sampling config to plugins (#76834)
* Pass OTEL sampling config to plugins

* fix capital letters

* Do not pass sampler env vars if sampling is not configured

* Add tests

* PR review feedback

* Simplify tracing env vars logic

* Update test to reflect pkg/infra/tracing behaviour
2023-11-10 14:56:08 +01:00
Giuseppe Guerra
da117aea1c
Plugins: Allow disabling angular deprecation UI for specific plugins (#77026)
* Plugins:Allow disabling angular deprecation UI for specific plugins

* add backend test

* changed test names

* lint

* Removed angular properties from DataSourceDTO

* Update tests

* Move angularDetected and hideAngularDeprecation in angularMeta property

* Fix angular property name in AppPluginConfig

* Fix reference to angularMeta.detected

* Fix hide_angular_deprecation not working for core plugins

* lint
2023-11-10 11:44:54 +01:00
Andres Martinez Gotor
f7361a2755
Chore: Update TestData README (#77607)
Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com>
2023-11-09 10:03:00 +01:00
Will Browne
19cd7dbae1
Plugins: Add API for creating pluginv2 proto client (#77492)
* first pass

* remove client from plugin

* fix wire

* update

* undo import change

* add opts

* add check

* tidy

* re-use logic

* rollback changes
2023-11-03 14:01:08 +01:00
Andres Martinez Gotor
d5f749482a
Ignore dist folder for core plugin (#77549) 2023-11-02 14:56:47 +01:00
Andres Martinez Gotor
00a596b2e0
Chore: Add app URL to the plugin config (#77455) 2023-11-02 13:26:16 +01:00
Gabriel MABILLE
83e9088314
AuthN: Set oauth client grant_types based on plugin state (#77248)
* Disable plugin service account

* Fix bug seen by linoman 💯

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>

* Account for PR feedback

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>

* Fix test data

* Enable datasource plugins by default

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>

* Update pkg/services/extsvcauth/oauthserver/oasimpl/service.go

* Handle error differently

* Fix service reg

---------

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2023-10-27 14:45:04 +02:00
Gabriel MABILLE
25b30aeb6d
Plugin: Enable service account based on plugin settings on init (#77193)
* Disable plugin service account

* Revert extsvc injection

* handle plugin state changes

* Use isProxyEnabled

* Remove plugininteg changes

* Change update function to also work for mysql 😩

* Plugin: enable service account based on plugin settings on
initialization

* Remove misleading comment

* Fix tests

* test message

* Clean up tests

* Simplify tests

* Re-order imports

* Remove unecessary comment

* Enable datasource plugins by default

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>

---------

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2023-10-27 14:27:06 +02:00
Marcus Efraimsson
9bf7eb5fbc
Plugins: Adds logging around loading of plugins for better tracking (#76896) 2023-10-25 14:01:30 +02:00
Hugo Kiyodi Oshiro
dfc1875061
Plugins: Add managed instance installation resources (#76767)
* Plugins: Add configs to allow managed install

* Expose methods to use with cloud plugin installer

* Change plugins installer bind to OSS
2023-10-24 16:21:37 +02:00
Andres Martinez Gotor
d83142c513
Chore: Use externally built core plugins (#76682) 2023-10-20 13:12:58 +02:00
Marcus Efraimsson
2adfdb49c9
Update grafana-plugin-go-sdk to v0.187.0 (#76816) 2023-10-19 16:17:31 +02:00
Gabriel MABILLE
797a3c57af
Plugins: Automatic service account (and token) setup (#76473)
* Update cue to have an AuthProvider entry

* Cable the new auth provider

* Add feature flag check to the accesscontrol service

* Fix test

* Change the structure of externalServiceRegistration (#76673)
2023-10-17 16:21:23 +02:00
Giuseppe Guerra
f5076d1868
Plugins: Add status_source label to plugin request metrics (#76236)
* Plugins: Chore: Renamed instrumentation middleware to metrics middleware

* Removed repeated logger attributes in middleware and contextual logger

* renamed loggerParams to logParams

* PR review suggestion

* Add pluginsInstrumentationStatusSource feature toggle

* Plugin error source prometheus metrics

* Add error_source to logs

* re-generate feature toggles

* fix compilation issues

* remove unwanted changes

* Removed logger middleware changes, implement error source using context

* Renamed pluginmeta to pluginrequestmeta, changed some method names

* Fix comment

* pluginrequestmeta.go -> plugin_request_meta.go

* Replaced plugin request meta with status source

* Add tests for pluginrequestmeta status source

* Fix potential nil pointer dereference in instrmentation middleware

* Add metrics middleware tests

* Sort imports in clienttest.go

* Add StatusSourceFromContext test

* Add error_source label to plugin_request_duration_seconds

* Re-generate feature flags

* lint

* Use StatusSourcePlugin by default

* re-generate feature flags
2023-10-17 10:27:45 +02:00
Andres Martinez Gotor
157ea31b03
Build testdata frontend standalone (#75833) 2023-10-16 17:31:43 +02:00
Will Browne
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
Dan Cech
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 151f6d6216.
2023-10-13 12:35:16 -04:00
Will Browne
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
Giuseppe Guerra
50504ba008
Plugins: Chore: Renamed instrumentation middleware to metrics middleware (#76186)
* Plugins: Chore: Renamed instrumentation middleware to metrics middleware

* Removed repeated logger attributes in middleware and contextual logger

* renamed loggerParams to logParams

* PR review suggestion

* Add contextual logger middleware

* Removed unused params from logRequest

* Removed unwanted changes

* Safer FromContext method

* Removed traceID from logParams
2023-10-11 12:42:32 +02:00
Andres Martinez Gotor
1f8b08202e
Chore: Avoid showing plugin version if it's %VERSION% (#75974) 2023-10-11 10:49:30 +02:00