Commit Graph

3511 Commits

Author SHA1 Message Date
Will Browne
225ac8003c
Plugins: Tidy config struct (#84168)
* tidy plugins config usage

* fix tests
2024-03-11 16:28:46 +01:00
Josh Hunt
1ab8857e48
E2C: Add cloud migration is_target server config option (#83419) 2024-03-11 14:29:44 +02:00
Selene
1181141b40
Schemas: Refactor plugin's metadata (#83696)
* Remove kinds verification for kind-registry

* Read plugin's json information with json library instead of use thema binding

* Remove grafanaplugin unification

* Don't use kindsys for extract the slot name

* Fix IsGroup

* Remove all plugindef generation

* Refactor schema interfaces

* Pushed this change from a different branch by mistake...

* Create small plugin definition structure adding additional information for plugins registration

* Add some validation checks

* Delete unused code

* Fix imports lint
2024-03-07 11:09:19 +01:00
Sofia Papagiannaki
b8d8662bd9
Swagger: Re-generate the enterprise specification if enterprise is cloned (#81730)
* Swagger: Re-generate the enterprise specification if enterprise is cloned successfully

* API change to trigger the swagger CI step execution

* Swagger: Silence logs
2024-03-07 12:07:35 +02:00
linoman
8e827afb8c
Password Policy: Validate strong password upon update (#83959)
* add drawer for auth settings

* add StrongPasswordField component

* Add style to different behaviours

* update style for component

* add componenet to ChangePasswordForm

* pass the event handlers to the child component

* add style for label container

* expose strong password policy config option to front end

* enforce password validation with config option
2024-03-07 01:56:48 -06:00
Alexander Weaver
7a171fd14a
Regenerate openapidocs at 1.21.8 to match ci (#84037)
* Regenerate openapidocs at 1.21.8 to match ci

* Adjust trigger to work on the actual outputted files

* Also put go.mod and go.sum in the triggers

* manually fix

* Make an arbitrary change rather than touching the trigger to force a run

* Drop all triggers - run all the time

* Print diff - taken from @papagian's PR

* Manual fixes to swagger doc

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-03-06 16:08:45 -06:00
Carl Bergquist
b3efb4217e
Cfg: Adds experimental scope grafana.ini settings (#83174)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2024-03-05 16:41:19 +01:00
Alexander Zobnin
82a88cc83f
Access control: Extend GetUserPermissions() to query permissions in org (#83392)
* Access control: Extend GetUserPermissions() to query permissions in specific org

* Use db query to fetch permissions in org

* refactor

* refactor

* use conditional join

* minor refactor

* Add test cases

* Search permissions correctly in OSS vs Enterprise

* Get permissions from memory

* Refactor

* remove unused func

* Add tests for GetUserPermissionsInOrg

* fix linter
2024-03-04 13:29:13 +01:00
owensmallwood
0dfdb2ae47
Revert "Add FolderUID for library elements" (#83776)
Revert "Add FolderUID for library elements (#79572)"

This reverts commit 2532047e7a.
2024-03-01 18:16:43 +02:00
Jo
0aebb9ee39
Misc: Remove unused params and impossible logic (#83756)
* remove unused params and impossible logic

* remove unused param
2024-03-01 12:08:00 +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
Misi
75b020c19d
Cfg: Add a setting to configure if the local file system is available (#83616)
* Introduce environment.local_filesystem_available

* Only show TLS client cert, client key, client ca when local_filesystem_available is true

* Rename LocalFSAvailable to LocalFileSystemAvailable
2024-03-01 10:39:50 +01:00
idafurjes
2532047e7a
Add FolderUID for library elements (#79572)
* Add FolderUID in missing places for libraryelements

* Add migration for FolderUID in library elements table

* Add Folder UIDs tolibrary panels

* Adjust dashboard import with folder uid

* Fix lint

* Rename back FolderUID to UID

* Remove default

* Check if folderUID is nil

* Add unique indes on org_id,folder_uid,name and kind

* Update pkg/services/libraryelements/database.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Fix folder integration test, with unique index on library elements

* Make folder uids nullable and rewrite migration query

* Use dashboard uid instead of folder_uid

* Adjust test

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2024-03-01 10:16:33 +01:00
김은빈
96dfb385ca
Grafana: Replace magic number with a constant variable in response status (#80132)
* Chore: Replace response status with const var

* Apply suggestions from code review

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Add net/http import

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2024-02-27 18:39:51 +02:00
Will Browne
5edd96ae77
Plugins: Refactor plugin config into separate env var and request scoped services (#83261)
* seperate services for env + req

* merge with main

* fix tests

* undo changes to golden file

* fix linter

* remove unused fields

* split out new config struct

* provide config

* undo go mod changes

* more renaming

* fix tests

* undo bra.toml changes

* update go.work.sum

* undo changes

* trigger

* apply PR feedback
2024-02-27 12:38:02 +01:00
Khushi Jain
d02de5ddb9
Image Rendering: Add settings for default width, height and scale (#82040)
* Add Image width & height

* ability to change default width, height and scale

* default ini

* Update conf/defaults.ini

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update pkg/setting/setting.go

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update pkg/setting/setting.go

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Added docs, changed frontend

* Update conf/defaults.ini

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update conf/defaults.ini

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update conf/defaults.ini

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

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

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update pkg/api/dtos/frontend_settings.go

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update pkg/api/frontendsettings.go

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update pkg/api/render.go

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* add query float 64

* Update packages/grafana-runtime/src/config.ts

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update public/app/features/dashboard/components/ShareModal/utils.ts

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* spacing

* fix tests

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

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

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

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

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

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

---------

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2024-02-26 13:27:34 +01:00
Serge Zaitsev
d0679f0993
Chore: Add support bundle for folders (#83360)
* add support bundle for folders

* fix ProvideService in tests

* add a test for collector
2024-02-26 11:27:22 +01:00
Agnès Toulet
8d68159b52
Public Dashboards: Disable email-sharing when there is no license (#80887)
* PublicDashboards: Disable email-shared dashboards when feature is disabled

* fix pubdash creation when it was email-shared

* add feature name const in OSS

* update doc

* Update service.go

* fix test & linter

* fix test

* Update query_test.go

* update tests

* fix imports

* fix doc linter issues

* Update docs/sources/administration/enterprise-licensing/_index.md

* fix after merge
2024-02-22 09:34:14 +01:00
Ryan McKinley
809c1eaddb
Snapshots: delete from same org (#83111)
delete in org
2024-02-21 08:04:15 -05:00
Torkel Ödegaard
64e0a4282e
DataQuery: Track panel plugin id not type (#83091) 2024-02-21 09:38:42 +01:00
Xavi Lacasa
46c26bbd0b
Auth: Fix email verification bypass when using basic authentication (#82914) 2024-02-16 18:54:59 +01:00
Karl Persson
9e04fd0fb7
AuthToken: Remove client token rotation feature toggle (#82886)
* Remove usage of client token rotation flag

* Remove client token rotation feature toggle
2024-02-16 15:03:37 +01:00
linoman
ac84069071
Password policy (#82268)
* add password service interface

* add password service implementation

* add tests for password service

* add password service wiring

* add feature toggle

* Rework from service interface to static function

* Replace previous password validations

* Add codeowners to password service

* add error logs

* update config files


---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2024-02-16 04:58:05 -06:00
Gabriel MABILLE
846eadff63
RBAC Search: Replace userLogin filter by namespacedID filter (#81810)
* Add namespace ID

* Refactor and add tests

* Rename maxOneOption -> atMostOneOption

* Add ToDo

* Remove UserLogin & UserID for NamespaceID

Co-authored-by: jguer <joao.guerreiro@grafana.com>

* Remove unecessary import of the userSvc

* Update pkg/services/accesscontrol/acimpl/service.go

* fix 1 -> userID

* Update pkg/services/accesscontrol/accesscontrol.go

---------

Co-authored-by: jguer <joao.guerreiro@grafana.com>
2024-02-16 11:42:36 +01:00
Sofia Papagiannaki
69f604f7fa
Chore: Fix benchmarks (#82714) 2024-02-16 10:40:39 +02:00
Ieva
4d53385d5f
RBAC: allow listing permissions on the root folder (#82184)
* allow returning AC metadata for the root folder

* add a test

* share the reserved root folder UID with frontend
2024-02-15 16:13:14 +00:00
Karl Persson
1315c67c8b
Team/User: UID migrations (#82298)
* Add user uid migration to run on every startup to protect against empty values in a upgrade downgrade scenario

* Add team uid migration to run on every startup to protect against empty values in a upgrade downgrade scenario

* Run team uid migration
2024-02-12 14:48:29 +01:00
Will Browne
788b9afda3
Plugins: Make it possible to support multiple plugin versions (#82116)
* first pass

* use version in more places

* add comment

* update installer

* fix wire

* fix tests

* tidy

* simplify changes

* fix in mem

* remove unused step

* fix step dupe logic for child plugins + add tests
2024-02-12 12:47:49 +01:00
Jo
6f62d970e3
JWT Authentication: Add support for specifying groups in auth.jwt for teamsync (#82175)
* merge JSON search logic

* document public methods

* improve test coverage

* use separate JWT setting struct

* correct use of cfg.JWTAuth

* add group tests

* fix DynMap typing

* add settings to default ini

* add groups option to devenv path

* fix test

* lint

* revert jwt-proxy change

* remove redundant check

* fix parallel test
2024-02-09 16:35:58 +01:00
Dan Cech
790e1feb93
Chore: Update test database initialization (#81673)
* streamline initialization of test databases, support on-disk sqlite test db

* clean up test databases

* introduce testsuite helper

* use testsuite everywhere we use a test db

* update documentation

* improve error handling

* disable entity integration test until we can figure out locking error
2024-02-09 09:35:39 -05:00
Agnès Toulet
28e66b4ad8
Rendering: Adds PDF support behind feature toggle (#81811)
* start pdf refactor

* Update AppChrome.tsx

* Update AppChrome.tsx

* add encoding param to rendering grpc service

* fix plugin mode

* clean up

* fix backend tests

* fix lint errors

* Support pdf encoding in render http api

---------

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2024-02-08 13:09:34 +01:00
Tania
14a36b4040
Folders: Forbid performing operations on folders via dashboards HTTP API (#81264)
* Forbid creating folders via dashboard api

* Update delete endpoint

* Update docs
2024-02-04 01:16:19 +01:00
Ryan McKinley
ba3ee60711
K8s: Allow more control over the final openapi results (#81829) 2024-02-02 14:19:45 -08:00
Sofia Papagiannaki
cf6ebb0548
Swagger: Remove redundant annotation (#81780) 2024-02-02 15:11:23 +02:00
Misi
5da4021ea0
Auth: Fix routing of SSO setting pages (#81762)
Fix ac.Parameter
2024-02-02 11:14:22 +01:00
Eugene Klimov
702e22806c
Plugins Proxy: Allow using {{ .URL }} inside "routes" section in plugin.json (#80858)
Signed-off-by: Slach <bloodjazman@gmail.com>
Co-authored-by: Andres Martinez Gotor <andres.mgotor@gmail.com>
2024-02-02 09:23:07 +01:00
Ryan McKinley
795eb4a8d8
K8s/Snapshots: Add dashboardsnapshot api group (#77667) 2024-02-01 22:40:11 -08:00
Michael Mandrus
7464ea4346
Feature Toggles: Switch feature toggle admin page over to k8s API (#80854)
* add handling for legacy and k8s apis to frontend

* use backend srv directly not redux

* add unit test to make sure the correct apis are being called

* require api server flag

* fix feature toggle name

* ensure both pages work correctly

* make consistent with legacy api

* implement webhook update

* fix unit test

* remove old apis and update

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-02-01 23:52:02 -05:00
Ryan McKinley
9c9e5e68c8
User: Add uid colum to user table (#81615) 2024-02-01 18:14:10 -08:00
Todd Treece
67b6be5515
K8s: Refactor config/options for aggregation (#81739) 2024-02-01 17:27:30 -05:00
Ryan McKinley
e013cd427c
K8s: Add basic query service (#80325) 2024-01-31 20:36:51 +02:00
Dominik Prokop
f77c831e3f
Data query: Allow logging panel plugin id when executing queries (#81164)
* Data query: Allo logging panel plugin id when executing queries

* Update tracing header middleware

* Test fix

* Add panelPluginType to query analytics

* Cleanup
2024-01-30 00:06:31 -08:00
Mihai Doarna
6b28669e1f
Send empty http response when body is nil (#80196)
* build empty response if body is nil

* fix test
2024-01-29 14:17:56 +02:00
Giedrius Statkevičius
6f245121d0
Plugins: Fix colon in CallResource URL returning an error when creating plugin resource request (#79746)
* Plugin: handle colon character in path

url.Parse() does not handle the given input correctly when the input
contains a colon character. The user will see the following error
message when trying to use remote cluster in Elasticsearch:

```
level=warn msg="Failed for create plugin resource request" error="parse \"foo-*,*:foo-*/_mapping\": first path segment in URL cannot contain colon" traceID=
```

As far as I can tell, we only want to set the path here + rawquery so
avoid url.Parse() altogether.

* Add more tests

---------

Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
2024-01-29 10:31:49 +01:00
Ryan McKinley
1fab107e79
FeatureFlags: Avoid using cfg.IsFeatureToggleEnabled (#81407) 2024-01-28 15:22:45 -08:00
Ieva
048d1e7c86
RBAC: Annotation permission migration (#78899)
* add annotation permissions to dashboard managed role and add migrations for annotation permissions

* fix a bug with conditional access level definitions

* add tests

* Update pkg/services/sqlstore/migrations/accesscontrol/dashboard_permissions.go

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

* apply feedback

* add batching, fix tests and a typo

* add one more test

* undo unneeded change

* undo unwanted change

* only check the default basic permissions for non-OSS instances

* account for all wildcards and simplify the check a bit

* error handling and extra conditionals to avoid test failures

* fix a bug with admin permissions not appearing for folders

* fix the OSS check

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2024-01-26 17:17:29 +00:00
Gabriel MABILLE
722b78f3e0
RBAC: Add userLogin filter to the permission search endpoint (#81137)
* RBAC: Search add user login filter

* Switch to a userService resolving instead

* Remove unused error

* Fallback to use the cache

* account for userID filter

* Account for the error

* snake case

* Add test cases

* Add api tests

* Fix return on error

* Re-order imports
2024-01-26 09:43:16 +01:00
idafurjes
0880a239f8
Add leftover metrics for FolderID (#81246) 2024-01-25 12:14:18 +01:00
Misi
4577e61ee7
Auth: Improve /admin/authentication permission checks and include new SSO pages (#81183)
* Move evalAuthSettings to ssoutils

* Improve permission check for auth page
2024-01-25 11:13:24 +01:00
idafurjes
6b4eaa0d18
Add MFolderIDsAPICount metric to count FolderIDs in api package (#80866)
* Add MFolderIDsAPICount metric to cound FolderIDs in api package

* Change counter to counter vector with method names as string values
2024-01-24 12:39:11 +01:00